Received: from eggs.gnu.org ([208.118.235.92]:45877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY2YX-0004fd-Hc for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:32:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TY2YU-0003kH-Ex for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:32:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY2YU-0003k7-5Q for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:32:34 -0500 Date: Mon, 12 Nov 2012 20:33:42 -0200 From: Eduardo Habkost Message-ID: <20121112223342.GK3149@otherpad.lan.raisama.net> References: <1334421743-31146-1-git-send-email-peter.maydell@linaro.org> <1334421743-31146-3-git-send-email-peter.maydell@linaro.org> <20121112221619.GH8231@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 01/14] target-arm: Add QOM subclasses for each ARM cpu implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Anthony Liguori , patches@linaro.org, qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= , Paul Brook On Mon, Nov 12, 2012 at 10:18:29PM +0000, Peter Maydell wrote: > On 12 November 2012 22:16, Eduardo Habkost wrote: > > > > Sorry for replying to a patch 7 months later, but I just have a quest= ion > > related to how we will handle CPU model classes on all targets: > > > > On Sat, Apr 14, 2012 at 05:42:10PM +0100, Peter Maydell wrote: > >> Register subclasses for each ARM CPU implementation (with the > >> exception of "pxa270", which is an alias for "pxa270-a0"). > >> > >> Let arm_cpu_list() enumerate CPU subclasses in alphabetical order, > >> except for special value "any". > >> > >> Replace cpu_arm_find_by_name()'s string -> CPUID lookup by storing t= he > >> CPUID (aka MIDR, Main ID Register) value in the class. > >> > >> Signed-off-by: Andreas F=E4rber > >> Signed-off-by: Peter Maydell > >> --- > >> target-arm/cpu-qom.h | 12 +++ > >> target-arm/cpu.c | 226 +++++++++++++++++++++++++++++++++++++++= ++++++++++- > >> target-arm/helper.c | 109 ++++++++++-------------- > >> 3 files changed, 282 insertions(+), 65 deletions(-) > >> > >> diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h > >> index 42d2a6b..a4bcb31 100644 > >> --- a/target-arm/cpu-qom.h > >> +++ b/target-arm/cpu-qom.h > >> @@ -58,6 +58,18 @@ typedef struct ARMCPU { > > [...] > >> +typedef struct ARMCPUInfo { > >> + const char *name; > >> + void (*initfn)(Object *obj); > >> +} ARMCPUInfo; > >> + > >> +static const ARMCPUInfo arm_cpus[] =3D { > > [...] > >> + { .name =3D "any", .initfn =3D arm_any_initfn }, > >> +}; > >> + > > > > Do we really want to use "any" as the class name? >=20 > Probably not, since it would make it tricky to (in some future > utopia) have a QEMU which supported more than one CPU architecture > in the same binary if they all wanted to use "any"... In that case, "cpu-any" wouldn't work, either. What about "-cpu-"? >=20 > > Maybe we should use > > "cpu-" as the namespace for the CPU model class names? >=20 > Sounds reasonable. >=20 > -- PMM --=20 Eduardo