From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v2] KVM: nVMX: Reset RFLAGS on VM-exit Date: Mon, 4 Mar 2013 11:00:38 +0200 Message-ID: <20130304090038.GH23616@redhat.com> References: <5133A8BF.1010607@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm , "Nadav Har'El" , "Nakajima, Jun" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10807 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755493Ab3CDJAr (ORCPT ); Mon, 4 Mar 2013 04:00:47 -0500 Content-Disposition: inline In-Reply-To: <5133A8BF.1010607@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Mar 03, 2013 at 08:47:11PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > Ouch, how could this work so well that far? We need to clear RFLAGS to > the reset value as specified by the SDM. Particularly, IF must be off > after VM-exit! > > Signed-off-by: Jan Kiszka Reviewed-by: Gleb Natapov > --- > > Changes in v2: > - use symbolic constant for rflags reset value > > arch/x86/kvm/vmx.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 486078d..eece4c8 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -7454,6 +7454,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, > > kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->host_rsp); > kvm_register_write(vcpu, VCPU_REGS_RIP, vmcs12->host_rip); > + vmx_set_rflags(vcpu, X86_EFLAGS_BIT1); > /* > * Note that calling vmx_set_cr0 is important, even if cr0 hasn't > * actually changed, because it depends on the current state of > -- > 1.7.3.4 -- Gleb.