Messages in this thread | | | Date | Mon, 28 Feb 2011 15:15:16 +0000 | From | Matthew Garrett <> | Subject | Re: [PATCH] x86: use int instead of long to set reset vector back to 0 |
| |
On Mon, Feb 07, 2011 at 11:25:00PM -0500, Don Zickus wrote: > A customer of ours, complained that when setting the reset vector > back to 0, it trashed other data and hung their box. They noticed > when only 4 bytes were set to 0 instead of 8, everything worked > correctly.
We're supposed to be resetting trampoline_phys_low and trampoline_phys_high here, which are two 16-bit values. Writing 64 bits is definitely going to overwrite space that we're not supposed to be touching.
> - *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0; > + *((volatile int *)phys_to_virt(apic->trampoline_phys_low)) = 0;
I'd suggest either using u32 here, or alternatively make it more obvious what's going on and set trampoline_phys_low and trampoline_phys_high (which are both 16 bit) independently.
Ingo? Looks like you touched this last, but it seems that the bug was there already. -- Matthew Garrett | mjg59@srcf.ucam.org
| |