qemu-devel
[Top][All Lists]
Advanced

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

Re: plugin interface function qemu_plugin_mem_size_shift


From: Alex Bennée
Subject: Re: plugin interface function qemu_plugin_mem_size_shift
Date: Fri, 03 Apr 2020 19:55:46 +0100
User-agent: mu4e 1.3.10; emacs 28.0.50

Robert Henry <address@hidden> writes:

> I don't understand what
>   unsigned int qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info);
> does.   The documentation in qemu-plugin.h is silent on this matter.
>   It appears to expose more of the guts of qemu that I don't yet know.

It's the size as a power of 2, so:

0 = byte
1 = 16 bit
2 = 32 bit
3 = 64 bit
4 = 128 bit

and so on. Currently I think our largest memory accesses are around 256
bytes but we can go larger is required.

How about:

--8<---------------cut here---------------start------------->8---
plugins: document the meaning of size_shift

We describe memory accesses in powers of 2.

Signed-off-by: Alex Bennée <address@hidden>

1 file changed, 3 insertions(+)
include/qemu/qemu-plugin.h | 3 +++

modified   include/qemu/qemu-plugin.h
@@ -301,6 +301,9 @@ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn 
*insn);
  * The anonymous qemu_plugin_meminfo_t and qemu_plugin_hwaddr types
  * can be used in queries to QEMU to get more information about a
  * given memory access.
+ *
+ * The size_shift is the scale of access, e.g. << 3 is a 64 bit wide
+ * access.
  */
 typedef uint32_t qemu_plugin_meminfo_t;
 struct qemu_plugin_hwaddr;
--8<---------------cut here---------------end--------------->8---


-- 
Alex Bennée



reply via email to

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