mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv: mmu: add some API for guest page mode check
add is_long_mode to check whether the processor is operating in IA-32e mode add is_paging_enabled to check whether paging is enabled add is_pae to check whether physical address extension is enabled. Tracked-On: #1379 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -59,10 +59,10 @@ enum vm_paging_mode get_vcpu_paging_mode(struct vcpu *vcpu)
|
||||
return PAGING_MODE_0_LEVEL;
|
||||
}
|
||||
else if (cpu_mode == CPU_MODE_PROTECTED) {
|
||||
if ((vcpu_get_cr4(vcpu) & CR4_PAE) != 0U) {
|
||||
if (is_pae(vcpu)) {
|
||||
return PAGING_MODE_3_LEVEL;
|
||||
}
|
||||
else if ((vcpu_get_cr0(vcpu) & CR0_PG) != 0U) {
|
||||
else if (is_paging_enabled(vcpu)) {
|
||||
return PAGING_MODE_2_LEVEL;
|
||||
}
|
||||
return PAGING_MODE_0_LEVEL;
|
||||
|
||||
Reference in New Issue
Block a user