diff mbox series

[PATCH-for-9.1,07/12] plugins/api: Check for USER_ONLY definition instead of SOFTMMU one

Message ID 20240313213339.82071-8-philmd@linaro.org
State New
Headers show
Series accel/tcg: Finish replacing SOFTMMU -> SYSTEM | expand

Commit Message

Philippe Mathieu-Daudé March 13, 2024, 9:33 p.m. UTC
Since we *might* have user emulation with softmmu,
replace the system emulation check by !user emulation one.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 plugins/api.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Richard Henderson March 15, 2024, 9:19 p.m. UTC | #1
On 3/13/24 11:33, Philippe Mathieu-Daudé wrote:
> Since we*might*  have user emulation with softmmu,
> replace the system emulation check by !user emulation one.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   plugins/api.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)

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

r~
diff mbox series

Patch

diff --git a/plugins/api.c b/plugins/api.c
index 8fa5a600ac..06d3e95da2 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -294,14 +294,14 @@  bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info)
  * Virtual Memory queries
  */
 
-#ifdef CONFIG_SOFTMMU
+#ifndef CONFIG_USER_ONLY
 static __thread struct qemu_plugin_hwaddr hwaddr_info;
 #endif
 
 struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info,
                                                   uint64_t vaddr)
 {
-#ifdef CONFIG_SOFTMMU
+#ifndef CONFIG_USER_ONLY
     CPUState *cpu = current_cpu;
     unsigned int mmu_idx = get_mmuidx(info);
     enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info);
@@ -323,7 +323,7 @@  struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info,
 
 bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr)
 {
-#ifdef CONFIG_SOFTMMU
+#ifndef CONFIG_USER_ONLY
     return haddr->is_io;
 #else
     return false;
@@ -332,7 +332,7 @@  bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr)
 
 uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr)
 {
-#ifdef CONFIG_SOFTMMU
+#ifndef CONFIG_USER_ONLY
     if (haddr) {
         return haddr->phys_addr;
     }
@@ -342,7 +342,7 @@  uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr)
 
 const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h)
 {
-#ifdef CONFIG_SOFTMMU
+#ifndef CONFIG_USER_ONLY
     if (h && h->is_io) {
         MemoryRegion *mr = h->mr;
         if (!mr->name) {