qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Removal of some target CPU macros


From: J. Mayer
Subject: Re: [Qemu-devel] Removal of some target CPU macros
Date: Fri, 09 Nov 2007 23:04:09 +0100

On Wed, 2007-11-07 at 23:37 +0000, Paul Brook wrote:
> > I can check the hypervisor feature is not present, for emulating PowerPC
> > 620 on a target that would have hypervisor emulation support. But I
> > cannot do as if the CPU do not have the feature if it's actually
> > available. The PowerPC 64 target emulates PowerPC 64 without the
> > hypervisor feature, which actually do not exist but looks like a G5
> > machine when running Linux on it. If the emulator has the hypervisor
> > feature enabled, I need an hypervisor software to boot and manage the
> > machine
> 
> I agree with this much.
> 
> >  There is nothing in the CPU that would allow me to
> > make it run "as if the hypervisor mode do not exists".
> 
> So add one. It obviously exists conceptually, because that's what the 
> non-hypervisor qemu emulates.

I admit you're right, here... Maybe just disabling the "hypervisor mode"
flags and cleaverly initialise all hypervisor specific registers could
make it act like the current PowerPC 64 target but this is to be checked
when all hypervisor features will be emulated.

> > The only possible runtime solution would be to
> > duplicate every defined 64 bits CPU to define one model supporting
> > hypervisor feature and another acting as this feature do not exist (the
> > register definitions / access rights are not the same, and are defined
> > at CPU instanciation time, adding run-time checks there would cost a
> > lot...) and hope run-time checks won't cost too much.
> 
> As I mentioned earlier, from looking at all the occurrences of TARGET_PPC64H 
> I'd expect the runtime overhead to be minimal, if it's measurable at all.

Maybe because there are a lot of things missing for the hypervisor
feature to be completelly emulated... All the MMU part, specific
registers, ..., is missing.

> I'm not sure what you're getting at about flags being defined at 
> instantiation 
> time. That's the same whether you have two binaries or one.

True.

> Duplicating the CPU definitions should also be fairly trivial. You're 
> effectively already doing it when you build the separate ppc64 and ppc64h 
> binaries. I find it hard to believe it would be hard to do the same 
> transformation at runtime.

Yes, it's trivial to duplicate the CPU definitions. I'm just afraid of
the confusion it could introduce for the user seeing two definitions of
the same CPU.

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





reply via email to

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