qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] Basic Question on QEMU Internals


From: Peter Maydell
Subject: Re: [Qemu-discuss] Basic Question on QEMU Internals
Date: Thu, 26 Mar 2015 20:58:45 +0000

On 26 March 2015 at 20:44, Patrick <address@hidden> wrote:
> Thank you for the response. This makes sense, but I am not seeing how the
> "cpu" or "machine" command-line arguments fit into the "flow." It appears
> that the "cpu" flag is changing the x86 microarchitecture that is being
> emulated. If the x86 code is getting translated to TCG ops, then how does
> changing the microarchitecture change the flow?

-cpu specifies the guest CPU type to use. That affects
the fine detail of exactly how we translate the
guest code to TCG ops (for instance, if we're emulating
a 386 then we will translate pentium-only guest instructions
to TCG code that says "take an exception, not a valid instruction"
rather than to TCG code that says "do these things to have the
effect the instruction should have"). But the flow is in
general the same in all cases:
 guest code -> TCG -> host code

(If you use, for instance, qemu-system-ppc and a -cpu
argument specifying a PPC guest CPU, then how we translate
guest code to TCG will of course change a lot, since the
instruction set is completely different. The "TCG -> host code"
part remains exactly the same, though.)

-- PMM



reply via email to

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