diff mbox series

[15/25] plugins/api: use qemu_target_page_mask() to get value

Message ID 20250226140343.3907080-16-alex.bennee@linaro.org
State New
Headers show
Series maintainer updates for 10.0 softfreeze (gpu/tcg tests, plugins, MAINTAINERS) | expand

Commit Message

Alex Bennée Feb. 26, 2025, 2:03 p.m. UTC
Requiring TARGET_PAGE_MASK to be defined gets in the way of building
this unit once. qemu_target_page_mask() will tell us what it is.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250225110844.3296991-2-alex.bennee@linaro.org>

---
v2
  - use the proper qemu_target_page_mask() api
---
 plugins/api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Richard Henderson Feb. 26, 2025, 5:27 p.m. UTC | #1
On 2/26/25 06:03, Alex Bennée wrote:
> Requiring TARGET_PAGE_MASK to be defined gets in the way of building
> this unit once. qemu_target_page_mask() will tell us what it is.
> 
> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
> Message-Id:<20250225110844.3296991-2-alex.bennee@linaro.org>
> 
> ---
> v2
>    - use the proper qemu_target_page_mask() api
> ---
>   plugins/api.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

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

r~
diff mbox series

Patch

diff --git a/plugins/api.c b/plugins/api.c
index cf8cdf076a..fa4d495277 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -43,6 +43,7 @@ 
 #include "tcg/tcg.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
+#include "exec/target_page.h"
 #include "exec/translation-block.h"
 #include "exec/translator.h"
 #include "disas/disas.h"
@@ -287,7 +288,7 @@  uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn)
 void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn)
 {
     const DisasContextBase *db = tcg_ctx->plugin_db;
-    vaddr page0_last = db->pc_first | ~TARGET_PAGE_MASK;
+    vaddr page0_last = db->pc_first | ~qemu_target_page_mask();
 
     if (db->fake_insn) {
         return NULL;