linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* logbuf_lock deadlock on NMI
@ 2002-08-31  9:12 Luca Barbieri
  0 siblings, 0 replies; only message in thread
From: Luca Barbieri @ 2002-08-31  9:12 UTC (permalink / raw)
  To: Linux-Kernel ML

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

I already mentioned this in an unrelated thread but I got no responses.

NMIs, by definition and documentation, are non maskable. This means that
we can get them anywhere, even when interrupts are disabled.

The problem is that in some paths of the NMI handler (mem_parity_error,
io_check_error, mca_handle_nmi), we call printk without busting
spinlocks first.
As a consequence, if I'm not missing something, if we get e.g. a memory
parity error while inside printk, we deadlock on logbuf_lock.

Apart from removing logbuf_lock and other locks that might be held in
printk, we could solve this by telling the APIC (I think that the same
can be done with the 8259 but I'm not sure) to send an interrupt to the
current CPU.
The interrupt, being maskable, will be triggered only outside
irq-protected spinlocks so we can safely do the NMI printk inside it.

Alternatively we may just reset the locks but since some errors are
non-fatal it probably isn't a good idea.

Any comments?


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-31  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-31  9:12 logbuf_lock deadlock on NMI Luca Barbieri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).