[PATCH v3] accel/tcg: Restrict IOMMU declarations

Philippe Mathieu-Daudé posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260616153633.93267-1-philmd@oss.qualcomm.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@mailo.com>
include/accel/tcg/iommu.h | 7 +++++++
include/exec/cpu-common.h | 3 ---
accel/tcg/cpu-exec.c      | 4 +++-
3 files changed, 10 insertions(+), 4 deletions(-)
[PATCH v3] accel/tcg: Restrict IOMMU declarations
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
Move the two TCG-specific IOMMU method declarations from the
generic "exec/cpu-common.h" header to "accel/tcg/iommu.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 include/accel/tcg/iommu.h | 7 +++++++
 include/exec/cpu-common.h | 3 ---
 accel/tcg/cpu-exec.c      | 4 +++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/accel/tcg/iommu.h b/include/accel/tcg/iommu.h
index 547f8ea0ef0..a4032a292e5 100644
--- a/include/accel/tcg/iommu.h
+++ b/include/accel/tcg/iommu.h
@@ -7,6 +7,10 @@
 #ifndef ACCEL_TCG_IOMMU_H
 #define ACCEL_TCG_IOMMU_H
 
+#ifndef CONFIG_TCG
+#error Can only include this header with TCG
+#endif
+
 #ifdef CONFIG_USER_ONLY
 #error Cannot include accel/tcg/iommu.h from user emulation
 #endif
@@ -14,6 +18,9 @@
 #include "exec/hwaddr.h"
 #include "exec/memattrs.h"
 
+void tcg_iommu_init_notifier_list(CPUState *cpu);
+void tcg_iommu_free_notifier_list(CPUState *cpu);
+
 MemoryRegionSection *address_space_translate_for_iotlb(CPUState *cpu,
                                                        int asidx,
                                                        hwaddr addr,
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 24e3eb500bb..6fe821b9a1d 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -35,9 +35,6 @@ unsigned int cpu_list_generation_id_get(void);
 
 int cpu_get_free_index(void);
 
-void tcg_iommu_init_notifier_list(CPUState *cpu);
-void tcg_iommu_free_notifier_list(CPUState *cpu);
-
 /**
  * cpu_address_space_init:
  * @cpu: CPU to add this address space to
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index ad94f96b252..7292ff15060 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -26,7 +26,6 @@
 #include "accel/tcg/helper-retaddr.h"
 #include "trace.h"
 #include "disas/disas.h"
-#include "exec/cpu-common.h"
 #include "exec/cpu-interrupt.h"
 #include "exec/page-protection.h"
 #include "exec/mmap-lock.h"
@@ -46,6 +45,9 @@
 #include "tb-context.h"
 #include "tb-internal.h"
 #include "internal-common.h"
+#if !defined(CONFIG_USER_ONLY)
+#include "accel/tcg/iommu.h"
+#endif
 
 /* -icount align implementation. */
 
-- 
2.53.0


Re: [PATCH v3] accel/tcg: Restrict IOMMU declarations
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
On 16/6/26 17:36, Philippe Mathieu-Daudé wrote:
> Move the two TCG-specific IOMMU method declarations from the
> generic "exec/cpu-common.h" header to "accel/tcg/iommu.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>   include/accel/tcg/iommu.h | 7 +++++++
>   include/exec/cpu-common.h | 3 ---
>   accel/tcg/cpu-exec.c      | 4 +++-
>   3 files changed, 10 insertions(+), 4 deletions(-)

Queued, thanks.


Re: [PATCH v3] accel/tcg: Restrict IOMMU declarations
Posted by Richard Henderson 1 month, 1 week ago
On 6/16/26 08:36, Philippe Mathieu-Daudé wrote:
> Move the two TCG-specific IOMMU method declarations from the
> generic "exec/cpu-common.h" header to "accel/tcg/iommu.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@oss.qualcomm.com>
> ---
>   include/accel/tcg/iommu.h | 7 +++++++
>   include/exec/cpu-common.h | 3 ---
>   accel/tcg/cpu-exec.c      | 4 +++-
>   3 files changed, 10 insertions(+), 4 deletions(-)

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

r~