[PATCH] KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric
[powerpc.git] / drivers / kvm / vmx.c
index ad97014..fc01c4b 100644 (file)
@@ -884,6 +884,8 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu,
                ar |= (var->db & 1) << 14;
                ar |= (var->g & 1) << 15;
        }
+       if (ar == 0) /* a 0 value means unusable */
+               ar = AR_UNUSABLE_MASK;
        vmcs_write32(sf->ar_bytes, ar);
 }