summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-01-05 00:43:42 +0300
committerAvi Kivity <avi@redhat.com>2009-03-24 12:03:00 +0300
commit9fd4a3b7a412f983696b23121413a79d2132fed6 (patch)
tree79c1ce7536982efd64fe3d1b1368620b3bb4280c /arch/x86/kvm/vmx.c
parent1872a3f411ffe95c8e92300e0986a3532db55ce9 (diff)
downloadlinux-9fd4a3b7a412f983696b23121413a79d2132fed6.tar.xz
KVM: VMX: don't clobber segment AR if emulating invalid state
The ususable bit is important for determining state validity; don't clobber it. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index be9441056ff2..a6598cbaa001 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1649,7 +1649,7 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
var->limit = vmcs_read32(sf->limit);
var->selector = vmcs_read16(sf->selector);
ar = vmcs_read32(sf->ar_bytes);
- if (ar & AR_UNUSABLE_MASK)
+ if ((ar & AR_UNUSABLE_MASK) && !emulate_invalid_guest_state)
ar = 0;
var->type = ar & 15;
var->s = (ar >> 4) & 1;