qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] qemu dynamic translation (system design) question
@ 2006-08-19  9:37 Laurent DESNOGUES
  2006-08-20 15:23 ` S.P.T.Krishnan
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent DESNOGUES @ 2006-08-19  9:37 UTC (permalink / raw)
  To: qemu-devel

> 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 ?

Look in qemu-exec.c/tb_find_fast


Laurent

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [Qemu-devel] qemu dynamic translation (system design) question
@ 2006-08-19  9:00 S.P.T.Krishnan
  2006-08-24 17:52 ` ByteRage
  0 siblings, 1 reply; 5+ messages in thread
From: S.P.T.Krishnan @ 2006-08-19  9:00 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-24 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-19  9:37 [Qemu-devel] qemu dynamic translation (system design) question Laurent DESNOGUES
2006-08-20 15:23 ` S.P.T.Krishnan
2006-08-20 23:48   ` Re[2]: " Paul Sokolovsky
  -- strict thread matches above, loose matches on Subject: below --
2006-08-19  9:00 S.P.T.Krishnan
2006-08-24 17:52 ` ByteRage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).