aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-08-12 08:29:37 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 03:46:43 -0400
commit345dcaa8fde7fa70252d58c862bf41fd2149ca2c (patch)
tree7e351dd56f459ab19eaf8f46b5fa94f81006c00f /arch
parent6621fbc2c6add9c9abfc87d7bc9b248ffd307ae3 (diff)
KVM: VMX: Adjust rflags if in real mode emulation
We set rflags.vm86 when virtualizing real mode to do through vm8086 mode; so we need to take it out again when reading rflags. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 31c3a8740c42..2b7e7bd190fd 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -781,7 +781,12 @@ static void vmx_fpu_deactivate(struct kvm_vcpu *vcpu)
781 781
782static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu) 782static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu)
783{ 783{
784 return vmcs_readl(GUEST_RFLAGS); 784 unsigned long rflags;
785
786 rflags = vmcs_readl(GUEST_RFLAGS);
787 if (to_vmx(vcpu)->rmode.vm86_active)
788 rflags &= ~(unsigned long)(X86_EFLAGS_IOPL | X86_EFLAGS_VM);
789 return rflags;
785} 790}
786 791
787static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags) 792static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)