qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insis


From: Peter Maydell
Subject: [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property
Date: Thu, 3 Apr 2014 14:56:28 +0100

For the machine models which can have a Cortex-A15 CPU (vexpress-a15 and
midway), silently continue if the CPU object has no reset-cbar property
rather than failing. This allows these boards to be used under KVM with
the "-cpu host" option, since the 'host' CPU object has no reset-cbar
property.

Signed-off-by: Peter Maydell <address@hidden>
---
 hw/arm/highbank.c | 14 +++++++-------
 hw/arm/vexpress.c |  7 +++----
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index 03545aa..83e43fd 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -230,6 +230,7 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum 
cxmachines machine)
 
     for (n = 0; n < smp_cpus; n++) {
         ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
+        Object *cpuobj;
         ARMCPU *cpu;
         Error *err = NULL;
 
@@ -238,15 +239,14 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum 
cxmachines machine)
             exit(1);
         }
 
-        cpu = ARM_CPU(object_new(object_class_get_name(oc)));
+        cpuobj = object_new(object_class_get_name(oc));
+        cpu = ARM_CPU(cpuobj);
 
-        object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
-                                &err);
-        if (err) {
-            error_report("%s", error_get_pretty(err));
-            exit(1);
+        if (object_property_find(cpuobj, "reset-cbar", NULL)) {
+            object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
+                                    "reset-cbar", &error_abort);
         }
-        object_property_set_bool(OBJECT(cpu), true, "realized", &err);
+        object_property_set_bool(cpuobj, true, "realized", &err);
         if (err) {
             error_report("%s", error_get_pretty(err));
             exit(1);
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 67628af..169eb06 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -192,10 +192,9 @@ static void init_cpus(const char *cpu_model, const char 
*privdev,
         Object *cpuobj = object_new(object_class_get_name(cpu_oc));
         Error *err = NULL;
 
-        object_property_set_int(cpuobj, periphbase, "reset-cbar", &err);
-        if (err) {
-            error_report("%s", error_get_pretty(err));
-            exit(1);
+        if (object_property_find(cpuobj, "reset-cbar", NULL)) {
+            object_property_set_int(cpuobj, periphbase,
+                                    "reset-cbar", &error_abort);
         }
         object_property_set_bool(cpuobj, true, "realized", &err);
         if (err) {
-- 
1.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]