aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-12-02 13:18:46 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-12-14 09:50:57 -0800
commit9ec0e2f614c0b29e87ff0b451aa1201498309bd7 (patch)
treeb918b220502a77a826303d774a0f54abe4c9b9a3
parente86704982a2c88a3bb2d4571de928928d5f9e574 (diff)
KVM: VMX: Force vm86 mode if setting flags during real mode
patch 78f7826868da8e27d097802139a3fec39f47f3b8 in mainline. When resetting from userspace, we need to handle the flags being cleared even after we are in real mode. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/kvm/vmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 80628f69916..c158a2d33ae 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -463,6 +463,8 @@ static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu)
static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)
{
+ if (vcpu->rmode.active)
+ rflags |= IOPL_MASK | X86_EFLAGS_VM;
vmcs_writel(GUEST_RFLAGS, rflags);
}