[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1db4d98aa3434d4eab7b36bbeb89cd47@SN2PR03MB061.namprd03.prod.outlook.com>
Date: Wed, 30 Jan 2013 18:12:17 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Jan Beulich <JBeulich@...e.com>
CC: "olaf@...fle.de" <olaf@...fle.de>, "bp@...en8.de" <bp@...en8.de>,
"apw@...onical.com" <apw@...onical.com>,
"x86@...nel.org" <x86@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"hpa@...or.com" <hpa@...or.com>
Subject: RE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@...e.com]
> Sent: Wednesday, January 30, 2013 3:53 AM
> To: KY Srinivasan
> Cc: olaf@...fle.de; bp@...en8.de; apw@...onical.com; x86@...nel.org;
> tglx@...utronix.de; devel@...uxdriverproject.org; gregkh@...uxfoundation.org;
> jasowang@...hat.com; linux-kernel@...r.kernel.org; hpa@...or.com
> Subject: Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
>
> >>> On 30.01.13 at 01:51, "K. Y. Srinivasan" <kys@...rosoft.com> wrote:
> > Xen emulates Hyper-V to host enlightened Windows. Looks like this
> > emulation may be turned on by default even for Linux guests. Check and
> > fail Hyper-V detection if we are on Xen.
> >
> > Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
> > ---
> > arch/x86/kernel/cpu/mshyperv.c | 7 +++++++
> > 1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c
> b/arch/x86/kernel/cpu/mshyperv.c
> > index 646d192..4dab317 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -30,6 +30,13 @@ static bool __init ms_hyperv_platform(void)
> > if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
> > return false;
> >
> > + /*
> > + * Xen emulates Hyper-V to support enlightened Windows.
> > + * Check to see first if we are on a Xen Hypervisor.
> > + */
> > + if (xen_cpuid_base())
> > + return false;
> > +
> > cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
> > &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
>
> I'm not convinced that's the right approach - any hypervisor
> could do similar emulation, and hence you either want to make
> sure you run on Hyper-V (by excluding all others), or you
> tolerate using the emulation (which may require syncing up with
> the other guest implementations so that shared resources don't
> get used by two parties).
>
> I also wonder whether using the Hyper-V emulation (where
> useful, there might not be anything right now, but this may
> change going forward) when no Xen support is configured
> wouldn't be better than not using anything...
Jan,
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.
Regards,
K. Y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists