From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIDEE-0001jF-9M for qemu-devel@nongnu.org; Tue, 25 Feb 2014 03:19:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIDE8-0001N8-6w for qemu-devel@nongnu.org; Tue, 25 Feb 2014 03:19:02 -0500 Received: from mail-we0-f171.google.com ([74.125.82.171]:61305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIDE8-0001N0-12 for qemu-devel@nongnu.org; Tue, 25 Feb 2014 03:18:56 -0500 Received: by mail-we0-f171.google.com with SMTP id u56so46221wes.30 for ; Tue, 25 Feb 2014 00:18:54 -0800 (PST) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: <1393273442-20736-4-git-send-email-peter.maydell@linaro.org> References: <1393273442-20736-1-git-send-email-peter.maydell@linaro.org> <1393273442-20736-4-git-send-email-peter.maydell@linaro.org> Date: Tue, 25 Feb 2014 18:18:54 +1000 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH 3/4] exynos4210: Set reset-cbar property of Cortex-A9 CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Rob Herring , Evgeny Voevodin , Patch Tracking , Alexey Kardashevskiy , "qemu-devel@nongnu.org Developers" , Igor Mitsyanko , Dmitry Solodkiy , Maksim Kozlov , =?ISO-8859-1?Q?Andreas_F=E4rber?= On Tue, Feb 25, 2014 at 6:24 AM, Peter Maydell wrote: > Set the reset-cbar property of the Exynos4210 SoC's Cortex-A9 > CPUs, so that Linux doesn't misrecognize them as a broken > uniprocessor SoC. > > Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite But a couple of random notes below ... > --- > hw/arm/exynos4210.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c > index 9f137e9..a6f481a 100644 > --- a/hw/arm/exynos4210.c > +++ b/hw/arm/exynos4210.c > @@ -143,11 +143,28 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem, > unsigned long mem_size; > DeviceState *dev; > SysBusDevice *busdev; > + ObjectClass *cpu_oc; > + > + cpu_oc = cpu_class_by_name(TYPE_ARM_CPU, "cortex-a9"); > + if (!cpu_oc) { > + fprintf(stderr, "Unable to find CPU definition\n"); > + exit(1); > + } Now that this code is ignoring use -cpu I wonder if this should be promoted to an assertion. The only way this can fail is if someone rips A9 out of QEMU (or some other nasty fatal condition). > > for (n = 0; n < EXYNOS4210_NCPUS; n++) { > - s->cpu[n] = cpu_arm_init("cortex-a9"); > - if (!s->cpu[n]) { > - fprintf(stderr, "Unable to find CPU %d definition\n", n); > + Object *cpuobj = object_new(object_class_get_name(cpu_oc)); > + Error *err = NULL; > + > + s->cpu[n] = ARM_CPU(cpuobj); > + object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR, > + "reset-cbar", &err); > + if (err) { > + error_report("%s", error_get_pretty(err)); > + exit(1); > + } And this may even be convertible to error_abort as theres no user accessible way to make this fail. Regards, Peter > + object_property_set_bool(cpuobj, true, "realized", &err); > + if (err) { > + error_report("%s", error_get_pretty(err)); > exit(1); > } > } > -- > 1.8.5 > >