aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-12-12 12:10:50 -0500
committerGleb Natapov <gleb@redhat.com>2012-12-23 07:00:47 -0500
commit0647f4aa8c58a7e5adb873b485c83e0c93d9c6d1 (patch)
tree0a9689713119e36d5f99665fb70918baca405103 /arch/x86/kvm/vmx.c
parent07f42f5f25dc214a33214159fc8b62b984b713eb (diff)
KVM: VMX: relax check for CS register in rmode_segment_valid()
rmode_segment_valid() checks if segment descriptor can be used to enter vm86 mode. VMX spec mandates that in vm86 mode CS register will be of type data, not code. Lets allow guest entry with vm86 mode if the only problem with CS register is incorrect type. Otherwise entire real mode will be emulated. Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 265fdd37b240..7c2c05406b60 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3383,6 +3383,8 @@ static bool rmode_segment_valid(struct kvm_vcpu *vcpu, int seg)
3383 var.dpl = 0x3; 3383 var.dpl = 0x3;
3384 var.g = 0; 3384 var.g = 0;
3385 var.db = 0; 3385 var.db = 0;
3386 if (seg == VCPU_SREG_CS)
3387 var.type = 0x3;
3386 ar = vmx_segment_access_rights(&var); 3388 ar = vmx_segment_access_rights(&var);
3387 3389
3388 if (var.base != (var.selector << 4)) 3390 if (var.base != (var.selector << 4))