tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: suspicious code in ioapic locking

On Wed, Apr 23, 2008 at 01:20:40AM -0400, Stephen Degler wrote:

> The apic handling routines embedded in the macros in vector.S come from 
> i82093reg.h, and operate on struct pic (sys/x86/include/pic.h).  The 
> __cpu_simple_lock_t in the struct pic is now a byte, so the code is 
> wrong.  This doesn't seem to break anything, probably due to structure 
> padding.  The following patch corrects the ioapic code.  Another 
> approach would be to rearrange the register usage so that the simple 
> lock routines could be called directly, but this would be more 
> involved.  In the patch below, I used %bl because %rbx is blown away in 
> the macros anyway.
> Let me know if you think I should commit this.

cmpxchgb %bl,PIC_LOCK(%rdi)                    ;       \ 

That should be:

        cmpxchgb        ...


Home | Main Index | Thread Index | Old Index