kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, <kvm@vger.kernel.org>
Subject: Re: [PATCH 2/2] KVM: SVM: Notify if SVM is already in use
Date: Fri, 2 Dec 2011 09:53:16 +0100	[thread overview]
Message-ID: <20111202085316.GI13268@amd.com> (raw)
In-Reply-To: <1322764218-4698-2-git-send-email-levinsasha928@gmail.com>

On Thu, Dec 01, 2011 at 08:30:18PM +0200, Sasha Levin wrote:
> 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.
> 
> Cc: Joerg Roedel <joerg.roedel@amd.com>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Cc: kvm@vger.kernel.org
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> ---
>  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(KERN_ERR "svm_hardware_enable: SVM already in use on CPU%d. "
> +				"Are you already another hypervisor?\n", me);

Hmm, this can nicely flood dmesg on a machine with many cores :) How
about removing the CPU%d part of the message and using printk_once?


	Joerg

-- 
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632

  reply	other threads:[~2011-12-02  8:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 18:30 [PATCH 1/2] KVM: VMX: Notify if VMX is already in use Sasha Levin
2011-12-01 18:30 ` [PATCH 2/2] KVM: SVM: Notify if SVM " Sasha Levin
2011-12-02  8:53   ` Joerg Roedel [this message]
2011-12-07 14:17 ` [PATCH 1/2] KVM: VMX: Notify if VMX " Avi Kivity
2011-12-07 14:18   ` Sasha Levin
2011-12-07 14:23     ` Avi Kivity
2011-12-07 14:24       ` Sasha Levin
2011-12-07 14:26         ` Avi Kivity
2011-12-07 14:42           ` Sasha Levin
2011-12-07 15:15           ` Sasha Levin
2011-12-07 15:31             ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111202085316.GI13268@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).