Re: [PATCH 23/42] KVM: Activate Virtualization On Demand

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Serge Belyshev
Date: Monday, August 16, 2010 - 6:49 am

Alexander Graf <agraf@suse.de> writes:


I tested a bit different hack keeping rdmsrl but removing the if() and
it works fine for me:

Index: linux/arch/x86/kvm/svm.c
===================================================================
--- linux.orig/arch/x86/kvm/svm.c
+++ linux/arch/x86/kvm/svm.c
@@ -429,8 +429,7 @@ static int svm_hardware_enable(void *gar
 	int me = raw_smp_processor_id();
 
 	rdmsrl(MSR_EFER, efer);
-	if (efer & EFER_SVME)
-		return -EBUSY;
+	printk(KERN_DEBUG "svm_hardware_enable: efer %x on %d\n", efer, me);
 
 	if (!has_svm()) {
 		printk(KERN_ERR "svm_hardware_enable: err EOPNOTSUPP on %d\n",

Here is an example of its output:

[231441.358111] svm_hardware_enable: efer 1d01 on 0
[231441.358117] svm_hardware_enable: efer d01 on 3
[231441.358124] svm_hardware_enable: efer d01 on 2
[231441.358135] svm_hardware_enable: efer d01 on 1
[231675.168967] svm_hardware_enable: efer d01 on 0
[231675.168972] svm_hardware_enable: efer d01 on 1
[231675.168983] svm_hardware_enable: efer d01 on 2
[231675.168995] svm_hardware_enable: efer d01 on 3


After reboot, the first kvm run always reports efer = 1d01 on the first cpu.
In all subsequent runs before reboot efer stays d01 on all cpus.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 01/42] core, x86: Add user return notifiers, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 02/42] x86: Fix user return notifier build, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 07/42] KVM: Don't pass kvm_run arguments, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 15/42] KVM: Move IO APIC to its own lock, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 23/42] KVM: Activate Virtualization On Demand, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 24/42] KVM: remove duplicated #include, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 31/42] KVM: Fix printk name error in svm.c, Avi Kivity, (Mon Nov 16, 5:19 am)
[PATCH 32/42] KVM: Fix hotplug of CPUs, Avi Kivity, (Mon Nov 16, 5:19 am)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Alexander Graf, (Wed Mar 17, 3:02 pm)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Alexander Graf, (Wed Mar 17, 3:47 pm)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Michael Tokarev, (Wed Mar 17, 10:41 pm)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Alexander Graf, (Thu Mar 18, 12:17 am)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Serge Belyshev, (Sun Aug 8, 5:02 am)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Alexander Graf, (Mon Aug 16, 6:24 am)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Serge Belyshev, (Mon Aug 16, 6:49 am)
Re: [PATCH 23/42] KVM: Activate Virtualization On Demand, Alexander Graf, (Mon Aug 16, 7:13 am)