linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Jet Chen <jet.chen@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Borislav Petkov <bp@alien8.de>
Cc: "Romer, Benjamin M" <Benjamin.Romer@unisys.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP
Date: Thu, 10 Apr 2014 07:01:14 +0800	[thread overview]
Message-ID: <20140409230114.GB8370@localhost> (raw)
In-Reply-To: <53458A3A.1050608@intel.com>

CC the KVM people: it looks like a KVM problem that can be triggered by

        qemu-system-x86_64 -cpu Haswell,+smep,+smap

On Thu, Apr 10, 2014 at 01:58:18AM +0800, Jet Chen wrote:
> On 04/09/2014 10:44 PM, Romer, Benjamin M wrote:
> > On Wed, 2014-04-09 at 02:38 +0800, Jet Chen wrote:
> > 
> >> Hi Ben,
> >>
> >> I checked my <Intel 64 and IA-32 Architectures Software Developer's Manual> which published in Feb 2014.
> >> Volume 2: Instruction Set Reference, A-Z: CPUID--CPU Identification
> >>
> > 
> > I agree completely, which is why I'm confused about KVM's behavior. If
> > bit 31 was off, the code in our drivers that uses the vmcall instruction
> > would not have been run, the kernel would not have tried to perform a
> > vmcall, and not crashed with invalid op.
> > 
> > If you look in the definition for the VMCALL instruction (Intel 64 and
> > IA32 Architectures Software Developer's Manual, volume 3C pg.30-9)
> > You'll see that a processor in VMX non-root operation should perform a
> > vmexit.
> > 
> >> Why this document not match what you said ? I am not experienced with VM, please correct me if I went for wrong document
> >>
> > 
> > According to VMWare's documentation (there is a page at
> > http://kb.vmware.com./selfservice/microsites/search.do?cmd=displayKC&externalId=1009458 ) , as well as Microsoft's hypervisor spec (at http://www.microsoft.com/en-us/download/details.aspx?id=39289 ), this bit is used to indicate the CPU is running under virtualization. KVM is also setting this bit to indicate virtualization. I believe Xen uses it as well.
> > 
> > 
> > My contention is, if KVM is going to set the ISVM bit, it needs to do a
> > vmexit, and if it's not going to set the bit, then doing an invalid op
> > is okay, but the current behavior is inconsistent.
> > 
> > -- Ben
> > 
> 
> Ben,
> 
> Really thanks for your explanation.
> Let me summary it up, please correct me where i am wrong. If it is really a KVM bug, we report it to KVM guys.
> On a real CPU, ECX 31bit always be 0 as Intel documentation filed.
> However, KVM, as a hypervisor, should emulate this bit of the virtual ECX register to 1 for guest OS to indicate it is running in a virtualization environment.
> Problem is, KVM does set this bit to 1, but does an invalid op instead of emit a VMCALL. As a result, we get this dmesg error messages.
> 
> Thanks,
> -Jet

  parent reply	other threads:[~2014-04-09 23:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 11:17 [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP Fengguang Wu
2014-04-07 14:04 ` Ken Cox
2014-04-07 14:09 ` Greg Kroah-Hartman
2014-04-07 14:24   ` Ken Cox
2014-04-07 19:23     ` Greg Kroah-Hartman
2014-04-07 19:46       ` Greg Kroah-Hartman
     [not found] ` <C97001BC43954D438ACB059713BA5CDF92040F0F00@USEA-EXCH7.na.uis.unisys.com>
2014-04-08  2:53   ` Fengguang Wu
2014-04-08 15:39     ` Romer, Benjamin M
     [not found]   ` <53444220.50009@intel.com>
     [not found]     ` <C97001BC43954D438ACB059713BA5CDF92040F0F06@USEA-EXCH7.na.uis.unisys.com>
     [not found]       ` <53458A3A.1050608@intel.com>
2014-04-09 23:01         ` Fengguang Wu [this message]
2014-04-09 23:10           ` H. Peter Anvin
2014-04-10 13:19             ` Romer, Benjamin M
2014-04-11  2:28               ` H. Peter Anvin
2014-04-11 13:51                 ` Romer, Benjamin M
2014-04-11 16:33                   ` H. Peter Anvin
2014-04-11 17:35                     ` Jet Chen
2014-04-11 17:40                       ` H. Peter Anvin
2014-04-11 17:51                         ` Romer, Benjamin M
2014-04-30 10:02                         ` Paolo Bonzini
2014-04-11 17:49                       ` Romer, Benjamin M
2014-04-13 11:51                       ` Borislav Petkov
2014-04-13 12:20                         ` Jet Chen
2014-04-09 23:10           ` H. Peter Anvin

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=20140409230114.GB8370@localhost \
    --to=fengguang.wu@intel.com \
    --cc=Benjamin.Romer@unisys.com \
    --cc=bp@alien8.de \
    --cc=hpa@linux.intel.com \
    --cc=jet.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@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).