qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steven <wangwangkang@gmail.com>
To: Xin Tong <xerox.time.tech@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	"陳韋任 (Wei-Ren Chen)" <chenwj@iis.sinica.edu.tw>
Subject: Re: [Qemu-devel] passing translated address out in QEMU
Date: Thu, 23 Aug 2012 17:55:13 -0400	[thread overview]
Message-ID: <CAMTrTqWJF4Bs3HW4x_ap3rujq-GOeGcM41eev2hDbiXjgARSyA@mail.gmail.com> (raw)
In-Reply-To: <CALKntY3FA7V4t+r4_yktR=VxP97X31kCVX=Fi3B8GM=yBzxT1Q@mail.gmail.com>

Hi, Xin,
Try Max's patch
http://lists.gnu.org/archive/html/qemu-devel/2012-08/msg03226.html

I used it to get all the guest virtual address because this patch
disable the fast mmu path.

Steven

On Thu, Aug 23, 2012 at 12:18 PM, Xin Tong <xerox.time.tech@gmail.com> wrote:
> On Thu, Aug 23, 2012 at 8:52 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 23 August 2012 16:34, Xin Tong <xerox.time.tech@gmail.com> wrote:
>>> I am emulating arm on x86. i want to track the virt and physical
>>> address of last memory operation. so i put 2 fields in the CPUState
>>> and make tcg_global_mem_new_i32 on them Therefore, before every
>>> translation i generate code to save the virtual address as follow:
>>>
>>> static inline void gen_st32(TCGv val, TCGv addr, int index)
>>> {
>>>     tcg_gen_mov_i32(cpu_last_vaddr, addr);
>>>     tcg_gen_qemu_st32(val, addr, index);
>>>    // tcg_gen_mov_i32(cpu_last_paddr, addr);
>>>     tcg_temp_free_i32(val);
>>> }
>>>
>>> But i do not know how to save the physical, as the physical address is
>>> never passed out of tcg_gen_qemu_st32. what would be the best way to
>>> get the physical address here ? i want to pass it out by the "TCGv
>>> addr here" but it did not work ...
>>
>> This is quite difficult because our fast-path code doesn't actually
>> deal with the guest physical address at all: we create a TLB which
>> maps directly from guest virtual address to host virtual address
>> and use that most of the time.
>>
>> In general you are running into the problem that QEMU is designed
>> to run code fast, not to be easy to instrument.
>
> even that. is it possible to pass host virtual out. the fast path add
> the addend to get host virtual ? so it must be in a register, most
> likely eax in i386. what do you think would be the best way to get
> that out ?
>
> Xin
>
>>
>> -- PMM
>

  reply	other threads:[~2012-08-23 21:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 17:17 [Qemu-devel] passing translated address out in QEMU Xin Tong
2012-08-23  3:14 ` 陳韋任 (Wei-Ren Chen)
2012-08-23  4:38   ` Xin Tong
2012-08-23 10:06     ` 陳韋任 (Wei-Ren Chen)
2012-08-23 10:11     ` 陳韋任 (Wei-Ren Chen)
2012-08-23 15:34       ` Xin Tong
2012-08-23 15:52         ` Peter Maydell
2012-08-23 16:18           ` Xin Tong
2012-08-23 21:55             ` Steven [this message]
2012-08-24  2:57             ` 陳韋任 (Wei-Ren Chen)
2012-08-24  3:24               ` Xin Tong
2012-08-24  4:06                 ` 陳韋任 (Wei-Ren Chen)
2012-08-24  4:29                   ` Xin Tong
2012-08-24  8:15                     ` 陳韋任 (Wei-Ren Chen)

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=CAMTrTqWJF4Bs3HW4x_ap3rujq-GOeGcM41eev2hDbiXjgARSyA@mail.gmail.com \
    --to=wangwangkang@gmail.com \
    --cc=chenwj@iis.sinica.edu.tw \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xerox.time.tech@gmail.com \
    /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).