On 1/12/24 01:23, Pierrick Bouvier wrote:
Extends API with three new functions:
qemu_plugin_register_vcpu_{tb, insn, mem}_exec_inline_per_vcpu().

Compared to non per_vcpu versions, ptr is now a base, and current
cpu_index and an offset are used to compute memory location on which
operation happens (ptr + cpu_index * offset).

This allows to have a thread-safe version of inline operations.

Having a flexible offset is useful in case a user wants to target a
memory location embedded into a struct. In this case, the offset between
two memory locations will be bigger than sizeof(uint64_t).

Signed-off-by: Pierrick Bouvier<pierrick.bouv...@linaro.org>
---
  include/qemu/qemu-plugin.h   | 56 +++++++++++++++++++++++++++++++++++-
  plugins/api.c                | 36 ++++++++++++++++++++---
  plugins/qemu-plugins.symbols |  3 ++
  3 files changed, 90 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to