mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 15:26:51 +00:00
target-arm: powerctl: Enable HVC when starting CPUs to EL2
When QEMU provides the equivalent of the EL3 firmware, we need to enable HVCs in scr_el3 when turning on CPUs that target EL2. Backports commit 86278c33d1d71196f5e22ce3ce82a1b34a199754 from qemu
This commit is contained in:
parent
3b3bce7d4e
commit
fa9828845f
|
@ -155,6 +155,16 @@ int arm_set_cpu_on(struct uc_struct *uc,
|
|||
} else {
|
||||
/* Processor is not in secure mode */
|
||||
target_cpu->env.cp15.scr_el3 |= SCR_NS;
|
||||
|
||||
/*
|
||||
* If QEMU is providing the equivalent of EL3 firmware, then we need
|
||||
* to make sure a CPU targeting EL2 comes out of reset with a
|
||||
* functional HVC insn.
|
||||
*/
|
||||
if (arm_feature(&target_cpu->env, ARM_FEATURE_EL3)
|
||||
&& target_el == 2) {
|
||||
target_cpu->env.cp15.scr_el3 |= SCR_HCE;
|
||||
}
|
||||
}
|
||||
|
||||
/* We check if the started CPU is now at the correct level */
|
||||
|
|
Loading…
Reference in a new issue