* [Qemu-devel] [for-2.0 0/2] A15 board bugfixes
@ 2014-04-03 13:56 Peter Maydell
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Peter Maydell
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Peter Maydell @ 2014-04-03 13:56 UTC (permalink / raw)
To: qemu-devel; +Cc: Rob Herring, patches
This patchset fixes a couple of issues with A15 boards.
The first is a really obvious one -- running QEMU with
'-M midway -cpu bang' segfaults.
The second one is a problem with running an A15 board
model under KVM with "-cpu host": since the 'host' CPU object
doesn't have a 'reset-cbar' QOM property we need to quietly
continue in that case rather than failing. (Ideally we'd
support lying to the guest about its CPU in the kernel,
and then we could just say "-cpu host only makes sense for
the virt machine", but we're not there right now.)
Peter Maydell (2):
hw/arm/highbank: Don't segfault on unknown CPU names
hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar
property
hw/arm/highbank.c | 19 ++++++++++++-------
hw/arm/vexpress.c | 7 +++----
2 files changed, 15 insertions(+), 11 deletions(-)
--
1.9.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names
2014-04-03 13:56 [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Peter Maydell
@ 2014-04-03 13:56 ` Peter Maydell
2014-04-03 15:48 ` Andreas Färber
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property Peter Maydell
2014-04-03 14:25 ` [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Rob Herring
2 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2014-04-03 13:56 UTC (permalink / raw)
To: qemu-devel; +Cc: Rob Herring, patches
If the user passes an unknown CPU name via the '-cpu' option, exit
with an error message rather than segfaulting.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/highbank.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index f66d57b..03545aa 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -233,6 +233,11 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
ARMCPU *cpu;
Error *err = NULL;
+ if (!oc) {
+ fprintf(stderr, "Unable to find CPU definition\n");
+ exit(1);
+ }
+
cpu = ARM_CPU(object_new(object_class_get_name(oc)));
object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property
2014-04-03 13:56 [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Peter Maydell
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Peter Maydell
@ 2014-04-03 13:56 ` Peter Maydell
2014-04-03 14:25 ` [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Rob Herring
2 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-04-03 13:56 UTC (permalink / raw)
To: qemu-devel; +Cc: Rob Herring, patches
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 <peter.maydell@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [for-2.0 0/2] A15 board bugfixes
2014-04-03 13:56 [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Peter Maydell
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Peter Maydell
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property Peter Maydell
@ 2014-04-03 14:25 ` Rob Herring
2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2014-04-03 14:25 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers, Patch Tracking
On Thu, Apr 3, 2014 at 8:56 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> This patchset fixes a couple of issues with A15 boards.
>
> The first is a really obvious one -- running QEMU with
> '-M midway -cpu bang' segfaults.
>
> The second one is a problem with running an A15 board
> model under KVM with "-cpu host": since the 'host' CPU object
> doesn't have a 'reset-cbar' QOM property we need to quietly
> continue in that case rather than failing. (Ideally we'd
> support lying to the guest about its CPU in the kernel,
> and then we could just say "-cpu host only makes sense for
> the virt machine", but we're not there right now.)
>
> Peter Maydell (2):
> hw/arm/highbank: Don't segfault on unknown CPU names
> hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar
> property
For both:
Reviewed-by: Rob Herring <rob.herring@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Peter Maydell
@ 2014-04-03 15:48 ` Andreas Färber
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2014-04-03 15:48 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Rob Herring, patches
Am 03.04.2014 15:56, schrieb Peter Maydell:
> If the user passes an unknown CPU name via the '-cpu' option, exit
> with an error message rather than segfaulting.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/arm/highbank.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
> index f66d57b..03545aa 100644
> --- a/hw/arm/highbank.c
> +++ b/hw/arm/highbank.c
> @@ -233,6 +233,11 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
> ARMCPU *cpu;
> Error *err = NULL;
>
> + if (!oc) {
> + fprintf(stderr, "Unable to find CPU definition\n");
Old habits die hard... error_report() please.
Otherwise looks good.
One side effect of the cpu_arm_init() inlining here is that it didn't
get the properties support for -cpu, I note.
Regards,
Andreas
> + exit(1);
> + }
> +
> cpu = ARM_CPU(object_new(object_class_get_name(oc)));
>
> object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-04-03 15:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 13:56 [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Peter Maydell
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Peter Maydell
2014-04-03 15:48 ` Andreas Färber
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property Peter Maydell
2014-04-03 14:25 ` [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).