From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v2 4/4] KVM: x86: Add VCPU substate for NMI states Date: Tue, 20 Oct 2009 10:52:56 +0200 Message-ID: <4ADD7A68.1010804@siemens.com> References: <20091015170535.5076.91206.stgit@mchn012c.ww002.siemens.net> <20091015170536.5076.56790.stgit@mchn012c.ww002.siemens.net> <20091019203254.GD17781@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , "kvm@vger.kernel.org" To: Marcelo Tosatti Return-path: Received: from thoth.sbs.de ([192.35.17.2]:15008 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbZJTIxH (ORCPT ); Tue, 20 Oct 2009 04:53:07 -0400 In-Reply-To: <20091019203254.GD17781@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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 >> --- >> >> 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. > Something made me think it's not required. Don't ask me what, it was wrong anyway. Will roll out -v3 for this patch. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux