[PATCH] KVM: fix lockup on 32-bit intel hosts with nx disabled in the bios
authorAvi Kivity <avi@qumranet.com>
Thu, 1 Feb 2007 07:48:13 +0000 (23:48 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 2 Feb 2007 00:22:41 +0000 (16:22 -0800)
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 <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/kvm/vmx.c

index 27f2751c3baa66e404631f37c5ddb7ed15ebc23f..54c35c0b31815670dd56cbc54b18826e1ea6f80d 100644 (file)
@@ -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;