lkml.org 
[lkml]   [2015]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] KVM: x86: fix eflags state following processor init/reset
Date
Reference SDM 3.4.3:

Following initialization of the processor (either by asserting the
RESET pin or the INIT pin), the state of the EFLAGS register is
00000002H.

However, the eflags fixed bit is not set and other bits are also not
cleared during the init/reset in kvm.

This patch fix it by set eflags register to 00000002H following
initialization of the processor.

Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
arch/x86/kvm/vmx.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index b680c2e..326f6ea 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4935,6 +4935,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
vmx_set_efer(vcpu, 0);
vmx_fpu_activate(vcpu);
update_exception_bitmap(vcpu);
+ vmx_set_rflags(vcpu, X86_EFLAGS_FIXED);

vpid_sync_context(vmx->vpid);
}
--
1.9.1


\
 
 \ /
  Last update: 2015-10-21 09:01    [W:0.058 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site