Re: NMI broadcast causes divide error?

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

 



On Fri, May 23, 2008 at 11:57 PM, Vegard Nossum <vegard.nossum@xxxxxxxxx> wrote:
> On Fri, May 23, 2008 at 4:55 PM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:
>> It is not spamming, it is education....thank for the info.   BTW...I
>> think u gave me an idea now......
>>
>> Currently your kmemcheck is restricted to only one CPU.   Why not
>> ALWAYS enable all the  CPU to run at the same time....BUT WHEN AND
>> ONLY WHEN read operation is  detected on one CPU.....immediately send
>> an IPI to all other CPU to freeze their operation.....until the not
>> present flag is turned off again.....so it solved your "very small
>> window" of racing condition.....
>>
>> What do you think?
>
> Hi, and thanks for the suggestion :-)
>
> Coincidentally, I sent the patch that does exactly this to LKML only 3
> minutes before I got your e-mail!
>
> (http://lkml.org/lkml/2008/5/23/179)
>
>
> Vegard

Coincidentally, I just saw an email in LKML on your patch BEFORE I
read your current posting in kernelnewbies....:-).   but i took my
time to sleep over it...as i was trying to puzzle it out myself....now
i gave up......

Was trying to read the Intel manual.....but I think I shall ask here....

Ok.....u mentioned IPI won't work ...have to be NMI....I don't
understand this part.....why IPI will result in deadlock?

Task A....doing some work....read mem encountered....memory is
NP....faulted....then inside the fault handler....send an IPI to all
other CPU to freeze their operation (ie, from multi-CPU mode of
operation shrank to single-CPU operation ---> but just only for  this
small window)...now safe to do the page table stuff (lock page table +
NP turned off) ...then return from page fault handler to the direct
memory read now....(single-step mode for only this read
instruction).....and then go back to page fault handler to  turn the
NP on again and unlock the page table and change to non-single-step
mode of execution ....and followed by enabling all other CPU via IPI
again.....

THis is the overall scenario .... I guessed....when IPI is
received...it is possible to "freeze" the CPU....right?   (not sure
about the hardware part).....and it need not necessarily be the
bootcpu that  is the sole CPU executing - correct?   So when
frozen.....whether irq for that CPU is enabled or not....it will not
be able to receive all irq...until the next IPI is received to wake it
up....correct?

not sure how the deadlock comes about...???

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux