On 28/10/26 05:30, Portia Stephens wrote:
Most devices on the RCPU memmap are not modeled yet in QEMU. Back the
entire 4G memory view of the RCPU by a low priority unimplemented
device. This prevents accesses to non-modeled device from faulting.
Signed-off-by: Portia Stephens <[email protected]>
---
hw/riscv/Kconfig | 1 +
hw/riscv/tt_atlantis.c | 20 ++++++++++++++++++++
include/hw/riscv/tt_atlantis.h | 6 ++++++
3 files changed, 27 insertions(+)
diff --git a/hw/riscv/tt_atlantis.c b/hw/riscv/tt_atlantis.c
index edf2180a98..66cbb2b8cf 100644
--- a/hw/riscv/tt_atlantis.c
+++ b/hw/riscv/tt_atlantis.c
@@ -519,6 +519,17 @@ static void load_fdt(TTAtlantisState *ams)
create_fdt_memory(ms->fdt, ac->memmap, ms->ram_size);
}
+static void mmio_map_unimplemented(MemoryRegion *memory, SysBusDevice *dev,
+ const char *name, hwaddr addr, uint64_t
size)
+{
+ qdev_prop_set_string(DEVICE(dev), "name", name);
+ qdev_prop_set_uint64(DEVICE(dev), "size", size);
+ sysbus_realize(dev, &error_abort);
+
+ memory_region_add_subregion_overlap(memory, addr,
+ sysbus_mmio_get_region(dev, 0), -1000);
+}
Please use create_unimplemented_devices() (see commit 782dbd23fd10).