qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH-for-9.1 07/12] plugins/api: Check for USER_ONLY definition instea


From: Philippe Mathieu-Daudé
Subject: [PATCH-for-9.1 07/12] plugins/api: Check for USER_ONLY definition instead of SOFTMMU one
Date: Wed, 13 Mar 2024 22:33:34 +0100

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

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) {
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]