From: Avi Kivity Date: Sun, 4 Jan 2009 21:43:42 +0000 (+0200) Subject: KVM: VMX: don't clobber segment AR if emulating invalid state X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9fd4a3b7a412f983696b23121413a79d2132fed6;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index be9441056ff..a6598cbaa00 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;