accel/tcg: Restrict IOMMU declarations
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> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260616153633.93267-1-philmd@oss.qualcomm.com>
Philippe Mathieu-Daudé committed
Jun 11, 2026 at 20:23 UTC
ffbc5b17a297ca7bf84fd376ce34db811944c5ad
3 files changed
+10
-4
accel/tcg/cpu-exec.c
+3
-1
@@ -26,7 +26,6 @@
26
#include "accel/tcg/helper-retaddr.h"
27
#include "trace.h"
28
#include "disas/disas.h"
29
-#include "exec/cpu-common.h"
29
#include "exec/cpu-interrupt.h"
30
#include "exec/page-protection.h"
31
#include "exec/mmap-lock.h"
@@ -46,6 +45,9 @@
45
#include "tb-context.h"
46
#include "tb-internal.h"
47
#include "internal-common.h"
48
+#if !defined(CONFIG_USER_ONLY)
49
+#include "accel/tcg/iommu.h"
50
+#endif
51
52
/* -icount align implementation. */
53
include/accel/tcg/iommu.h
+7
@@ -7,6 +7,10 @@
7
#ifndef ACCEL_TCG_IOMMU_H
8
#define ACCEL_TCG_IOMMU_H
9
10
+#ifndef CONFIG_TCG
11
+#error Can only include this header with TCG
12
+#endif
13
+
14
#ifdef CONFIG_USER_ONLY
15
#error Cannot include accel/tcg/iommu.h from user emulation
16
#endif
@@ -14,6 +18,9 @@
18
#include "exec/hwaddr.h"
19
#include "exec/memattrs.h"
20
21
+void tcg_iommu_init_notifier_list(CPUState *cpu);
22
+void tcg_iommu_free_notifier_list(CPUState *cpu);
23
+
24
MemoryRegionSection *address_space_translate_for_iotlb(CPUState *cpu,
25
int asidx,
26
hwaddr addr,
include/exec/cpu-common.h
-3
@@ -34,9 +34,6 @@ unsigned int cpu_list_generation_id_get(void);
34
35
int cpu_get_free_index(void);
36
37
-void tcg_iommu_init_notifier_list(CPUState *cpu);
38
-void tcg_iommu_free_notifier_list(CPUState *cpu);
39
-
37
/**
38
* cpu_address_space_init:
39
* @cpu: CPU to add this address space to