public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Are x86 trap gate handlers safe for preemption?
@ 2002-10-30 20:46 Mikael Pettersson
  2002-10-30 22:51 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Pettersson @ 2002-10-30 20:46 UTC (permalink / raw)
  To: rml; +Cc: linux-kernel

Consider an exception handler like vector 7, device_not_available:

ENTRY(device_not_available)
        pushl $-1                       # mark this as an int
        SAVE_ALL
        movl %cr0, %eax
        testl $0x4, %eax                # EM (math emulation bit)
        jne device_not_available_emulate
        preempt_stop

Since this is invoked via a trap gate and not an interrupt gate,
what's preventing this code from being preempted and resumed on
another CPU before the read from %cr0? Another example is the
machine_check vector (also trap gate) whose handlers access MSRs.

I'm sure this actually works, but I don't see how.

/Mikael

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-30 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-30 20:46 Are x86 trap gate handlers safe for preemption? Mikael Pettersson
2002-10-30 22:51 ` Linus Torvalds
2002-10-31  0:01   ` george anzinger
2002-10-31  0:05   ` george anzinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox