qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] qemu dynamic translation (system design) question


From: S . P . T . Krishnan
Subject: [Qemu-devel] qemu dynamic translation (system design) question
Date: Sat, 19 Aug 2006 17:00:47 +0800

Hi,

I would like to understand certain aspects of dynamic translation
which Qemu employs to run the guest OS.  I have read the qemu paper
and this query is beyond that.

My understanding is as follows:
1. Qemu slices the guest os binary into blocks and then asks the Host
OS to execute it and return the result
2. In the above, without the accelerator module, Qemu does dynamic
translation of guest_asm -> c_func -> host_asm.  With the accelerator
this conversion doesn't happen as the guest_asm and host_asm are the
same.
3. Now before a block is executed the cpu_clock_ticks is updated in
main_loop_wait and after the block is executed the cpu_clock_ticks is
again updated based on the number of ticks that have gone by in the
host_os during the execution.  Is my understanding correct ? I think
the qemu system works like this because qemu is still a process under
the host os and hence cannot guarantee to the guest os how long it
will take for qemu to execute guest_os instructions.  One simple
scenario could be the user in the host os suspends the qemu process
for a while...
4. The interesting part happens when qemu encourters an already
translated block.  I understand that for efficiency qemu caches block
based on some kind of signature and when the same block appears qemu
simply uses the translated binary instead of re-translating it

I have two questions here.

a. How does qemu slice the guest binary into blocks ? any rational or
rule of thumb here ?
b. Once a block is generated some ID should be assigned to it right ?
in which src file it is stored ?
c. The next time a src block with the same signature is encountered
the cached host binary is used right ?  -- How does qemu detect that
is the same guest block ? md5sum or other fingerprinting methods ?
d. Does this caching happen even with accelerator module running ?

I understand my questions are deep into the design of qemu itself.
Can I request Fabrice or the core team to help me out here ?

regards,
Krishnan




reply via email to

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