mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 10:11:05 +00:00
target-arm: Add ARMCPU secure property
Added a "has_el3" state property to the ARMCPU descriptor. This property indicates whether the ARMCPU has security extensions enabled (EL3) or not. By default it is disabled at this time. Backports commit 51942aee3c51ca23b0dd78f95534a57e8dc1e582 from qemu
This commit is contained in:
parent
1d3719a39f
commit
e1576f314e
|
@ -99,6 +99,8 @@ typedef struct ARMCPU {
|
|||
bool start_powered_off;
|
||||
/* CPU currently in PSCI powered-off state */
|
||||
bool powered_off;
|
||||
/* CPU has security extension */
|
||||
bool has_el3;
|
||||
|
||||
/* PSCI conduit used to invoke PSCI methods
|
||||
* 0 - disabled, 1 - smc, 2 - hvc
|
||||
|
|
|
@ -410,6 +410,18 @@ static int arm_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err
|
|||
cpu->reset_sctlr |= (1 << 13);
|
||||
}
|
||||
|
||||
if (!cpu->has_el3) {
|
||||
/* If the has_el3 CPU property is disabled then we need to disable the
|
||||
* feature.
|
||||
*/
|
||||
unset_feature(env, ARM_FEATURE_EL3);
|
||||
|
||||
/* Disable the security extension feature bits in the processor feature
|
||||
* register as well. This is id_pfr1[7:4].
|
||||
*/
|
||||
cpu->id_pfr1 &= ~0xf0;
|
||||
}
|
||||
|
||||
if (arm_feature(env, ARM_FEATURE_EL3)) {
|
||||
set_feature(env, ARM_FEATURE_VBAR);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue