mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 10:55:34 +00:00
target/arm: Update arm_mmu_idx for VHE
Return the indexes for the EL2&0 regime when the appropriate bits are set within HCR_EL2. Backports commit 6003d9800ee38aa11eefb5cd64ae55abb64bef16 from qemu
This commit is contained in:
parent
3d583cd45f
commit
6073542afc
|
@ -11190,12 +11190,16 @@ ARMMMUIdx arm_mmu_idx_el(CPUARMState *env, int el)
|
|||
return arm_v7m_mmu_idx_for_secstate(env, env->v7m.secure);
|
||||
}
|
||||
|
||||
/* See ARM pseudo-function ELIsInHost. */
|
||||
switch (el) {
|
||||
case 0:
|
||||
/* TODO: ARMv8.1-VHE */
|
||||
if (arm_is_secure_below_el3(env)) {
|
||||
return ARMMMUIdx_SE10_0;
|
||||
}
|
||||
if ((env->cp15.hcr_el2 & (HCR_E2H | HCR_TGE)) == (HCR_E2H | HCR_TGE)
|
||||
&& arm_el_is_aa64(env, 2)) {
|
||||
return ARMMMUIdx_E20_0;
|
||||
}
|
||||
return ARMMMUIdx_E10_0;
|
||||
case 1:
|
||||
if (arm_is_secure_below_el3(env)) {
|
||||
|
@ -11203,8 +11207,11 @@ ARMMMUIdx arm_mmu_idx_el(CPUARMState *env, int el)
|
|||
}
|
||||
return ARMMMUIdx_E10_1;
|
||||
case 2:
|
||||
/* TODO: ARMv8.1-VHE */
|
||||
/* TODO: ARMv8.4-SecEL2 */
|
||||
/* Note that TGE does not apply at EL2. */
|
||||
if ((env->cp15.hcr_el2 & HCR_E2H) && arm_el_is_aa64(env, 2)) {
|
||||
return ARMMMUIdx_E20_2;
|
||||
}
|
||||
return ARMMMUIdx_E2;
|
||||
case 3:
|
||||
return ARMMMUIdx_SE3;
|
||||
|
|
Loading…
Reference in a new issue