linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: KY Srinivasan <kys@microsoft.com>
To: KY Srinivasan <kys@microsoft.com>, Jan Beulich <JBeulich@suse.com>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: RE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
Date: Thu, 31 Jan 2013 15:53:57 +0000	[thread overview]
Message-ID: <fe91cec766464b4fbfeea56d7e5de0a0@SN2PR03MB061.namprd03.prod.outlook.com> (raw)
In-Reply-To: <32e50a43db8849f2944db256989bebb8@SN2PR03MB061.namprd03.prod.outlook.com>



> -----Original Message-----
> From: devel [mailto:devel-bounces@linuxdriverproject.org] On Behalf Of KY
> Srinivasan
> Sent: Thursday, January 31, 2013 9:46 AM
> To: Jan Beulich
> Cc: olaf@aepfle.de; gregkh@linuxfoundation.org; jasowang@redhat.com;
> x86@kernel.org; linux-kernel@vger.kernel.org; bp@alien8.de; hpa@zytor.com;
> apw@canonical.com; devel@linuxdriverproject.org; tglx@linutronix.de
> Subject: RE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
> 
> 
> 
> > -----Original Message-----
> > From: Jan Beulich [mailto:JBeulich@suse.com]
> > Sent: Thursday, January 31, 2013 2:38 AM
> > To: KY Srinivasan
> > Cc: olaf@aepfle.de; bp@alien8.de; apw@canonical.com; x86@kernel.org;
> > tglx@linutronix.de; devel@linuxdriverproject.org;
> gregkh@linuxfoundation.org;
> > jasowang@redhat.com; linux-kernel@vger.kernel.org; hpa@zytor.com
> > Subject: RE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
> >
> > >>> On 30.01.13 at 19:12, KY Srinivasan <kys@microsoft.com> wrote:
> > > Presumably, Hyper-V emulation is only to run enlightened Windows. The
> issue
> > > with
> > > Xen is not that it emulates Hyper-V, but this emulation is turned on while
> > > running Linux.
> > > That is the reason I chose to check for Xen. Would you prefer a DMI check
> > > for the Hyper-V
> > > platform.
> >
> > I consider DMI checks to be too fragile here - in particular with
> > the eventual passing through of host DMI attributes to guests,
> > this sets you up for mistakes. Instead, I would envision you
> > scanning the whole CPUID range "reserved" for virtualization
> > (starting at 0x40000000) and see whether you get back
> > anything other than the Hyper-V identification (much like the
> > way xen_cpuid_base() scans for the Xen range). Of course
> > that's under the premise that you're right in assuming Hyper-V
> > would never emulate any other hypervisor's interface.
> 
> Agreed; I will make the appropriate changes as you have recommended.

Jan,

Are there any published standards in terms of how the CPUID space should be populated in the range from 0x40000000 to 0x40010000. Specifically, unless the standard mandates that all ranges unused by a given hypervisor would return a known value, how can this code be used to detect the presence of an unknown hypervisor. Hyper-V is going to return the Hyper-V string at 0x40000000. So, I was planning to scan starting at 0x40000100. Clearly, I can check for a specific hypervisor that I know causes a problem for Hyper-V (as I have currently done by checking for Xen). How can I check for the presence of yet to be created Hypervisors that may emulate Hyper-V by scanning the CPUID space. I am almost tempted to say that Xen is the special case and the patch I have submitted addresses that. If a new (or existing hypervisor) plans to do what Xen is doing, perhaps we can dissuade them from doing that or we can fix that within the general framework we have here.

Regards,

K. Y
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
> 



  reply	other threads:[~2013-01-31 15:55 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  0:51 [PATCH 0/3] X86: Deliver Hyper-V interrupts on a seperate IDT vector K. Y. Srinivasan
2013-01-30  0:51 ` [PATCH 1/3] x86: Hyper-V: register clocksource only if its advertised K. Y. Srinivasan
2013-01-30  0:51   ` [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V K. Y. Srinivasan
2013-01-30  8:53     ` Jan Beulich
2013-01-30 18:12       ` KY Srinivasan
2013-01-30 18:19         ` H. Peter Anvin
2013-01-31  7:37         ` Jan Beulich
2013-01-31 14:46           ` KY Srinivasan
2013-01-31 15:53             ` KY Srinivasan [this message]
2013-01-31 16:45               ` Jan Beulich
2013-01-31 18:29                 ` H. Peter Anvin
2013-01-31 21:41       ` H. Peter Anvin
2013-02-01 13:19         ` Stefano Stabellini
2013-02-01 15:10           ` KY Srinivasan
2013-02-01 19:34             ` KY Srinivasan
2013-01-30  0:51   ` [PATCH 3/3] X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts K. Y. Srinivasan
2013-01-30  8:58     ` Jan Beulich
2013-01-31 14:55       ` KY Srinivasan
2013-02-04  1:21 [PATCH 0/3] X86: Deliver Hyper-V interrupts on a seperate IDT vector K. Y. Srinivasan
2013-02-04  1:22 ` [PATCH 1/3] x86: Hyper-V: register clocksource only if its advertised K. Y. Srinivasan
2013-02-04  1:22   ` [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V K. Y. Srinivasan
2013-04-17  7:06     ` Michael S. Tsirkin
2013-04-17 13:20       ` KY Srinivasan
2013-04-17 12:48         ` Michael S. Tsirkin
2013-04-17 14:12           ` KY Srinivasan
2013-04-17 13:25             ` Michael S. Tsirkin
2013-04-17 14:34               ` KY Srinivasan
2013-04-17 13:48                 ` Michael S. Tsirkin
2013-04-17 15:31                   ` KY Srinivasan
2013-04-17 15:50                     ` Jan Beulich
2013-04-17 16:28                       ` KY Srinivasan
2013-04-18  7:48                         ` Michael S. Tsirkin
2013-04-18 13:23                           ` KY Srinivasan
2013-04-18 13:30                             ` KY Srinivasan
2013-04-17 13:52         ` Jan Beulich
2013-04-17 13:01           ` Michael S. Tsirkin
2013-04-17 13:11             ` Michael S. Tsirkin
2013-04-17 14:09             ` Jan Beulich
2013-04-17 15:17               ` 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=fe91cec766464b4fbfeea56d7e5de0a0@SN2PR03MB061.namprd03.prod.outlook.com \
    --to=kys@microsoft.com \
    --cc=JBeulich@suse.com \
    --cc=apw@canonical.com \
    --cc=bp@alien8.de \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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).