qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch] CPU architecture selection


From: J. Mayer
Subject: Re: [Qemu-devel] [patch] CPU architecture selection
Date: Sat, 26 Mar 2005 22:56:00 +0100

On Sat, 2005-03-26 at 21:16 +0000, Paul Brook wrote:
> On Saturday 26 March 2005 20:02, J. Mayer wrote:
> > On Sat, 2005-03-26 at 19:46 +0000, Paul Brook wrote:
> > > The attached patch adds a -cpu commandline option to qemu to allow the
> > > user to select what type of CPU is emulated. It currently only does
> > > anything useful for arm targets, but it should be easy to hook other
> > > targets into the same mechanism.
> > >
> > > I implemented the selection as a bitmask. This allows users to select a
> > > CPU by the features it provides, and also allows creation of convenient
> > > aliases for common CPUs.
> >
> > there is a cpu_ppc_register function in target-ppc/translate.c which
> > does what's needed for emulated PPC selection.
> > The CPU is registered from the emulated board definition, ie in
> > hw/ppc_prep.c or hw/ppc_chrp.c.
> > Your patch conflicts with this code.
> 
> Hmm, I hadn't spotted that. I'll see if I can merge them.
> 
> > It seems to me that cpu selection should go in board definitions, like
> > all the rest of emulated hardware selection, then have nothing to do in
> > target-xxx/translate.c.
> 
> I'm not sure what you mean.
> 
> I guess it makes makes sense for the board to be able to specify the default 
> cpu. That's pretty much independent of the rest of the implementation though.
> I'd have thought CPU choice should be fairly independent of the rest of the 
> hardware.

You are wrong here: CPU choice & emulated board are strongly dependent.
I'll give you a few examples:
- if I want to emulate a MPC850 board, then I have to emulate the PPC850
core.
  No choice here.
- If I want to emulate an IBM pseries machine, it's a complete nonsense
to select a 32 bit 
  CPU, as the platform is 64 bits.
- if I want to emulate a Pegasos board, I need to have the choice
between G3 & G4.
  MorphOS would surelly not run on any other PPC, but the two choices
exist.

Then, the CPU selection is to be done at the same level as the rest of
the emulated board's hardware.

>  There's also user mode where we don't emulate any system hardware.

This is a _very_ special case, then it has to be treated its own way (in
linux-user directory).

-- 
J. Mayer <address@hidden>
Never organized





reply via email to

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