From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlbdq-0001O5-3g for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:42:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vlbdj-00065r-Ut for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:42:42 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36800 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlbdj-00065j-Kk for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:42:35 -0500 Message-ID: <5295BE86.9050109@suse.de> Date: Wed, 27 Nov 2013 10:42:30 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH arm-devs v1 2/6] target-arm/cpu: Convert reset CBAR to a property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Peter Crosthwaite Cc: QEMU Developers , Mark Langsdorf Am 27.11.2013 10:14, schrieb Peter Maydell: > On 27 November 2013 09:01, Peter Crosthwaite > wrote: >> The reset Value of the CP15 CBAR is a vendor (machine) configurable >> property. Define arm_cpu_properties and add it. >> >> Signed-off-by: Peter Crosthwaite >> --- >> >> target-arm/cpu.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/target-arm/cpu.c b/target-arm/cpu.c >> index a82fa61..f1c5f6b 100644 >> --- a/target-arm/cpu.c >> +++ b/target-arm/cpu.c >> @@ -20,6 +20,7 @@ >> >> #include "cpu.h" >> #include "qemu-common.h" >> +#include "hw/qdev-properties.h" >> #if !defined(CONFIG_USER_ONLY) >> #include "hw/loader.h" >> #endif >> @@ -847,6 +848,11 @@ typedef struct ARMCPUInfo { >> void (*class_init)(ObjectClass *oc, void *data); >> } ARMCPUInfo; >> >> +static Property arm_cpu_properties[] =3D { >> + DEFINE_PROP_UINT32("cbar", ARMCPU, reset_cbar, 0), >> + DEFINE_PROP_END_OF_LIST(), >> +}; >> + >> static const ARMCPUInfo arm_cpus[] =3D { >> #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) >> { .name =3D "arm926", .initfn =3D arm926_initfn }, >> @@ -895,6 +901,7 @@ static void arm_cpu_class_init(ObjectClass *oc, vo= id *data) >> >> acc->parent_realize =3D dc->realize; >> dc->realize =3D arm_cpu_realizefn; >> + dc->props =3D arm_cpu_properties; >> >> acc->parent_reset =3D cc->reset; >> cc->reset =3D arm_cpu_reset; >=20 > Hmm. This means we end up with a cbar property on every > ARM CPU whether that ARM CPU has a cbar or not... If we turn it into a dynamic property, we could register it conditional to ARM_FEATURE_CBAR. The overall idea of the series makes sense to me. I would caution to think about the naming scheme though - we might want to have a "cbar" property to access the current value whereas we'll likely end up having several reset values to configure over time. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg