diff options
-rw-r--r-- | arch/x86/kvm/vmx.c | 7 |
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 | ||
782 | static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu) | 782 | static 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 | ||
787 | static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags) | 792 | static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags) |