mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 13:08:42 +00:00
mmu: add ept execution only capability check
check IA32_VMX_EPT_VPID_CAP MSR to see if ept execution only capability is supported or not Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Tian, Kevin <kevin.tian@intel.com>
This commit is contained in:
parent
b7d57a946b
commit
60425f91b4
@ -45,6 +45,7 @@ enum mem_map_request_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct mm_capability {
|
struct mm_capability {
|
||||||
|
bool ept_x_only_supported;
|
||||||
/* EPT and MMU 1-GByte page supported flag */
|
/* EPT and MMU 1-GByte page supported flag */
|
||||||
bool ept_1gb_page_supported;
|
bool ept_1gb_page_supported;
|
||||||
bool invept_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 */
|
/* Read the MSR register of EPT and VPID Capability - SDM A.10 */
|
||||||
val = msr_read(MSR_IA32_VMX_EPT_VPID_CAP);
|
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)
|
mm_caps.ept_1gb_page_supported = (val & MSR_VMX_EPT_VPID_CAP_1GB)
|
||||||
? (true) : (false);
|
? (true) : (false);
|
||||||
mm_caps.invept_supported =
|
mm_caps.invept_supported =
|
||||||
@ -123,6 +126,11 @@ static void check_mmu_capability(void)
|
|||||||
panic("invept must be supported");
|
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)
|
static inline bool check_invept_single_support(void)
|
||||||
{
|
{
|
||||||
return mm_caps.invept_supported &&
|
return mm_caps.invept_supported &&
|
||||||
|
@ -516,7 +516,8 @@
|
|||||||
#define MSR_LNC_BIOS_CACHE_AS_RAM 0x000002E0 /* Configure CAR */
|
#define MSR_LNC_BIOS_CACHE_AS_RAM 0x000002E0 /* Configure CAR */
|
||||||
|
|
||||||
/* MSR_IA32_VMX_EPT_VPID_CAP: EPT and VPID capability bits */
|
/* 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 (1UL << 20)/* INVEPT */
|
||||||
#define MSR_VMX_INVEPT_SINGLE_CONTEXT (1UL << 25)/* INVEPT Single */
|
#define MSR_VMX_INVEPT_SINGLE_CONTEXT (1UL << 25)/* INVEPT Single */
|
||||||
#define MSR_VMX_INVEPT_GLOBAL_CONTEXT (1UL << 26)/* INVEPT Global */
|
#define MSR_VMX_INVEPT_GLOBAL_CONTEXT (1UL << 26)/* INVEPT Global */
|
||||||
|
Loading…
Reference in New Issue
Block a user