All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Sasha Levin <levinsasha928@gmail.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Subject: RE: [PATCH 2/2] vmx,svm: Print errors if SVM or VMX were already set
Date: Tue, 5 Jul 2011 14:14:44 +0800	[thread overview]
Message-ID: <625BA99ED14B2D499DC4E29D8138F150627AE8A9D9@shsmsx502.ccr.corp.intel.com> (raw)
In-Reply-To: <1309820954-8629-2-git-send-email-levinsasha928@gmail.com>

> From: Sasha Levin
> Sent: Tuesday, July 05, 2011 7:09 AM
> 
> Instead of exiting quietly, print an error if the VMX or the SVM bits
> were already set when loading the module.
> 
> Having VMX/SVM bits set means that either there is someone else doing
> hardware virtualization, or that the BIOS is buggy and sets it on
> by default.
> 
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> ---
>  arch/x86/kvm/svm.c |    5 ++++-
>  arch/x86/kvm/vmx.c |    4 +++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 5ca76e3..2a1df2e 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -590,8 +590,11 @@ static int svm_hardware_enable(void *garbage)
>  	int me = raw_smp_processor_id();
> 
>  	rdmsrl(MSR_EFER, efer);
> -	if (check_inuse && (efer & EFER_SVME))
> +	if (check_inuse && (efer & EFER_SVME)) {
> +		printk(KERN_ERR "svm_hardware_enable: SVM already set
> on %d\n",
> +		       me);
>  		return -EBUSY;
> +	}
> 
>  	if (!has_svm()) {
>  		printk(KERN_ERR "svm_hardware_enable: err EOPNOTSUPP
> on %d\n",
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 3046b07..df69b1d 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -2233,8 +2233,10 @@ static int hardware_enable(void *garbage)
>  	u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
>  	u64 old, test_bits;
> 
> -	if (check_inuse && (read_cr4() & X86_CR4_VMXE))
> +	if (check_inuse && (read_cr4() & X86_CR4_VMXE)) {
> +		printk(KERN_ERR "hardware_enable: VMX already set\n");
>  		return -EBUSY;
> +	}
> 

make the error message consistent between vmx and svm, i.e. adding
cpu id for vmx too.

Thanks
Kevin

  parent reply	other threads:[~2011-07-05  6:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 23:09 [PATCH 1/2] vmx,svm: Add module parameter to ignore the 'in use' check Sasha Levin
2011-07-04 23:09 ` [PATCH 2/2] vmx,svm: Print errors if SVM or VMX were already set Sasha Levin
2011-07-05  0:42   ` Alexander Graf
2011-07-05  6:16     ` Tian, Kevin
2011-07-05  6:14   ` Tian, Kevin [this message]
2011-07-05  8:09 ` [PATCH 1/2] vmx,svm: Add module parameter to ignore the 'in use' check Avi Kivity
2011-07-05  8:14   ` Sasha Levin
2011-07-05  9:11     ` Joerg Roedel
2011-07-05  9:32       ` Sasha Levin
2011-07-05  9:37         ` Avi Kivity
2011-07-05  9:56           ` Sasha Levin
2011-07-05 10:37             ` Avi Kivity
2011-07-05 11:07               ` Sasha Levin
2011-07-05 11:14                 ` 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=625BA99ED14B2D499DC4E29D8138F150627AE8A9D9@shsmsx502.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.