From: Sasha Levin Subject: [PATCH v2 2/2] KVM: SVM: Notify if SVM is already in use Date: Wed, 7 Dec 2011 16:34:09 +0200 Message-ID: <1323268449-9818-2-git-send-email-levinsasha928@gmail.com> References: <1323268449-9818-1-git-send-email-levinsasha928@gmail.com> Cc: Sasha Levin To: joerg.roedel@amd.com, avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:32838 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756156Ab1LGOen (ORCPT ); Wed, 7 Dec 2011 09:34:43 -0500 Received: by wgbdr13 with SMTP id dr13so1428503wgb.1 for ; Wed, 07 Dec 2011 06:34:42 -0800 (PST) In-Reply-To: <1323268449-9818-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Currently we silently fail if SVM 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 --- arch/x86/kvm/svm.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e32243e..8d1a066 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -587,8 +587,11 @@ static int svm_hardware_enable(void *garbage) int me = raw_smp_processor_id(); rdmsrl(MSR_EFER, efer); - if (efer & EFER_SVME) + if (efer & EFER_SVME) { + printk_once(KERN_ERR "svm_hardware_enable: SVM already in use on CPU%d. " + "Are you already another hypervisor?\n", me); return -EBUSY; + } if (!has_svm()) { printk(KERN_ERR "svm_hardware_enable: err EOPNOTSUPP on %d\n", -- 1.7.8