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-Url: https://git.stricted.de/?a=commitdiff_plain;h=432bd6cbf9f016f5480153b1cdfbd046f8d4fb1e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 27f2751c3baa..54c35c0b3181 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;