kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] KVM: VMX: Notify if VMX is already in use
@ 2011-12-07 14:34 Sasha Levin
  2011-12-07 14:34 ` [PATCH v2 2/2] KVM: SVM: Notify if SVM " Sasha Levin
  2011-12-07 15:13 ` [PATCH v2 1/2] KVM: VMX: Notify if VMX " Andreas Färber
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2011-12-07 14:34 UTC (permalink / raw)
  To: joerg.roedel, avi, mtosatti, kvm; +Cc: Sasha Levin

Currently we silently fail if VMX is already in use by a different
virtualization technology.

This is bad since it's non-obvious for the user, and its not too uncommon
for users to have several of these installed on same host.

This patch adds a message to notify the user of the problem.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 arch/x86/kvm/vmx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 4ceced2..0ef59ed 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2300,8 +2300,11 @@ static int hardware_enable(void *garbage)
 	u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
 	u64 old, test_bits;
 
-	if (read_cr4() & X86_CR4_VMXE)
+	if (read_cr4() & X86_CR4_VMXE) {
+		printk_once(KERN_ERR "hardware_enable: VMX already in use on CPU%d. "
+				"Are you already another hypervisor?\n", cpu);
 		return -EBUSY;
+	}
 
 	INIT_LIST_HEAD(&per_cpu(loaded_vmcss_on_cpu, cpu));
 	rdmsrl(MSR_IA32_FEATURE_CONTROL, old);
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-07 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-07 14:34 [PATCH v2 1/2] KVM: VMX: Notify if VMX is already in use Sasha Levin
2011-12-07 14:34 ` [PATCH v2 2/2] KVM: SVM: Notify if SVM " Sasha Levin
2011-12-07 15:13 ` [PATCH v2 1/2] KVM: VMX: Notify if VMX " Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).