Corey Minyard <minyard@xxxxxxx> wrote:It took some thought and I couldn't think of anything simpler. I posted in on lkml a little while ago, and some people tried but nobody else found a simpler solution that worked with SMP.
This patch fixes a race between the CMOS clock setting and the NMI
code. The NMI code indiscriminatly sets index registers and values
in the same place the CMOS clock is set. If you are setting the
CMOS clock and an NMI occurs, Bad values could be written to or
read from the CMOS RAM, or the NMI operation might not occur
correctly.
Fixing this requires creating a special lock so the NMI code can
know its CPU owns the lock an "do the right thing" in that case.
hm, tricky patch. I can't see any holes in it. The volatile variable is
awkward but should be OK on x86 and I can see the need for it.
There's a preposterous amount of inlining happening in this code. HenceCertainly. I'll try to have it sometime today.
your patch took the size of drivers/char/rtc.o from
text data bss dec hex filename
3657 540 8 4205 106d drivers/char/rtc.o
to
5419 540 8 5967 174f drivers/char/rtc.o
Do you think you could take a look at uninlining everything sometime?