From: Uri Lublin Date: Wed, 13 Dec 2006 08:34:00 +0000 (-0800) Subject: [PATCH] KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric X-Git-Tag: v2.6.20-rc1~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7fbf1fdf0d79241f5cc95310b96f0c52452ab39;p=platform%2Fkernel%2Flinux-exynos.git [PATCH] KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric This makes the SET_SREGS ioctl behave symmetrically to the GET_SREGS ioctl wrt the segment access rights flag. Signed-off-by: Uri Lublin Signed-off-by: Avi Kivity Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index ad97014..fc01c4b 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -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); }