mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
hw/cpu/{a15mpcore, a9mpcore}: enable TrustZone in GIC if it is enabled in CPUs
If the A9 and A15 CPUs which we're creating the peripherals for have TrustZone (EL3) enabled, then also enable it in the GIC we create. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-id: 1441383782-24378-5-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
8ff41f3995
commit
4182bbb19d
2 changed files with 24 additions and 0 deletions
|
@ -52,10 +52,23 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
|
|||
SysBusDevice *busdev;
|
||||
int i;
|
||||
Error *err = NULL;
|
||||
bool has_el3;
|
||||
Object *cpuobj;
|
||||
|
||||
gicdev = DEVICE(&s->gic);
|
||||
qdev_prop_set_uint32(gicdev, "num-cpu", s->num_cpu);
|
||||
qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq);
|
||||
|
||||
if (!kvm_irqchip_in_kernel()) {
|
||||
/* Make the GIC's TZ support match the CPUs. We assume that
|
||||
* either all the CPUs have TZ, or none do.
|
||||
*/
|
||||
cpuobj = OBJECT(qemu_get_cpu(0));
|
||||
has_el3 = object_property_find(cpuobj, "has_el3", &error_abort) &&
|
||||
object_property_get_bool(cpuobj, "has_el3", &error_abort);
|
||||
qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
|
||||
}
|
||||
|
||||
object_property_set_bool(OBJECT(&s->gic), true, "realized", &err);
|
||||
if (err != NULL) {
|
||||
error_propagate(errp, err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue