Re: [PATCH] x86: use int instead of long to set reset vector backto 0

From: Matthew Garrett
Date: Mon Feb 28 2011 - 10:15:30 EST


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@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/