public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>, Avi Kivity <avi@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH v2 4/4] KVM: x86: Add VCPU substate for NMI states
Date: Mon, 19 Oct 2009 22:39:50 +0200	[thread overview]
Message-ID: <20091019203950.GC8278@redhat.com> (raw)
In-Reply-To: <20091019203254.GD17781@amt.cnet>

On Mon, Oct 19, 2009 at 06:32:54PM -0200, Marcelo Tosatti wrote:
> On Thu, Oct 15, 2009 at 07:05:36PM +0200, Jan Kiszka wrote:
> > This plugs an NMI-related hole in the VCPU synchronization between
> > kernel and user space. So far, neither pending NMIs nor the inhibit NMI
> > mask was properly read/set which was able to cause problems on
> > vmsave/restore, live migration and system reset. Fix it by making use
> > of the new VCPU substate interface.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> > 
> >  Documentation/kvm/api.txt       |   12 ++++++++++++
> >  arch/x86/include/asm/kvm.h      |    7 +++++++
> >  arch/x86/include/asm/kvm_host.h |    2 ++
> >  arch/x86/kvm/svm.c              |   22 ++++++++++++++++++++++
> >  arch/x86/kvm/vmx.c              |   30 ++++++++++++++++++++++++++++++
> >  arch/x86/kvm/x86.c              |   26 ++++++++++++++++++++++++++
> >  6 files changed, 99 insertions(+), 0 deletions(-)
> > 
> > diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt
> > index bee5bbd..e483edb 100644
> > --- a/Documentation/kvm/api.txt
> > +++ b/Documentation/kvm/api.txt
> > @@ -848,3 +848,15 @@ Deprecates: KVM_GET/SET_CPUID2
> >  Architectures: x86
> >  Payload: struct kvm_lapic
> >  Deprecates: KVM_GET/SET_LAPIC
> > +
> > +6.8 KVM_X86_VCPU_STATE_NMI
> > +
> > +Architectures: x86
> > +Payload: struct kvm_nmi_state
> > +Deprecates: -
> > +
> > +struct kvm_nmi_state {
> > +       __u8 pending;
> > +       __u8 masked;
> > +       __u8 pad1[6];
> 
> Don't you also have to save "nmi_injected", in case of failure during
> NMI delivery.
> 
> BTW, what happens to exceptions that fail to be delivered? Can't see
> where they are saved/restored across migration.
> 
The instruction that caused an exception will be re-executed after
migration and exception will be regenerated. But I think we should
migrate exception anyway for completeness.

--
			Gleb.

  reply	other threads:[~2009-10-19 20:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 17:05 [PATCH v2 0/4] Extensible VCPU state IOCTL Jan Kiszka
2009-10-15 17:05 ` [PATCH v2 1/4] KVM: Reorder IOCTLs in main kvm.h Jan Kiszka
2009-10-15 17:05 ` [PATCH v2 3/4] KVM: x86: Add support for KVM_GET/SET_VCPU_STATE Jan Kiszka
2009-10-15 17:05 ` [PATCH v2 4/4] KVM: x86: Add VCPU substate for NMI states Jan Kiszka
2009-10-19 20:32   ` Marcelo Tosatti
2009-10-19 20:39     ` Gleb Natapov [this message]
2009-10-19 23:34       ` Avi Kivity
2009-10-20  8:56         ` Jan Kiszka
2009-10-20  9:06           ` Avi Kivity
2009-10-20  9:08             ` Gleb Natapov
2009-10-20  9:14               ` Avi Kivity
2009-10-20 11:13                 ` Marcelo Tosatti
2009-10-20 12:44                   ` Gleb Natapov
2009-10-20  8:52     ` Jan Kiszka
2009-10-15 17:05 ` [PATCH v2 2/4] KVM: Add unified KVM_GET/SET_VCPU_STATE IOCTL Jan Kiszka

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=20091019203950.GC8278@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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