From: Mats Petersson <mats.petersson@citrix.com>
To: xen-devel@lists.xen.org
Subject: Re: Woes of NMIs and MCEs, and possibly how to fix
Date: Mon, 3 Dec 2012 11:45:33 +0000 [thread overview]
Message-ID: <50BC90DD.5050907@citrix.com> (raw)
In-Reply-To: <CAFLBxZbs0649ABJkRj4HsQDvHr__O6isfjPsQJWrRmfvJokxJA@mail.gmail.com>
On 03/12/12 11:24, George Dunlap wrote:
> On Fri, Nov 30, 2012 at 5:34 PM, Andrew Cooper
> <andrew.cooper3@citrix.com <mailto:andrew.cooper3@citrix.com>> wrote:
>
> 3) SMM mode executing an iret will re-enable NMIs. There is
> nothing we
> can do to prevent this, and as an SMI can interrupt NMIs and MCEs, no
> way to predict if/when it may happen. The best we can do is
> accept that
> it might happen, and try to deal with the after effects.
>
>
> Did you actually mean IRET, or did you mean RSM? Does it make a
> difference?
If, for some obscure reason, the SMM code decides, for example, to run
code like "int 0x21", where the int 0x21 handler ends with the rather
predictable IRET to return to the caller, then you would indeed "unlock"
the NMI blocking that happens from the NMI being taken by the processor.
NMI will still not interrupt the SMM code, but it WILL interrupt the
code that was running before SMI was taken - which could be an NMI
handler, that doesn't expect another NMI.
RSM doesn't, in and of itself [unless "messing" with the saved state]
alter the NMI state in other ways than "restore to previous value".
>
> As for 1 possible solution which we cant use:
>
> If it were not for the sysret stupidness[1] of requiring the
> hypervisor
> to move to the guest stack before executing the `sysret`
> instruction, we
> could do away with the stack tables for NMIs and MCEs alltogether, and
> the above crazyness would be easy to fix. However, the overhead of
> always using iret to return to ring3 is not likely to be acceptable,
> meaning that we cannot "fix" the problem by discarding interrupt
> stacks
> and doing everything properly on the main hypervisor stack.
>
>
> 64-bit Intel processors have SYSEXIT, right? It's worth pointing out
> the following alternatives, even if we never actually use them:
>
> 1. Use SYSEXIT on Intel processors and let the bugs (or some subset of
> them) remain on AMD
> 2. Use SYSEXIT on Intel processors and IRET on AMD
> Given that AMD has cut back their investment in OSS development, and
> is talking about moving to ARM, it may only be a matter of time before
> Intel is the only important player in the x86 world.
Surely we would still want to support existing machines made with AMD
processors. And as far as possible, we should keep the code architecture
independent. We do not want a bunch of "IF processor=INTEL" in the
assembler code [and even less, "#if BUILD_FOR_INTEL" and separate
binaries, I would expect].
SYSCALL and SYSRET is the corresponding pair of instructions as SYSENTER
and SYSEXIT but for 64-bit OS's (don't ask me why they decided to add a
new pair of instructions, rather than just alter the behaviour of
SYSENTER/SYSEXIT. I'm sure there were some reason for this, but it's
beyond my understanding.
--
Mats
next prev parent reply other threads:[~2012-12-03 11:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 17:34 Woes of NMIs and MCEs, and possibly how to fix Andrew Cooper
2012-11-30 17:56 ` Tim Deegan
2012-11-30 21:59 ` Andrew Cooper
2012-12-03 8:28 ` Jan Beulich
2012-11-30 19:12 ` Mats Petersson
2012-11-30 20:24 ` Tim Deegan
2012-11-30 22:55 ` Andrew Cooper
2012-12-01 9:09 ` Tim Deegan
2012-12-03 8:09 ` Jan Beulich
2012-12-03 8:26 ` Jan Beulich
2012-12-03 11:24 ` George Dunlap
2012-12-03 11:45 ` Mats Petersson [this message]
2012-12-03 12:31 ` Jan Beulich
2012-12-03 11:50 ` Jan Beulich
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=50BC90DD.5050907@citrix.com \
--to=mats.petersson@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.