KVM: VMX: don't clobber segment AR of unusable segments.
authorGleb Natapov <gleb@redhat.com>
Mon, 21 Jan 2013 13:36:46 +0000 (15:36 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 24 Jan 2013 02:40:28 +0000 (00:40 -0200)
Usability is returned in unusable field, so not need to clobber entire
AR. Callers have to know how to deal with unusable segments already
since if emulate_invalid_guest_state=true AR is not zeroed.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c

index 319e840e2ada90ae6b9d4ac86596c919bd37391f..77212d1e1df96d2edb34039bf0849e1b120e4dc5 100644 (file)
@@ -3196,8 +3196,6 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
        var->limit = vmx_read_guest_seg_limit(vmx, seg);
        var->selector = vmx_read_guest_seg_selector(vmx, seg);
        ar = vmx_read_guest_seg_ar(vmx, seg);
-       if ((ar & AR_UNUSABLE_MASK) && !emulate_invalid_guest_state)
-               ar = 0;
        var->type = ar & 15;
        var->s = (ar >> 4) & 1;
        var->dpl = (ar >> 5) & 3;