]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: VMX: don't clobber segment AR if emulating invalid state
authorAvi Kivity <avi@redhat.com>
Sun, 4 Jan 2009 21:43:42 +0000 (23:43 +0200)
committerAvi Kivity <avi@redhat.com>
Tue, 24 Mar 2009 09:03:00 +0000 (11:03 +0200)
The ususable bit is important for determining state validity; don't
clobber it.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c

index be9441056ff208389a538a0e96c54f7ea7c19585..a6598cbaa001cccc64cecf2c0021a11ffd1e5f75 100644 (file)
@@ -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;