Commit db34bbb767bdfa1ebed7214b876fe01c5b7ee457
Committed by
H. Peter Anvin
1 parent
32068f6527
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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 <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>
Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff
arch/x86/kernel/cpu/mshyperv.c
... | ... | @@ -30,6 +30,13 @@ |
30 | 30 | if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) |
31 | 31 | return false; |
32 | 32 | |
33 | + /* | |
34 | + * Xen emulates Hyper-V to support enlightened Windows. | |
35 | + * Check to see first if we are on a Xen Hypervisor. | |
36 | + */ | |
37 | + if (xen_cpuid_base()) | |
38 | + return false; | |
39 | + | |
33 | 40 | cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS, |
34 | 41 | &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]); |
35 | 42 |