From: Avi Kivity Date: Thu, 1 Feb 2007 07:48:13 +0000 (-0800) Subject: [PATCH] KVM: fix lockup on 32-bit intel hosts with nx disabled in the bios X-Git-Tag: v2.6.20~24 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=432bd6cbf9f016f5480153b1cdfbd046f8d4fb1e;p=linux-2.6-omap-h63xx.git [PATCH] KVM: fix lockup on 32-bit intel hosts with nx disabled in the bios Intel hosts, without long mode, and with nx support disabled in the bios have an efer that is readable but not writable. This causes a lockup on switch to guest mode (even though it should exit with reason 34 according to the documentation). 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 27f2751c3ba..54c35c0b318 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) if (rdmsr_safe(index, &data_low, &data_high) < 0) continue; + if (wrmsr_safe(index, data_low, data_high) < 0) + continue; data = data_low | ((u64)data_high << 32); vcpu->host_msrs[j].index = index; vcpu->host_msrs[j].reserved = 0;