From: Christopher Covington <cov@codeaurora.org>
To: Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Wenjie Liu <lwj0012@gmail.com>
Cc: "Stefan Hajnoczi" <stefanha@gmail.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Lluís Vilanova" <vilanova@ac.upc.edu>
Subject: Re: [Qemu-devel] About address mapping between host and guest in QEMU
Date: Fri, 24 Apr 2015 15:09:37 -0400 [thread overview]
Message-ID: <553A94F1.2020305@codeaurora.org> (raw)
In-Reply-To: <CAFEAcA8=yxTsgQ4Wmq_oVnT6uva2wns3K9a8p7sDRKrtCuoGKQ@mail.gmail.com>
On 04/24/2015 08:46 AM, Peter Maydell wrote:
> On 24 April 2015 at 12:26, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> On 24/04/2015 04:10, Wenjie Liu wrote:
>>> The thing I am trying to achieve is to get the data and guest physical
>>> address of every guest memory access, so I need to known which API can
>>> be used to do the address transform.
>>
>> The short answer is that is difficult, because most guest memory
>> accesses do not call any C function. QEMU has a virtual TLB; if you
>> have a TLB hit, the code generated by the JIT compiler does the conversion.
>
> In fact on a TLB hit it's possible that it's not actually any
> longer determinable what the guest physical address was. This
> only really happens with buggy guests, but if the guest does
> a load that brings an entry into the TLB and then rewrites the
> page table but fails to do the TLB maintenance operation, then
> at the point when a subsequent load hits in the TLB we know
> the guest virtual address and the host virtual address but not
> the guest physical address, and we can't find the guest physaddr
> any more even if we walk the page tables, because those have
> been changed...
>
> Wanting to do this kind of memory access tracing is a pretty
> common user request, though, and it would be nice if QEMU
> had the facilities for it. It's just that our current design
> is really not set up to make it easy to implement.
While probably very slow, could the kind of guest memory trace in question be
captured using the GDB stub and a breakpoint on every load an store
instruction (or alternatively, a watchpoint on every possible address)?
Chris
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-04-24 19:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 13:31 [Qemu-devel] About address mapping between host and guest in QEMU Wenjie Liu
2015-04-22 15:26 ` Wenjie Liu
2015-04-23 13:56 ` Wenjie Liu
2015-04-23 14:03 ` Peter Maydell
2015-04-24 2:10 ` Wenjie Liu
2015-04-24 11:26 ` Paolo Bonzini
2015-04-24 12:46 ` Peter Maydell
2015-04-24 19:09 ` Christopher Covington [this message]
2015-04-24 19:50 ` Brendan Dolan-Gavitt
2015-04-24 23:48 ` Christopher Covington
2015-04-25 1:51 ` Wenjie Liu
2015-04-25 12:23 ` Peter Maydell
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=553A94F1.2020305@codeaurora.org \
--to=cov@codeaurora.org \
--cc=lwj0012@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=vilanova@ac.upc.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.