From e0eeb8a55832e388d43912ea42007e84d1c64f5b Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Tue, 14 Aug 2018 10:41:17 +0800 Subject: [PATCH] HV: Limit the CPUID with >= 0x15 leaf In order to add the emulation of CPUID 0x16, it is expected that it is handled when the CPUID 0x15 is supported. Otherwise we will have to emulate other CPUID leaf, which makes it complex. At the same time as Acrn HV has the requirements on the CPUs, it is restricted that the CPUID should support the leaf >=0x15. Signed-off-by: Zhao Yakui Acked-by: Eddie Dong --- hypervisor/arch/x86/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index 1f3f22551..8d62235dc 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -243,6 +243,11 @@ static int hardware_detect_support(void) return -ENODEV; } + if (boot_cpu_data.cpuid_level < 0x15U) { + pr_fatal("%s, required CPU feature not supported\n", __func__); + return -ENODEV; + } + ret = check_vmx_mmu_cap(); if (ret != 0) { return ret;