diff --git a/hypervisor/arch/x86/mmu.c b/hypervisor/arch/x86/mmu.c index 5dc2c5d79..a9001df60 100644 --- a/hypervisor/arch/x86/mmu.c +++ b/hypervisor/arch/x86/mmu.c @@ -45,6 +45,7 @@ enum mem_map_request_type { }; struct mm_capability { + bool ept_x_only_supported; /* EPT and MMU 1-GByte page supported flag */ bool ept_1gb_page_supported; bool invept_supported; @@ -96,6 +97,8 @@ static void check_mmu_capability(void) /* Read the MSR register of EPT and VPID Capability - SDM A.10 */ val = msr_read(MSR_IA32_VMX_EPT_VPID_CAP); + mm_caps.ept_x_only_supported = (val & MSR_VMX_EPT_X_ONLY) + ? (true) : (false); mm_caps.ept_1gb_page_supported = (val & MSR_VMX_EPT_VPID_CAP_1GB) ? (true) : (false); mm_caps.invept_supported = @@ -123,6 +126,11 @@ static void check_mmu_capability(void) panic("invept must be supported"); } +static inline bool check_ept_x_only_support(void) +{ + return mm_caps.ept_x_only_supported; +} + static inline bool check_invept_single_support(void) { return mm_caps.invept_supported && diff --git a/hypervisor/include/arch/x86/msr.h b/hypervisor/include/arch/x86/msr.h index dd618fa87..e82e53baf 100644 --- a/hypervisor/include/arch/x86/msr.h +++ b/hypervisor/include/arch/x86/msr.h @@ -516,7 +516,8 @@ #define MSR_LNC_BIOS_CACHE_AS_RAM 0x000002E0 /* Configure CAR */ /* MSR_IA32_VMX_EPT_VPID_CAP: EPT and VPID capability bits */ -#define MSR_VMX_EPT_VPID_CAP_1GB (1UL << 17)/* EPT 1GB page */ +#define MSR_VMX_EPT_X_ONLY (1UL << 0)/* Execute Only */ +#define MSR_VMX_EPT_VPID_CAP_1GB (1UL << 17)/* EPT 1GB page */ #define MSR_VMX_INVEPT (1UL << 20)/* INVEPT */ #define MSR_VMX_INVEPT_SINGLE_CONTEXT (1UL << 25)/* INVEPT Single */ #define MSR_VMX_INVEPT_GLOBAL_CONTEXT (1UL << 26)/* INVEPT Global */