qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 01/14] target-arm: Add QOM subclasses for eac


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v2 01/14] target-arm: Add QOM subclasses for each ARM cpu implementation
Date: Mon, 12 Nov 2012 20:33:42 -0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Nov 12, 2012 at 10:18:29PM +0000, Peter Maydell wrote:
> On 12 November 2012 22:16, Eduardo Habkost <address@hidden> wrote:
> >
> > Sorry for replying to a patch 7 months later, but I just have a question
> > 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 the
> >> CPUID (aka MIDR, Main ID Register) value in the class.
> >>
> >> Signed-off-by: Andreas Färber <address@hidden>
> >> Signed-off-by: Peter Maydell <address@hidden>
> >> ---
> >>  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[] = {
> > [...]
> >> +    { .name = "any",         .initfn = arm_any_initfn },
> >> +};
> >> +
> >
> > Do we really want to use "any" as the class name?
> 
> 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
"<arch>-cpu-<model>"?

> 
> > Maybe we should use
> > "cpu-<model>" as the namespace for the CPU model class names?
> 
> Sounds reasonable.
> 
> -- PMM

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]