qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] plugins: add tb convenience functions
@ 2025-01-31 21:07 Luke Craig
  2025-01-31 21:07 ` [PATCH v3 1/3] plugin: extend API with qemu_plugin_tb_get_insn_by_vaddr Luke Craig
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luke Craig @ 2025-01-31 21:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Alexandre Iooss, Pierrick Bouvier,
	Mahmoud Mandour, Luke Craig

This PR extends the plugin API with two functions which allow convenient access
around tbs.

The first, qemu_plugin_tb_size, provides a mechanism for determining the total
size of a translation block.

The second, qemu_plugin_tb_get_insn_by_vaddr, allows users to get a reference
to an instruction by its virtual address rather than just its index.

In response to feedback from Pierrick I have updated the implementation of
qemu_plugin_tb_size.

Additionally, I have added these functions to the insn.c test plugin in
response to Alex's feedback.

Lastly, I'll provide a reply to Alex's feeback (repeated below):

> But the general comment is this is an example of tying the plugin API
> too deeply with the internals of the translator. Why does a plugin need
> to know what is an implementation detail?

Finding the line between implementation detail and relevant to plugins is
challenging, but I submitted this change because I found myself implementing
these functions in plugins. If you'd like for me to enumerate examples where
knowing the tb_size is relevant to analysis I'd be happy to submit some.

The change relevant from v2 and v3 is adding a sign off on the commits (thank you Perrick).

Luke Craig (3):
  plugin: extend API with qemu_plugin_tb_get_insn_by_vaddr
  plugin: extend API with qemu_plugin_tb_size
  plugins: extend insn test for new convenience functions

 include/qemu/qemu-plugin.h | 21 +++++++++++++++++++++
 plugins/api.c              | 20 ++++++++++++++++++++
 tests/tcg/plugins/insn.c   | 10 ++++++++++
 3 files changed, 51 insertions(+)

-- 
2.34.1



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

end of thread, other threads:[~2025-02-01  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-31 21:07 [PATCH v3 0/3] plugins: add tb convenience functions Luke Craig
2025-01-31 21:07 ` [PATCH v3 1/3] plugin: extend API with qemu_plugin_tb_get_insn_by_vaddr Luke Craig
2025-01-31 21:07 ` [PATCH v3 2/3] plugin: extend API with qemu_plugin_tb_size Luke Craig
2025-01-31 21:07 ` [PATCH v3 3/3] plugins: extend insn test for new convenience functions Luke Craig
2025-02-01  7:24 ` [PATCH v3 0/3] plugins: add tb " Philippe Mathieu-Daudé

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