qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* plugin interface function qemu_plugin_mem_size_shift
@ 2020-01-22  0:03 Robert Henry
  2020-04-03 18:55 ` Alex Bennée
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Henry @ 2020-01-22  0:03 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 947 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: plugin interface function qemu_plugin_mem_size_shift
  2020-01-22  0:03 plugin interface function qemu_plugin_mem_size_shift Robert Henry
@ 2020-04-03 18:55 ` Alex Bennée
  2020-04-04  0:15   ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Bennée @ 2020-04-03 18:55 UTC (permalink / raw)
  To: Robert Henry; +Cc: qemu-devel


Robert Henry <robhenry@microsoft.com> 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 <alex.bennee@linaro.org>

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: plugin interface function qemu_plugin_mem_size_shift
  2020-04-03 18:55 ` Alex Bennée
@ 2020-04-04  0:15   ` Richard Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2020-04-04  0:15 UTC (permalink / raw)
  To: Alex Bennée, Robert Henry; +Cc: qemu-devel

On 4/3/20 11:55 AM, Alex Bennée wrote:
> + * The size_shift is the scale of access, e.g. << 3 is a 64 bit wide
> + * access.

Maybe better as "e.g. 1 << 3 is an 8-byte access."?


r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-04  0:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22  0:03 plugin interface function qemu_plugin_mem_size_shift Robert Henry
2020-04-03 18:55 ` Alex Bennée
2020-04-04  0:15   ` Richard Henderson

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).