qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] How to get the guest virtual address when the guest pro


From: Lluís Vilanova
Subject: Re: [Qemu-devel] How to get the guest virtual address when the guest program is executed?
Date: Fri, 14 Oct 2016 20:57:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Peter Maydell writes:

> On 14 October 2016 at 10:21, 凌英剑 <address@hidden> wrote:
>> I've been trying to get GVA when the memory access instruction is
>> executed,so I traced a function tcg_qemu_tb_exec() and I found the address
>> used by ld/st operations is HVA.
>> I would like to know how can I transform HVA to GVA?
>> if I record GVA during the TB translation,will I miss some memory access
>> instruction traces since a TB only be translated once but may be executed
>> several times?

> At translation time the GVA is unknown (consider the case of
> "load value from the address in this register" -- the load
> address is not known until runtime because it depends on the
> value in the register when the TB is executed.

If you wnt to get the addresses at *execution* time, you can use the tracing
event guest_mem_before:

* Remove the "disable" property for "guest_mem_before" from the trace-events
  file.

* Recompile QEMU.

* Tell QEMU to generate traces for the event "guest_mem_before_exec" (see file
  "docs/tracing.txt" for more information).


Cheers,
  Lluis



reply via email to

[Prev in Thread] Current Thread [Next in Thread]