[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/59] physmem: Move TCG IOTLB methods around
From: |
Richard Henderson |
Subject: |
[PULL 20/59] physmem: Move TCG IOTLB methods around |
Date: |
Thu, 1 May 2025 14:20:34 -0700 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
The next commit will restrict TCG specific code in physmem.c
using some #ifdef'ry. In order to keep it simple, move
iotlb_to_section() and memory_region_section_get_iotlb()
around close together.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250424202412.91612-11-philmd@linaro.org>
---
system/physmem.c | 50 ++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/system/physmem.c b/system/physmem.c
index 637f2d8532..ccbeae241c 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -746,6 +746,31 @@ translate_fail:
return &d->map.sections[PHYS_SECTION_UNASSIGNED];
}
+MemoryRegionSection *iotlb_to_section(CPUState *cpu,
+ hwaddr index, MemTxAttrs attrs)
+{
+ int asidx = cpu_asidx_from_attrs(cpu, attrs);
+ CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx];
+ AddressSpaceDispatch *d = cpuas->memory_dispatch;
+ int section_index = index & ~TARGET_PAGE_MASK;
+ MemoryRegionSection *ret;
+
+ assert(section_index < d->map.sections_nb);
+ ret = d->map.sections + section_index;
+ assert(ret->mr);
+ assert(ret->mr->ops);
+
+ return ret;
+}
+
+/* Called from RCU critical section */
+hwaddr memory_region_section_get_iotlb(CPUState *cpu,
+ MemoryRegionSection *section)
+{
+ AddressSpaceDispatch *d = flatview_to_dispatch(section->fv);
+ return section - d->map.sections;
+}
+
void cpu_address_space_init(CPUState *cpu, int asidx,
const char *prefix, MemoryRegion *mr)
{
@@ -1002,14 +1027,6 @@ bool
cpu_physical_memory_snapshot_get_dirty(DirtyBitmapSnapshot *snap,
return false;
}
-/* Called from RCU critical section */
-hwaddr memory_region_section_get_iotlb(CPUState *cpu,
- MemoryRegionSection *section)
-{
- AddressSpaceDispatch *d = flatview_to_dispatch(section->fv);
- return section - d->map.sections;
-}
-
static int subpage_register(subpage_t *mmio, uint32_t start, uint32_t end,
uint16_t section);
static subpage_t *subpage_init(FlatView *fv, hwaddr base);
@@ -2669,23 +2686,6 @@ static uint16_t dummy_section(PhysPageMap *map, FlatView
*fv, MemoryRegion *mr)
return phys_section_add(map, §ion);
}
-MemoryRegionSection *iotlb_to_section(CPUState *cpu,
- hwaddr index, MemTxAttrs attrs)
-{
- int asidx = cpu_asidx_from_attrs(cpu, attrs);
- CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx];
- AddressSpaceDispatch *d = cpuas->memory_dispatch;
- int section_index = index & ~TARGET_PAGE_MASK;
- MemoryRegionSection *ret;
-
- assert(section_index < d->map.sections_nb);
- ret = d->map.sections + section_index;
- assert(ret->mr);
- assert(ret->mr->ops);
-
- return ret;
-}
-
static void io_mem_init(void)
{
memory_region_init_io(&io_mem_unassigned, NULL, &unassigned_mem_ops, NULL,
--
2.43.0
- [PULL 21/59] physmem: Restrict TCG IOTLB code to TCG accel, (continued)
- [PULL 21/59] physmem: Restrict TCG IOTLB code to TCG accel, Richard Henderson, 2025/05/01
- [PULL 24/59] accel/tcg: Generalize fake_user_interrupt test, Richard Henderson, 2025/05/01
- [PULL 11/59] accel/tcg: Reduce scope of tb_phys_invalidate, tb_set_jmp_target, Richard Henderson, 2025/05/01
- [PULL 09/59] accel/tcg: Simplify L1_MAP_ADDR_SPACE_BITS, Richard Henderson, 2025/05/01
- [PULL 15/59] include/exec: Move tb_invalidate_phys_range to translation-block.h, Richard Henderson, 2025/05/01
- [PULL 16/59] accel/tcg: Compile tb-maint.c twice, Richard Henderson, 2025/05/01
- [PULL 18/59] target/riscv: Include missing 'accel/tcg/getpc.h' in csr.c, Richard Henderson, 2025/05/01
- [PULL 23/59] include: Remove 'exec/exec-all.h', Richard Henderson, 2025/05/01
- [PULL 30/59] target/arm: Unexport assert_hflags_rebuild_correctly, Richard Henderson, 2025/05/01
- [PULL 13/59] accel/tcg: Use vaddr in user/page-protection.h, Richard Henderson, 2025/05/01
- [PULL 20/59] physmem: Move TCG IOTLB methods around,
Richard Henderson <=
- [PULL 14/59] include/exec: Include missing headers in exec-all.h, Richard Henderson, 2025/05/01
- [PULL 27/59] target/i386: Split out x86_cpu_exec_reset, Richard Henderson, 2025/05/01
- [PULL 29/59] target/arm: Move cpu_get_tb_cpu_state to hflags.c, Richard Henderson, 2025/05/01
- [PULL 28/59] accel/tcg: Hoist cpu_get_tb_cpu_state decl to accl/tcg/cpu-ops.h, Richard Henderson, 2025/05/01
- [PULL 33/59] accel/tcg: Move cpu_get_tb_cpu_state to TCGCPUOps, Richard Henderson, 2025/05/01
- [PULL 17/59] accel/tcg: Remove #error for non-tcg in getpc.h, Richard Henderson, 2025/05/01
- [PULL 34/59] accel/tcg: Pass TCGTBCPUState to tb_lookup, Richard Henderson, 2025/05/01
- [PULL 35/59] accel/tcg: Pass TCGTBCPUState to tb_htable_lookup, Richard Henderson, 2025/05/01
- [PULL 36/59] accel/tcg: Use TCGTBCPUState in struct tb_desc, Richard Henderson, 2025/05/01
- [PULL 39/59] accel/tcg: Compile cpu-exec.c twice, Richard Henderson, 2025/05/01