Skip to content

Commit

Permalink
X86: Add a check to catch Xen emulation of Hyper-V
Browse files Browse the repository at this point in the history
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 <kys@microsoft.com>
Link: http://lkml.kernel.org/r/1359940959-32168-2-git-send-email-kys@microsoft.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
K. Y. Srinivasan authored and H. Peter Anvin committed Feb 13, 2013
1 parent 32068f6 commit db34bbb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/x86/kernel/cpu/mshyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit db34bbb

Please sign in to comment.