physmem: Restrict TCG IOTLB code to TCG accel

Restrict iotlb_to_section(), address_space_translate_for_iotlb()
and memory_region_section_get_iotlb() to TCG. Declare them in
the new "accel/tcg/iommu.h" header. Declare iotlb_to_section()
using the MemoryRegionSection typedef.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250424202412.91612-12-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2025-04-24 22:24:10 +02:00 committed by Richard Henderson
parent 1381ea53a8
commit f12b717717
5 changed files with 48 additions and 27 deletions

View file

@ -29,6 +29,7 @@
#ifdef CONFIG_TCG
#include "accel/tcg/cpu-ops.h"
#include "accel/tcg/iommu.h"
#endif /* CONFIG_TCG */
#include "exec/exec-all.h"
@ -587,6 +588,8 @@ MemoryRegion *flatview_translate(FlatView *fv, hwaddr addr, hwaddr *xlat,
return mr;
}
#ifdef CONFIG_TCG
typedef struct TCGIOMMUNotifier {
IOMMUNotifier n;
MemoryRegion *mr;
@ -771,6 +774,8 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu,
return section - d->map.sections;
}
#endif /* CONFIG_TCG */
void cpu_address_space_init(CPUState *cpu, int asidx,
const char *prefix, MemoryRegion *mr)
{