qemu/hw/riscv
Daniel Henrique Barboza 221e96cb7a hw/riscv/virt.c: enforce s->memmap use in machine_init()
Throughout the code we're accessing the board memmap, most of the time,
by accessing it statically via 'virt_memmap'. This static map is also
assigned in the machine state in s->memmap.

We're also passing it as a variable to some fdt functions, which is
unorthodox since we can spare a function argument by accessing it
statically or via the machine state.

All the current forms are valid but not all of the are scalable. In the
future we will version this board, and then all this code will need
rework because it should point to the updated memmap. In this case,
we'll want to assign the adequate versioned memmap once during init,
in s->memmap like it is being done today, and the rest of the code
will access the updated map via s->memmap.

We're also enforcing the pattern of using s->memmap instead of assigning
it to a temp variable 'memmap'. Code is copy/pasted around all the time
and being consistent is important.

We'll start these rather mechanical changes with virt_machine_init().

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Message-ID: <20250429125811.224803-2-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2025-05-19 13:42:56 +10:00
..
boot.c hw: Centralize handling of -machine dumpdtb option 2025-02-24 15:03:42 +00:00
Kconfig hw/riscv: Add Microblaze V generic board 2024-12-20 11:22:47 +10:00
meson.build hw/riscv/riscv-iommu: add riscv-iommu-hpm file 2025-03-04 15:42:54 +10:00
microblaze-v-generic.c include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
microchip_pfsoc.c hw/riscv: Configurable MPFS CLINT timebase freq 2025-05-19 13:30:24 +10:00
numa.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
opentitan.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
riscv-iommu-bits.h hw/riscv/riscv-iommu: Fix process directory table walk 2025-03-19 16:35:58 +10:00
riscv-iommu-hpm.c hw/riscv: add IOMMU HPM trace events 2025-03-04 15:42:54 +10:00
riscv-iommu-hpm.h hw/riscv/riscv-iommu: add hpm events mmio write 2025-03-04 15:42:54 +10:00
riscv-iommu-pci.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
riscv-iommu-sys.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
riscv-iommu.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
riscv-iommu.h hw/riscv/riscv-iommu: add hpm events mmio write 2025-03-04 15:42:54 +10:00
riscv_hart.c target/riscv: Pass ra to riscv_csrrw 2025-05-19 13:39:29 +10:00
shakti_c.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sifive_e.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sifive_u.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spike.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
trace-events hw/riscv: add IOMMU HPM trace events 2025-03-04 15:42:54 +10:00
trace.h hw/riscv: add RISC-V IOMMU base emulation 2024-10-31 13:51:24 +10:00
virt-acpi-build.c hw/riscv/virt-acpi-build: Add support for RIMT 2025-05-19 11:08:34 +10:00
virt.c hw/riscv/virt.c: enforce s->memmap use in machine_init() 2025-05-19 13:42:56 +10:00