mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 06:49:25 +00:00
hv: mmu: add 1GB page capability check when CPU boot
Add 1GB large page support limit on our platform. Tracked-On: #1124 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -227,6 +227,11 @@ static int hardware_detect_support(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!cpu_has_cap(X86_FEATURE_PAGE1GB)) {
|
||||
pr_fatal("%s, not support 1GB page\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!cpu_has_cap(X86_FEATURE_VMX)) {
|
||||
pr_fatal("%s, vmx not supported\n", __func__);
|
||||
return -ENODEV;
|
||||
|
@@ -131,6 +131,11 @@ int check_vmx_mmu_cap(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!cpu_has_vmx_ept_cap(VMX_EPT_1GB_PAGE)) {
|
||||
pr_fatal("%s, ept not support 1GB large page\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -187,18 +192,6 @@ void invept(struct vcpu *vcpu)
|
||||
}
|
||||
}
|
||||
|
||||
bool check_mmu_1gb_support(enum _page_table_type page_table_type)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
if (page_table_type == PTT_EPT) {
|
||||
status = cpu_has_vmx_ept_cap(VMX_EPT_1GB_PAGE);
|
||||
} else {
|
||||
status = cpu_has_cap(X86_FEATURE_PAGE1GB);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
uint64_t get_paging_pml4(void)
|
||||
{
|
||||
/* Return address to caller */
|
||||
|
Reference in New Issue
Block a user