public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Yang, Sheng" <sheng.yang@intel.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: VMX: NMI injection without virtual NMI support
Date: Thu, 11 Sep 2008 17:11:14 +0200	[thread overview]
Message-ID: <48C93512.4050805@siemens.com> (raw)

Hi Sheng,

we had parts of this discussion privately a while back, but now I need
to dig deeper. I finally have to complete and push out user space NMI
injection that bitrots over and over again in my queue.

Intel CPUs with virtual NMI support can easily be programmed to inject
NMIs only when the guest CPU is ready or tell the guest to exit as soon
as it changes its NMI readiness. But we are also facing a lot of CPUs
that were produced without this feature, and we need to find some way to
achieve virtual NMI support for them, even if the interruptibility of
the guest is not as good as with true virtual NMIs.

Now my questions to you or anyone else with VMX expert knowledge:

The System Programming Guide, Volume 3B, 27.2 says that "Without
NMI-window exiting support, the VMM will need to poll and check the
interruptibility state of the guest to deliver virtual NMIs."
Interruptibility involves, besides "blocked by MOV SS" and "blocked by
STI", the NMI nesting. So, how can the VMM track if the guest is still
inside its NMI handler after event injection?

According to 22.6.1, NMI blocking is active as long as the guest runs if
the "NMI-exiting" control bit is 1 (and setting it appears to be
required to avoid that the guest can block NMIs for the host, right?).
But what does this mean for bit 3 of the interruptibility state? Can I
still use it after some guest exit for whatever reason (like a hard IRQ)
to poll if the guest can now accept pending virtual NMIs? In that case,
virtual NMI injections would only be delayed a bit on older CPUs, but
could still work reliably, right? Or is there some other way to track
the NMI interruptibility on such CPUs?

TiA,
Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

             reply	other threads:[~2008-09-11 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-11 15:11 Jan Kiszka [this message]
2008-09-12  6:29 ` VMX: NMI injection without virtual NMI support Yang, Sheng
2008-09-12  8:34   ` Jan Kiszka
2008-09-13  5:14     ` Avi Kivity
2008-09-13  6:27       ` Jan Kiszka
2008-09-13  8:58         ` Avi Kivity

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=48C93512.4050805@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng.yang@intel.com \
    /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