From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] KVM: nVMX: Reset RFLAGS on VM-exit Date: Sun, 03 Mar 2013 13:06:52 +0100 Message-ID: <51333CDC.4040609@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm , Nadav Har'El , "Nakajima, Jun" To: Gleb Natapov , Marcelo Tosatti Return-path: Received: from mout.web.de ([212.227.17.12]:52613 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753109Ab3CCMG4 (ORCPT ); Sun, 3 Mar 2013 07:06:56 -0500 Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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..252f9c4 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, 0x02); /* * 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