qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Emulating powerpc 440EP with qemu-system-ppcemb


From: Rob Landley
Subject: Re: [Qemu-devel] Emulating powerpc 440EP with qemu-system-ppcemb
Date: Sun, 23 Jan 2011 16:21:47 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 01/23/2011 01:52 PM, Dushyant Bansal wrote:
> 
>> Those are board emulations.  Does it have a 440 _cpu_ emulation?
>>
>> ./qemu-system-ppc -cpu ? | grep 440
>>    
> This is the output.
> PowerPC 440-Xilinx       PVR 7ff21910
> 
> Is this right for my requirement?

I have no idea?  Sounds worth a try...

> This is qemu version 0.13.50. And, it seems this support has been added
> recently. It is missing in qemu version 0.12.5.
> I have one more query. You said 440 was supported in kvm.

KVM runs on powerpc systems, including PPC 440.

KVM doesn't do CPU emulation, it does CPU virtualization.  IT can't do
PowerPC on an x86 host, it does PowerPC on a PowerPC host.  (It only
uses QEMU to attach I/O devices to the virtual CPUs the hardware
provides.  It needs a CPU that can do nested page tables, things like
the Intel VT extensions.)

So KVM can run PowerPC 440 code when running on a PowerPC 440 host.
That's where the Bamboo board emulation came from: somebody was running
KVM on a PowerPC 440 host, and wanted a board emulation for the virtual
systems to do I/O through.

> But kvm also
> uses qemu as its userspace component. So, 440 was supported through kvm
> kernel module?

KVM just uses the QEMU code to attach virtual I/O devices to a CPU
context that's provided by the hardware.

So in order to get KVM to emulate a PowerPC 440, you have to run it on a
PowerPC 440 host.  (If you do so, QEMU will happily emulate a bamboo
board for it.)

I suspect the problem is that the kernel's actual bamboo drivers have
inline assembly instructions snippets, and QEMU isn't emulating those
instructions.

Note that the powerpc 440 is mostly a subset of normal 32 bit powerpc
(um, 405?).  Specifically, powerpc 440 userspace code should run on a
full-fledged PPC just fine, at least with software floating point.  It's
the protected mode instructions (mmu management and such) that differ,
stuff that only really happens in the kernel.

My fuzzy understanding is that the 440 happened when IBM tried to strip
down the PowerPC for the embedded market, mostly by removing several
instructions.  (So 405 code won't run on it, but 440 code will mostly
run on a 405, except for the priviledged instructions which of course
are all wildly different, but that should only get used inside the
kernel.  Don't ask me about floating point.)

Motorola did the same thing by the way, except they removed a DIFFERENT
set of instructions so the two were incompatible.  You can find traces
of that in kernel under "arch/powerpc/platforms/8xx" if you're curious,
but I think that died even before they spun off Freescale.  (Maybe it
just doesn't get used on Linux?  They tried to revive it as the
"PowerQUIC" SOC line a few years ago but I dunno if it went anywhere.)

Of course wikipedia will have an opinion.  (A subset of it might even be
correct, who knows?  It's the best source of anecdotal evidence on the net.)

  http://en.wikipedia.org/wiki/List_of_PowerPC_processors

Rob



reply via email to

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