From: Gaurav Sharma <gauravs.2010@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] How is address of helper function for slow path calculated ?
Date: Wed, 26 Feb 2014 18:34:03 +0530 [thread overview]
Message-ID: <CABiB5K67xkKjcOXnJxX_811hT28yYTLWP+g54mQKuev3dexkDQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]
Hi,
I have been trying to trace the for how address translation is done for any
load/store instructions. I was trying to emulate arm on an x86-64 machine.
However, i need some clarifications :
1. During the slow path, qemu uses helper functions to translate address.
2. This is done by calling the function itself during the execution.
3. The host instrn for the slow path is added at the end of the TB block. I
tried a sample code and got the following host instrn :
0x2aaade72d120: mov %r14,%rdi
0x2aaade72d123: xor %edx,%edx
0x2aaade72d125: lea -0x42(%rip),%rcx # 0x2aaade72d0ea
0x2aaade72d12c: mov $0x2afd98602c10,%r10
0x2aaade72d136: callq *%r10 // Call helper function
0x2aaade72d139: mov %eax,%ebp
0x2aaade72d13b: jmpq 0x2aaade72d0ea
3. How does it gets the address of the helper function :
call instruction is added by ' tcg_out_calli(s,
(uintptr_t)qemu_ld_helpers[opc & ~MO_SIGN]' line of code which fetches the
address of the helper function.
However from the assembly generated, the address is calculated before :
tcg_out_movi(s, TCG_TYPE_PTR, tcg_target_call_iarg_regs[3],
(uintptr_t)l->raddr)
How is the address for the helper function calculated ?
Thanks,
Gaurav
[-- Attachment #2: Type: text/html, Size: 1541 bytes --]
next reply other threads:[~2014-02-26 13:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 13:04 Gaurav Sharma [this message]
2014-02-26 13:14 ` [Qemu-devel] How is address of helper function for slow path calculated ? Peter Maydell
2014-02-26 13:46 ` Gaurav Sharma
2014-02-26 13:58 ` Peter Maydell
2014-02-26 21:50 ` Xuebing wang
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=CABiB5K67xkKjcOXnJxX_811hT28yYTLWP+g54mQKuev3dexkDQ@mail.gmail.com \
--to=gauravs.2010@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).