From: Mikael Pettersson <mikpe@csd.uu.se>
To: rml@tech9.net
Cc: linux-kernel@vger.kernel.org
Subject: Are x86 trap gate handlers safe for preemption?
Date: Wed, 30 Oct 2002 21:46:59 +0100 [thread overview]
Message-ID: <15808.17731.311432.596865@kim.it.uu.se> (raw)
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
next reply other threads:[~2002-10-30 20:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-30 20:46 Mikael Pettersson [this message]
2002-10-30 22:51 ` Linus Torvalds
2002-10-31 0:01 ` george anzinger
2002-10-31 0:05 ` george anzinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15808.17731.311432.596865@kim.it.uu.se \
--to=mikpe@csd.uu.se \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®