Messages in this thread | | | Date | Wed, 27 May 2009 19:56:59 -0700 | From | "H. Peter Anvin" <> | Subject | Re: LOCK prefix on uni processor has its use (was Re: [BUG FIX] Make x86_32 uni-processor Atomic ops, Atomic) |
| |
Harald Welte wrote: > * A read-modify-write sequence cannot be interupted. > * All X86 instructions except rep-strings are atomic wrt interrupts. > * The lock prefix has uses on a UP processor: It keeps DMA devices from > interfering with a read-modify-write sequence
Correct.
> Now the question is: Is this a valid operation of a driver? Should the driver > do such things, or is such a driver broken? When would that occur? I'm trying > to come up with a case, but typically you e.g. allocate some DMA buffer and > then don't touch it until the hardware has processed it.
The Linux driver model does not permit this as a *lot* of hardware doesn't support this correctly, and even on x86 there are lots of chipset bugs in this regard. It is of course possible to write x86-only drivers that would do this anyway, but those should not use LOCK_PREFIX instructions.
-hpa
-- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
| |