qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 01/13] plugins: change signature of qemu_plugin_insn_haddr


From: Richard Henderson
Subject: Re: [PATCH 01/13] plugins: change signature of qemu_plugin_insn_haddr
Date: Tue, 17 Dec 2024 08:41:48 -0600
User-agent: Mozilla Thunderbird

On 12/16/24 19:06, Pierrick Bouvier wrote:
It makes more sense to return the same type than qemu_plugin_insn_vaddr.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
  include/qemu/qemu-plugin.h |  2 +-
  plugins/api.c              | 12 ++++++------
  2 files changed, 7 insertions(+), 7 deletions(-)

No, it does not.

qemu_plugin_insn_vaddr is returning a guest virtual address.
qemu_plugin_insn_haddr is returning a host address.

I'm not sure why we decided that returning a host pointer was a good idea. Probably it was the easiest thing to retrieve from softmmu.

One could argue that we should be returning something else, the only question 
is what.

Perhaps guest physical address, which wasn't possible before, but which is now stored within CPUTLBEntryFull. Interpreting this requires you to know the physical address space to which it applies. In the case of Arm, the address space varies depending on Secure vs Non-Secure state.

Perhaps ram_addr_t, which is *not* a guest physical address because it is not associated with any address space. It is more of a globally unique token with which a RAMBlock may be found. It's how we stitch together address spaces under the hood. The plugin would have to treat it as an opaque unique identifier.

But if we're going to return a host address, then void* is the correct type.


r~



reply via email to

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