[PATCH 07/11] KVM: VMX: Force vm86 mode if setting flags during real mode

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Sunday, October 21, 2007 - 4:08 am

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>
---
 drivers/kvm/vmx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index f130c01..bb56ae3 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -523,6 +523,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);
 }
 
-- 
1.5.3

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/11] KVM updates for Linux 2.6.24-rc review, Avi Kivity, (Sun Oct 21, 4:08 am)
[PATCH 07/11] KVM: VMX: Force vm86 mode if setting flags d ..., Avi Kivity, (Sun Oct 21, 4:08 am)
Re: [PATCH 00/11] KVM updates for Linux 2.6.24-rc review, Laurent Vivier, (Sun Oct 21, 4:53 am)