From 481e9fba9d53f21a44923b8303e8859859c77c87 Mon Sep 17 00:00:00 2001 From: Fei Li Date: Thu, 29 Jul 2021 10:30:51 +0800 Subject: [PATCH] hv: remove the constraint "MMU and EPT must both support large page or not" There're some virtual platform which doesn't meet this constraint. So remove this constraint. Tracked-On: #6329 Signed-off-by: Fei Li --- hypervisor/arch/x86/cpu_caps.c | 5 ----- hypervisor/arch/x86/mmu.c | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hypervisor/arch/x86/cpu_caps.c b/hypervisor/arch/x86/cpu_caps.c index 8db71853d..61f057290 100644 --- a/hypervisor/arch/x86/cpu_caps.c +++ b/hypervisor/arch/x86/cpu_caps.c @@ -430,11 +430,6 @@ static int32_t check_vmx_mmu_cap(void) } else if (!pcpu_has_vmx_ept_vpid_cap(VMX_EPT_2MB_PAGE)) { printf("%s, ept not support 2MB large page\n", __func__); ret = -ENODEV; - } else if (pcpu_has_vmx_ept_vpid_cap(VMX_EPT_1GB_PAGE) != - pcpu_has_cap(X86_FEATURE_PAGE1GB)) { - /* This just for simple large_page_support in arch/x86/page.c */ - ret = -ENODEV; - printf("%s ept support 1GB large page while mmu is not or opposite\n", __func__); } else { /* No other state currently, do nothing */ } diff --git a/hypervisor/arch/x86/mmu.c b/hypervisor/arch/x86/mmu.c index ef35c4eb7..15b506e95 100644 --- a/hypervisor/arch/x86/mmu.c +++ b/hypervisor/arch/x86/mmu.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -72,7 +73,7 @@ static inline bool ppt_large_page_support(enum _page_table_level level, __unused if (level == IA32E_PD) { support = true; } else if (level == IA32E_PDPT) { - support = pcpu_has_vmx_ept_vpid_cap(VMX_EPT_1GB_PAGE); + support = pcpu_has_cap(X86_FEATURE_PAGE1GB); } else { support = false; }