linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
@ 2013-04-17 13:49 Victor Miasnikov
  0 siblings, 0 replies; 7+ messages in thread
From: Victor Miasnikov @ 2013-04-17 13:49 UTC (permalink / raw)
  To: devel, linux-kernel

Hi!

2013/4/17 Jan Beulich
>
> >>> On 17.04.13 at 12:16, "Michael S. Tsirkin"  wrote:
> > If the hypervisor says it's Hyper-V, that's because it wants
> > guests to use Hyper-V. I don't see why is guest second-guessing
> > this a good idea.
>
> There are two reasons here: For one, when the hypervisor is not
> Hyper-V, but is providing some Hyper-V emulation, that's intended
> for Windows guests to use, not e.g. Linux ones, especially when
> such guests could use the native hypervisor interface with much
> greater benefit.
>
> And second, there reportedly are features of (newer?) Hyper-V
> that some emulation may not provide, but that are also not easily
> detectable.
>


Yes

+



> On Wed, Apr 17, 2013 at 12:10:01PM +0300, Victor Miasnikov wrote:



>>
>> Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:
>> Or  "KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V emulates Hyper-V" as "Hyper-V emulates
>> Hyper-V" ?
>>
>
> No.  You are using Hyper-V, not the KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> emulation of it.
> No patches dealing with this emulation should have any effect on you.


 This is _positive_ variant of possible future,
but on _practic_ very often we need prevent _negative_ variant of possible future


>> ==
>> + /*
>> +  * KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V emulates Hyper-V to support
>> enlightened Windows.
>> +  * Check to see first if we are on a KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
>> Hypervisor.
>> +  */
>> +
>> + if (KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V_cpuid_base())
>> +  return false;

>
> If the hypervisor says it's Hyper-V, that's because it wants guests to use Hyper-V.
>


 Even if guest ( i.e. Virtual Computer) contain Linux OS ?


>> ==
>> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V emulates Hyper-V to host enlightened
>> Windows.
>>
>> . . .
>>
>> [ hpa: the problem here is that
>> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V doesn't emulate Hyper-V well enough,  .
>>  . ]
>
> What's emulated not well enough?
>

 In case of XEN variant non-full-emulation_of_Hyper-V , IMHO :

{{
----- Original Message ----- 
From: "Victor Miasnikov"
To: "Michael S. Tsirkin"
Sent: Wednesday, April 17, 2013 12:41 PM
Subject: IMHO, XEN emulation of Hyper-V not contain needed clocksource for Lunux guest Re: [PATCH 2/3] X86: Add a check
to catch Xen emulation of Hyper-V

Hi!

> It seems that one might want to use hyper-v emulation e.g. to test
> hyper-v code without using windows, so the functionality
> that this patch disables is not completely useless,
> so there should be a good reason for disabling it.

 As I undestand, XEN emulation of Hyper-V not contain  needed clocksource for Lunux guest ( virtual computers)

I.e. Linux VM "think" what is running on Hyper-V host call clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100)
and a-la BSOD or vice versa . . .


> I went over the original discussion in
> https://patchwork.kernel.org/patch/2064331/
> and that's still not clear to me. Is there a configuration
> that is broken without this patch but starts working with
> this patch?


 IMHO, this related to:

- clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
+ if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
+  clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);


 See

https://lkml.org/lkml/2013/2/12/623
==
            Date Tue, 12 Feb 2013 16:56:07 -0800
            From tip-bot for Olaf Hering
            Subject [tip:x86/hyperv] x86: Hyper-V: register clocksource only if its advertised

 . . .

==



Best regards, Victor Miasnikov
}}





Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
  2013-04-17 12:43               ` Michael S. Tsirkin
@ 2013-04-17 14:08                 ` Victor Miasnikov
  0 siblings, 0 replies; 7+ messages in thread
From: Victor Miasnikov @ 2013-04-17 14:08 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jan Beulich, olaf, bp, "Andy Whitcroft",
	x86, tglx, devel, Greg KH, K. Y. Srinivasan, jasowang,
	linux-kernel, H. Peter Anvin


Hi!

>> This is _positive_ variant of possible future,
>> but on _practic_ very often we need prevent _negative_ variant of possible
>> future
> 
> I don't really know what this means.
>

 On practic: this means, that need test with KVM "Hyper-V emulation" not only Windows guest, but _all_ Linux guest

_all_ Linux need read -- not only RHEL, but 
-- Debian 7.X ( kernell v3.2 with own hotfixes set) , 
-- Ubuntu 12.04 LTS ( kernell v3.2 with hotfixes)
-- Ubuntu 12.04.03 LTS ( kernell v3.5 with hotfixes)
-- Ubuntu 12.10 ( kernell v3.5 with hotfixes)
-- Linuxes with kernel v3.6 / or v3.7
-- Linuxes with latest stable kernel v3.8 ( for example Arch Linux)
-- other possible variants

Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


P.S.
  I'm personal not want, what KVM "Hyper-V emulation" initiative stopped implemented
If it work as need -- this is very good


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
       [not found]             ` <CAP2xkNqGgbYz1gdS85xjA8gwROGY89fAsiaRiGSE90xnzjJ4Xw@mail.gmail.com>
@ 2013-04-17 12:43               ` Michael S. Tsirkin
  2013-04-17 14:08                 ` Victor Miasnikov
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-04-17 12:43 UTC (permalink / raw)
  To: Victor M.
  Cc: Jan Beulich, olaf, bp, apw, x86, tglx, devel, gregkh,
	K. Y. Srinivasan, jasowang, linux-kernel, hpa

On Wed, Apr 17, 2013 at 04:03:08PM +0300, Victor M. wrote:
> Hi!
> 
> 2013/4/17 Jan Beulich
> 
>     >>> On 17.04.13 at 12:16, "Michael S. Tsirkin"  wrote:
>     > If the hypervisor says it's Hyper-V, that's because it wants
>     > guests to use Hyper-V. I don't see why is guest second-guessing
>     > this a good idea.
> 
>     There are two reasons here: For one, when the hypervisor is not
>     Hyper-V, but is providing some Hyper-V emulation, that's intended
>     for Windows guests to use, not e.g. Linux ones, especially when
>     such guests could use the native hypervisor interface with much
>     greater benefit.
> 
>     And second, there reportedly are features of (newer?) Hyper-V
>     that some emulation may not provide, but that are also not easily
>     detectable.
>    
> 
> 
> 
> Yes
>  
> +
>  
> 
> > On Wed, Apr 17, 2013 at 12:10:01PM +0300, Victor Miasnikov wrote:
> 
> 
> 
> >>
> >> Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:
> >> Or 
> "KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> emulates Hyper-V" as "Hyper-V emulates
> >> Hyper-V" ?
> >>
> >
> > No.  You are using Hyper-V, not the
> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> > emulation of it.
> > No patches dealing with this emulation should have any effect on you.
> 
> 
>  This is _positive_ variant of possible future,
> but on _practic_ very often we need prevent _negative_ variant of possible
> future

I don't really know what this means.

> 
> >> ==
> >> + /*
> >> +  *
> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> emulates Hyper-V to support
> >> enlightened Windows.
> >> +  * Check to see first if we are on a
> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> >> Hypervisor.
> >> +  */
> >> +
> >> + if
> (KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V_cpuid_base
> ())
> >> +  return false;
> 
> >
> > If the hypervisor says it's Hyper-V, that's because it wants guests to use
> Hyper-V.
> >
> 
> 
>  Even if guest ( i.e. Virtual Computer) contain Linux OS ?

Why not?  If you don't want the hypervisor to emulate hyper-v, just
don't tell it to emulate hyper-v.


> 
> >> ==
> >> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> emulates Hyper-V to host enlightened
> >> Windows.
> >>
> >> . . .
> >>
> >> [ hpa: the problem here is that
> >> KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
> doesn't emulate Hyper-V well enough,  .
> >>  . ]
> >
> > What's emulated not well enough?
> >
> 
>  In case of XEN variant non-full-emulation_of_Hyper-V , IMHO :
> 
> {{
> ----- Original Message -----
> From: "Victor Miasnikov"
> To: "Michael S. Tsirkin"
> Sent: Wednesday, April 17, 2013 12:41 PM
> Subject: IMHO, XEN emulation of Hyper-V not contain needed clocksource for
> Lunux guest Re: [PATCH 2/3] X86: Add a check
> to catch Xen emulation of Hyper-V
> 
> Hi!
> 
> > It seems that one might want to use hyper-v emulation e.g. to test
> > hyper-v code without using windows, so the functionality
> > that this patch disables is not completely useless,
> > so there should be a good reason for disabling it.
> 
>  As I undestand, XEN emulation of Hyper-V not contain  needed clocksource for
> Lunux guest ( virtual computers)
> 
> I.e. Linux VM "think" what is running on Hyper-V host call
> clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100)
> and a-la BSOD or vica verse . . .
> 
> 
> > I went over the original discussion in
> > https://patchwork.kernel.org/patch/2064331/
> > and that's still not clear to me. Is there a configuration
> > that is broken without this patch but starts working with
> > this patch?
> 
> 
>  IMHO, this related to:
> 
> - clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
> + if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
> +  clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
> 
> 
>  See
> 
> https://lkml.org/lkml/2013/2/12/623
> ==
>             Date Tue, 12 Feb 2013 16:56:07 -0800
>             From tip-bot for Olaf Hering
>             Subject [tip:x86/hyperv] x86: Hyper-V: register clocksource only if
> its advertised
> 
>  . . .
> 
> ==
> 
> 
> 
> Best regards, Victor Miasnikov
> }}
> 
> 
> 
> 
> 
> Best regards, Victor Miasnikov
> Blog:  http://vvm.blog.tut.by/

Looks like a counter-example to me.

Apparently a Linux guest bug was found and fixed exactly because we
trust the hypervisor.  If it wasn't, and if in the future hyper-v hosts
clear this feature bit, Linux will be broken.

-- 
MST

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ? Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
  2013-04-17 12:12           ` Jan Beulich
@ 2013-04-17 12:15             ` Michael S. Tsirkin
       [not found]             ` <CAP2xkNqGgbYz1gdS85xjA8gwROGY89fAsiaRiGSE90xnzjJ4Xw@mail.gmail.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-04-17 12:15 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Victor Miasnikov, olaf, bp, apw, x86, tglx, devel, gregkh,
	K. Y. Srinivasan, jasowang, linux-kernel, hpa

On Wed, Apr 17, 2013 at 01:12:37PM +0100, Jan Beulich wrote:
> >>> On 17.04.13 at 12:16, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > If the hypervisor says it's Hyper-V, that's because it wants
> > guests to use Hyper-V. I don't see why is guest second-guessing
> > this a good idea.
> 
> There are two reasons here: For one, when the hypervisor is not
> Hyper-V, but is providing some Hyper-V emulation, that's intended
> for Windows guests to use, not e.g. Linux ones,

Fact is that this patch changed the guest/hypervisor interface which
should not be done lightly. We don't know all uses that Linux is put
to.  I gave what seems, to me, like a perfectly valid reason to use
hyper-v emulation with Linux guests, which you snipped out :) Below is
a scanario that will now be broken:
	>>>It seems that one might want to use hyper-v emulation e.g. to test
	>>>hyper-v code without using windows, so the functionality
	>>>that this patch disables is not completely useless,
There could be others.

> such guests could use the native hypervisor interface with much
> greater benefit.

Why not disable the emulation in the hypervisor?  What overriding the
hypervisor will lead to, is hypervisors will try harder and mask their
real identity.  No one will win in this arms race.

> And second, there reportedly are features of (newer?) Hyper-V
> that some emulation may not provide, but that are also not easily
> detectable.
> 
> Jan

Could you be more explicit please?  What are these features?  How does a
windows guest able to use them if they are both new and not detectable?
Why not just fix the emulation?  How will Linux use the new features
when e.g. Xen adds them?

-- 
MST

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ? Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
  2013-04-17 10:16         ` Michael S. Tsirkin
@ 2013-04-17 12:12           ` Jan Beulich
  2013-04-17 12:15             ` Michael S. Tsirkin
       [not found]             ` <CAP2xkNqGgbYz1gdS85xjA8gwROGY89fAsiaRiGSE90xnzjJ4Xw@mail.gmail.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Beulich @ 2013-04-17 12:12 UTC (permalink / raw)
  To: Michael S. Tsirkin, Victor Miasnikov
  Cc: olaf, bp, apw, x86, tglx, devel, gregkh, K. Y. Srinivasan,
	jasowang, linux-kernel, hpa

>>> On 17.04.13 at 12:16, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> If the hypervisor says it's Hyper-V, that's because it wants
> guests to use Hyper-V. I don't see why is guest second-guessing
> this a good idea.

There are two reasons here: For one, when the hypervisor is not
Hyper-V, but is providing some Hyper-V emulation, that's intended
for Windows guests to use, not e.g. Linux ones, especially when
such guests could use the native hypervisor interface with much
greater benefit.

And second, there reportedly are features of (newer?) Hyper-V
that some emulation may not provide, but that are also not easily
detectable.

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ? Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
  2013-04-17  9:10       ` KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? " Victor Miasnikov
@ 2013-04-17 10:16         ` Michael S. Tsirkin
  2013-04-17 12:12           ` Jan Beulich
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-04-17 10:16 UTC (permalink / raw)
  To: Victor Miasnikov
  Cc: K. Y. Srinivasan, x86, gregkh, linux-kernel, devel, olaf, apw,
	jasowang, tglx, hpa, JBeulich, bp

On Wed, Apr 17, 2013 at 12:10:01PM +0300, Victor Miasnikov wrote:
> Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:
> 
> ==
> KVM 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 KVM.

> [ hpa: the problem here is that KVM doesn't emulate Hyper-V well
>  enough, and if the KVM support isn't compiled in, we end up stubling
>  over the Hyper-V emulation and try to activate it -- and it fails. ]
> 
> . . .

What's emulated not well enough?

> + /*
> +  * KVM emulates Hyper-V to support enlightened Windows.
> +  * Check to see first if we are on a KVM Hypervisor.
> +  */

If the hypervisor says it's Hyper-V, that's because it wants
guests to use Hyper-V. I don't see why is guest second-guessing
this a good idea.

> + if (KVM_cpuid_base())
> +  return false;
> +
> ==
> 
> 
> Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ?
> 
> 
> Best regards, Victor Miasnikov
> Blog:  http://vvm.blog.tut.by/
> 
> P.S.

No.  You are using Hyper-V, not the KVM emulation of it.  No patches
dealing with this emulation should have any effect on you.

-- 
MST

^ permalink raw reply	[flat|nested] 7+ messages in thread

* KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ? Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V
  2013-04-17  7:06     ` Michael S. Tsirkin
@ 2013-04-17  9:10       ` Victor Miasnikov
  2013-04-17 10:16         ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Victor Miasnikov @ 2013-04-17  9:10 UTC (permalink / raw)
  To: Michael S. Tsirkin, K. Y. Srinivasan
  Cc: x86, gregkh, linux-kernel, devel, olaf, apw, jasowang, tglx, hpa,
	JBeulich, bp

Hi!

Short:

>> >> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>> >>   Mixing KVM hypercalls and Hyper-V requires some tricks. It
VVM>> KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?
> It's not related.

 Are You shue?
Xen-team _think_ too what is not related, but has non-100% _full_ emulation of Hyper-V and, as result, create problems

 Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:

==
KVM emulates Hyper-V to host enlightened Windows.

 . . .

[ hpa: the problem here is that KVM doesn't emulate Hyper-V well
  enough,  .  . ]

 . . .

+  * KVM emulates Hyper-V to support enlightened Windows.
+  * Check to see first if we are on a KVM Hypervisor.
+ if (KVM_cpuid_base())
+  return false;
 . . .
==

Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ?



--
Full:

----- Original Message ----- 
From: "Michael S. Tsirkin"
To: "K. Y. Srinivasan"
Cc:
Sent: Wednesday, April 17, 2013 10:06 AM
Subject: Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V


> On Sun, Feb 03, 2013 at 05:22:38PM -0800, K. Y. Srinivasan 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 (at) microsoft.com
>
> I'm very curious what's the specific bug that is fixed here?
> I went over the original discussion in
> https://patchwork.kernel.org/patch/2064331/
> and that's still not clear to me. Is there a configuration
> that is broken without this patch but starts working with
> this patch?
>
> It seems that one might want to use hyper-v emulation e.g. to test
> hyper-v code without using windows, so the functionality
> that this patch disables is not completely useless,
> so there should be a good reason for disabling it.
>
> Could you enlighten me please? :)

 Short history of question:

{{
==
> > And hypercall has its own set of problems with Windows guests.
> > When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
> >   Mixing KVM hypercalls and Hyper-V requires some tricks. It
>
> Can't we simply register a hypercall ID range with Microsoft?
>
> > may also affect WHQLing Windows drivers since driver will talk to HW
> > bypassing Windows interfaces.
>
> Then the WHQL'ed driver doesn't support the PV MMIO hcall?
==

KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?
}}

{{
>> >> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>> >>   Mixing KVM hypercalls and Hyper-V requires some tricks. It
>> KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?
> It's not related.

 Are You shue?
Xen-team _think_ too what is not related, but has non-100% _full_ emulation of Hyper-V and, as result, create problems:

==
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.

[ hpa: the problem here is that Xen doesn't emulate Hyper-V well
  enough, and if the Xen support isn't compiled in, we end up stubling
  over the Hyper-V emulation and try to activate it -- and it fails. ]

 . . .

+ /*
+  * 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;
+
==
}}


 Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:

==
KVM 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 KVM.

[ hpa: the problem here is that KVM doesn't emulate Hyper-V well
  enough, and if the KVM support isn't compiled in, we end up stubling
  over the Hyper-V emulation and try to activate it -- and it fails. ]

 . . .

+ /*
+  * KVM emulates Hyper-V to support enlightened Windows.
+  * Check to see first if we are on a KVM Hypervisor.
+  */
+ if (KVM_cpuid_base())
+  return false;
+
==


Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ?


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.



----- Original Message ----- 
From: "Michael S. Tsirkin"
To: "Victor Miasnikov"
Sent: Wednesday, April 17, 2013 10:07 AM

I'm not sure what are we talking about then, but please
use the mailing list appropriate for the subject.


----- Original Message ----- 
From: "Victor Miasnikov" vvm (a) tut (dot) by
To: "Michael S. Tsirkin"
Cc: "KY Srinivasan"
Sent: Tuesday, April 16, 2013 9:36 AM
Subject: Are You shue what is 100% _full_ emulation of Hyper-V? Re: It's not related Re: KVM "Hyper-V emulation" -- this 
can be related "Linux on Hyper-V" ?

Hi!


>> >> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>> >>   Mixing KVM hypercalls and Hyper-V requires some tricks. It
>> KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?
> It's not related.

 Are You shue?
Xen-team _think_ too what is not related, but has non-100% _full_ emulation of Hyper-V and, as result, create problems:

==
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.

[ hpa: the problem here is that Xen doesn't emulate Hyper-V well
  enough, and if the Xen support isn't compiled in, we end up stubling
  over the Hyper-V emulation and try to activate it -- and it fails. ]

 . . .

+ /*
+  * 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;
+
==

 ( full see ib P.S.)

Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.


==
----- Original Message ----- 
From: "tip-bot for K. Y. Srinivasan"

 . . .

Sent: Wednesday, February 13, 2013 3:57 AM
Subject: [tip:x86/hyperv] X86: Add a check to catch Xen emulation of Hyper-V


Commit-ID:  db34bbb767bdfa1ebed7214b876fe01c5b7ee457
Gitweb:     http://git.kernel.org/tip/db34bbb767bdfa1ebed7214b876fe01c5b7ee457
Author:     K. Y. Srinivasan
AuthorDate: Sun, 3 Feb 2013 17:22:38 -0800
Committer:  H. Peter Anvin
CommitDate: Tue, 12 Feb 2013 16:27:03 -0800

X86: Add a check to catch Xen emulation of Hyper-V

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.

[ hpa: the problem here is that Xen doesn't emulate Hyper-V well
  enough, and if the Xen support isn't compiled in, we end up stubling
  over the Hyper-V emulation and try to activate it -- and it fails. ]

Signed-off-by: K. Y. Srinivasan
Link: http://lkml.kernel.org/r/1359940959-32168-2-git-send-email-kys@microsoft.com
Signed-off-by: H. Peter Anvin
---
 arch/x86/kernel/cpu/mshyperv.c | 7 +++++++
 1 file changed, 7 insertions(+)

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]);

--
==







----- Original Message ----- 
From: "Michael S. Tsirkin"
To: "Victor Miasnikov" vvm (a) tut (dot) by
Sent: Tuesday, April 16, 2013 1:11 AM
Subject: Re: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Fw: When KVM runs in Hyper-V emulation
mode it expects to get Hyper-V hypercalls.


> On Mon, Apr 15, 2013 at 04:00:34PM +0300, Victor Miasnikov wrote:
>>
>> ==
>> >> And hypercall has its own set of problems with Windows guests.
>> >> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>> >>   Mixing KVM hypercalls and Hyper-V requires some tricks. It
>> >
>> >Can't we simply register a hypercall ID range with Microsoft?
>> >
>> >> may also affect WHQLing Windows drivers since driver will talk to HW
>> >> bypassing Windows interfaces.
>> >
>> >Then the WHQL'ed driver doesn't support the PV MMIO hcall?
>> ==
>>
>> KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?
>>
>>
>
> It's not related.





----- Original Message ----- 
From: "Victor Miasnikov" vvm (a) tut (dot) by
To: "Michael S. Tsirkin"
Sent: Monday, April 15, 2013 4:00 PM
Subject: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Fw: When KVM runs in Hyper-V emulation mode
it expects to get Hyper-V hypercalls.


Hi!


==
> > And hypercall has its own set of problems with Windows guests.
> > When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
> >   Mixing KVM hypercalls and Hyper-V requires some tricks. It
>
> Can't we simply register a hypercall ID range with Microsoft?
>
> > may also affect WHQLing Windows drivers since driver will talk to HW
> > bypassing Windows interfaces.
>
> Then the WHQL'ed driver doesn't support the PV MMIO hcall?
==

KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/





^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-17 14:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-17 13:49 KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V Victor Miasnikov
  -- strict thread matches above, loose matches on Subject: below --
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  9:10       ` KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? " Victor Miasnikov
2013-04-17 10:16         ` Michael S. Tsirkin
2013-04-17 12:12           ` Jan Beulich
2013-04-17 12:15             ` Michael S. Tsirkin
     [not found]             ` <CAP2xkNqGgbYz1gdS85xjA8gwROGY89fAsiaRiGSE90xnzjJ4Xw@mail.gmail.com>
2013-04-17 12:43               ` Michael S. Tsirkin
2013-04-17 14:08                 ` Victor Miasnikov

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).