aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Bellows <greg.bellows@linaro.org>2014-12-03 10:00:10 -0600
committerGreg Bellows <greg.bellows@linaro.org>2014-12-03 10:34:10 -0600
commita9eb8198289d3353095d55f4047998cdcb49a563 (patch)
treeb3cdaf151ccedcb936b96fa67d44b764699a6cc9
parenta03235789c5ae68cec897e0e7940e8ba1d4e3b19 (diff)
target-arm: Set CPU secure prop during virt initv11.switch
Add setting of the CPU secure property based on the virt machine secure property during initialization. This enables/disables secure state during start-up. Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
-rw-r--r--hw/arm/virt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 864d03274..112e59faf 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -547,6 +547,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
static void machvirt_init(MachineState *machine)
{
+ VirtMachineState *vms = VIRT_MACHINE(machine);
qemu_irq pic[NUM_IRQS];
MemoryRegion *sysmem = get_system_memory();
int n;
@@ -584,6 +585,16 @@ static void machvirt_init(MachineState *machine)
}
cpuobj = object_new(object_class_get_name(oc));
+ if (vms->secure) {
+ Error *err = NULL;
+ object_property_set_bool(cpuobj, true, "secure", &err);
+ if (err) {
+ error_report("'secure' state not supported with %s cpu",
+ cpu_model);
+ exit(1);
+ }
+ }
+
object_property_set_int(cpuobj, QEMU_PSCI_CONDUIT_HVC, "psci-conduit",
NULL);