Skip to contentSkip to conversation

KVM: Fix lockup on 32-bit intel hosts with nx disabled in the bios

PATCH In review Avi Kivity 3 participants 4 messages Jan 31, 2007 – Feb 1, 2007 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 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).

drivers/kvm/vmx.c +2 -0
Index: linux-2.6/drivers/kvm/vmx.c
===================================================================
@@ -1128,6 +1128,8 @@ static int vmx_vcpu_setup(struct kvm_vcp
 
 		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;
author
#1 lore raw
Quoted 6 lines · Avi Kivity

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).

Andrew, I believe this is 2.6.20 material.

Quoted 16 lines

Index: linux-2.6/drivers/kvm/vmx.c
===================================================================

drivers/kvm/vmx.c +2 -0
@@ -1128,6 +1128,8 @@ static int vmx_vcpu_setup(struct kvm_vcp
 
 		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;
Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#2 lore raw
In reply to Avi Kivity
Quoted 4 lines · Avi Kivity

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).

Avi, thank you for the patch. I can confirm that this patch works on my IBM X60s notebook. Without it, the whole PC locks up upon starting qemu.

Thanks,
Jeff.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Acked-by on v1 1/1
#3 lore raw
In reply to Avi Kivity
Quoted 6 lines · Avi Kivity

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).

i think this is for v2.6.20. I have tested this ontop of -rc7.

Ingo

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642