qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alexandre Iooss" <erdnaxe@crans.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v5 0/7] plugins: access values during a memory read/write
Date: Sat, 6 Jul 2024 12:13:55 -0700	[thread overview]
Message-ID: <5e01abc8-50dc-4601-9df9-cb74c02a22ec@linaro.org> (raw)
In-Reply-To: <20240705003421.750895-1-pierrick.bouvier@linaro.org>

Posted v6.

On 7/4/24 17:34, Pierrick Bouvier wrote:
> This series allows plugins to know which value is read/written during a memory
> access.
> 
> For every memory access, we know copy this value before calling mem callbacks,
> and those can query it using new API function:
> - qemu_plugin_mem_get_value
> 
> Mem plugin was extended to print accesses, and a new test was added to check
> functionality work as expected. A bug was found where callbacks were not
> called as expected.
> 
> This will open new use cases for plugins, such as following specific values in
> memory.
> 
> v5
> - fixed width output for mem values in mem plugin
> - move plugin_mem_value to CPUNegativeOffset
> - tcg/tcg-op-ldst.c: only store word size mem access (do not set upper bits)
> 
> v4
> - fix prototype for stubs qemu_plugin_vcpu_mem_cb (inverted low/high parameters
>    names)
> - link gitlab bugs resolved (thanks @Anton Kochkov for reporting)
>    https://gitlab.com/qemu-project/qemu/-/issues/1719
>    https://gitlab.com/qemu-project/qemu/-/issues/2152
> 
> v3
> - simplify API: return an algebraic data type for value accessed
>    this can be easily extended when QEMU will support wider accesses
> - fix Makefile test (use quiet-command instead of manually run the command)
> - rename upper/lower to high/low
> - reorder functions parameters and code to low/high instead of high/low, to
>    follow current convention in QEMU codebase
> 
> v2
> - fix compilation on aarch64 (missing undef in accel/tcg/atomic_template.h)
> 
> v3
> - add info when printing memory accesses (insn_vaddr,mem_vaddr,mem_hwaddr)
> 
> Pierrick Bouvier (7):
>    plugins: fix mem callback array size
>    plugins: save value during memory accesses
>    plugins: extend API to get latest memory value accessed
>    tests/tcg: add mechanism to run specific tests with plugins
>    tests/tcg: allow to check output of plugins
>    tests/plugin/mem: add option to print memory accesses
>    tests/tcg/x86_64: add test for plugin memory access
> 
>   accel/tcg/atomic_template.h                 | 66 +++++++++++++--
>   include/hw/core/cpu.h                       |  4 +
>   include/qemu/plugin.h                       |  4 +
>   include/qemu/qemu-plugin.h                  | 32 ++++++++
>   accel/tcg/plugin-gen.c                      |  3 +-
>   plugins/api.c                               | 33 ++++++++
>   plugins/core.c                              |  6 ++
>   tcg/tcg-op-ldst.c                           | 66 +++++++++++++--
>   tests/plugin/mem.c                          | 69 +++++++++++++++-
>   tests/tcg/x86_64/test-plugin-mem-access.c   | 89 +++++++++++++++++++++
>   accel/tcg/atomic_common.c.inc               | 13 ++-
>   accel/tcg/ldst_common.c.inc                 | 38 +++++----
>   plugins/qemu-plugins.symbols                |  1 +
>   tests/tcg/Makefile.target                   | 10 ++-
>   tests/tcg/x86_64/Makefile.target            |  7 ++
>   tests/tcg/x86_64/check-plugin-mem-access.sh | 48 +++++++++++
>   16 files changed, 455 insertions(+), 34 deletions(-)
>   create mode 100644 tests/tcg/x86_64/test-plugin-mem-access.c
>   create mode 100755 tests/tcg/x86_64/check-plugin-mem-access.sh
> 


      parent reply	other threads:[~2024-07-06 19:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  0:34 [PATCH v5 0/7] plugins: access values during a memory read/write Pierrick Bouvier
2024-07-05  0:34 ` [PATCH v5 1/7] plugins: fix mem callback array size Pierrick Bouvier
2024-07-05  0:34 ` [PATCH v5 2/7] plugins: save value during memory accesses Pierrick Bouvier
2024-07-05 16:34   ` Richard Henderson
2024-07-06 19:04     ` Pierrick Bouvier
2024-07-05  0:34 ` [PATCH v5 3/7] plugins: extend API to get latest memory value accessed Pierrick Bouvier
2024-07-05  1:54   ` Xingtao Yao (Fujitsu) via
2024-07-05  0:34 ` [PATCH v5 4/7] tests/tcg: add mechanism to run specific tests with plugins Pierrick Bouvier
2024-07-05  0:34 ` [PATCH v5 5/7] tests/tcg: allow to check output of plugins Pierrick Bouvier
2024-07-05  0:34 ` [PATCH v5 6/7] tests/plugin/mem: add option to print memory accesses Pierrick Bouvier
2024-07-05  1:46   ` Xingtao Yao (Fujitsu) via
2024-07-05  0:34 ` [PATCH v5 7/7] tests/tcg/x86_64: add test for plugin memory access Pierrick Bouvier
2024-07-06 19:13 ` Pierrick Bouvier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5e01abc8-50dc-4601-9df9-cb74c02a22ec@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=eduardo@habkost.net \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=wangyanan55@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).