From d3cffe0f8d8954bc7872164dce008af0e6ba5597 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Mon, 12 Oct 2015 12:01:11 +0200 Subject: [PATCH] Don't test hypervisor magic if HV base leaf is not supported --- platform/hw/arch/x86/hypervisor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/hw/arch/x86/hypervisor.c b/platform/hw/arch/x86/hypervisor.c index 1dcaa7a..00ccbf6 100644 --- a/platform/hw/arch/x86/hypervisor.c +++ b/platform/hw/arch/x86/hypervisor.c @@ -49,6 +49,8 @@ int hypervisor_detect(void) * Source: https://lkml.org/lkml/2008/10/1/246 */ x86_cpuid(0x40000000, &eax, &ebx, &ecx, &edx); + if (!(eax >= 0x40000000)) + return 0; /* Xen: "XenVMMXenVMM" */ if (ebx == 0x566e6558 && ecx == 0x65584d4d && edx == 0x4d4d566e) return HYPERVISOR_XEN; -- 2.39.5