aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpu-exec.c8
-rw-r--r--hw/arm/highbank.c19
-rw-r--r--hw/arm/vexpress.c7
-rw-r--r--translate-all.c1
4 files changed, 23 insertions, 12 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 0914d3c85c..2f54054d8c 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -227,6 +227,8 @@ int cpu_exec(CPUArchState *env)
TranslationBlock *tb;
uint8_t *tc_ptr;
uintptr_t next_tb;
+ /* This must be volatile so it is not trashed by longjmp() */
+ volatile bool have_tb_lock = false;
if (cpu->halted) {
if (!cpu_has_work(cpu)) {
@@ -600,6 +602,7 @@ int cpu_exec(CPUArchState *env)
cpu_loop_exit(cpu);
}
spin_lock(&tcg_ctx.tb_ctx.tb_lock);
+ have_tb_lock = true;
tb = tb_find_fast(env);
/* Note: we do it here to avoid a gcc bug on Mac OS X when
doing it in tb_find_slow */
@@ -621,6 +624,7 @@ int cpu_exec(CPUArchState *env)
tb_add_jump((TranslationBlock *)(next_tb & ~TB_EXIT_MASK),
next_tb & TB_EXIT_MASK, tb);
}
+ have_tb_lock = false;
spin_unlock(&tcg_ctx.tb_ctx.tb_lock);
/* cpu_interrupt might be called while translating the
@@ -692,6 +696,10 @@ int cpu_exec(CPUArchState *env)
#ifdef TARGET_I386
x86_cpu = X86_CPU(cpu);
#endif
+ if (have_tb_lock) {
+ spin_unlock(&tcg_ctx.tb_ctx.tb_lock);
+ have_tb_lock = false;
+ }
}
} /* for(;;) */
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index f66d57b113..46b9f1e0c0 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -230,18 +230,23 @@ 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;
- cpu = ARM_CPU(object_new(object_class_get_name(oc)));
-
- object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
- &err);
- if (err) {
- error_report("%s", error_get_pretty(err));
+ if (!oc) {
+ error_report("Unable to find CPU definition");
exit(1);
}
- object_property_set_bool(OBJECT(cpu), true, "realized", &err);
+
+ cpuobj = object_new(object_class_get_name(oc));
+ cpu = ARM_CPU(cpuobj);
+
+ if (object_property_find(cpuobj, "reset-cbar", NULL)) {
+ object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
+ "reset-cbar", &error_abort);
+ }
+ 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 67628af588..169eb061a3 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) {
diff --git a/translate-all.c b/translate-all.c
index f243c10094..5759974d42 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1777,7 +1777,6 @@ int page_check_range(target_ulong start, target_ulong len, int flags)
return -1;
}
}
- return 0;
}
}
return 0;