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:
Li, Fei1
2018-08-23 14:28:40 +08:00
committed by lijinxia
parent 58fffcd3b9
commit 06ab2b829f
4 changed files with 11 additions and 14 deletions

View File

@@ -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;

View File

@@ -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 */