From: S.P.T.Krishnan <sptkrishnan@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu dynamic translation (system design) question
Date: Sat, 19 Aug 2006 17:00:47 +0800 [thread overview]
Message-ID: <3ed52ec0608190200y7627bdeeib8ba9c8c3d7e5c66@mail.gmail.com> (raw)
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
next reply other threads:[~2006-08-19 9:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-19 9:00 S.P.T.Krishnan [this message]
2006-08-24 17:52 ` [Qemu-devel] qemu dynamic translation (system design) question ByteRage
-- strict thread matches above, loose matches on Subject: below --
2006-08-19 9:37 Laurent DESNOGUES
2006-08-20 15:23 ` S.P.T.Krishnan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ed52ec0608190200y7627bdeeib8ba9c8c3d7e5c66@mail.gmail.com \
--to=sptkrishnan@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).