qemu/hw
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
..
9pfs 9pfs: fix 'total_open_fd' decrementation 2025-05-05 11:28:29 +02:00
acpi trivial patches for 2025-05-09 2025-05-12 11:11:27 -04:00
adc qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
alpha qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
arm hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
audio hw/audio/cs4231a: fix assertion error in isa_bus_get_irq 2025-05-12 17:48:32 +02:00
avr qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
block vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
char vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
core target-arm queue: 2025-05-15 13:42:21 -04:00
cpu qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
cxl hw/cxl/cxl-mailbox-utils: CXL CCI Get/Set alert config commands 2025-05-14 05:39:14 -04:00
display virtio,pci,pc: fixes, features 2025-05-15 13:41:56 -04:00
dma hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
fsi qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
gpio hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
hppa qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
hyperv hw/hyperv/hyperv: common compilation unit 2025-05-08 14:22:12 +02:00
i2c hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
i386 hw/i386/amd_iommu: Allow migration when explicitly create the AMDVI-PCI device 2025-05-14 07:45:58 -04:00
ide qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
input vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
intc hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
ipack qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
ipmi qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
isa hw/isa/ich9: Remove stray empty comment 2025-05-09 23:49:26 +03:00
loongarch hw/loongarch/boot: Adjust the loading position of the initrd 2025-05-14 15:57:23 +08:00
m68k qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
mem hw/cxl/cxl-mailbox-utils: CXL CCI Get/Set alert config commands 2025-05-14 05:39:14 -04:00
microblaze hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time 2025-04-25 17:09:58 +02:00
mips hw/mips: Evaluate TARGET_BIG_ENDIAN at compile time 2025-04-25 17:09:58 +02:00
misc hw/misc: Add MPFS system reset support 2025-05-19 13:30:24 +10:00
net virtio,pci,pc: fixes, features 2025-05-15 13:41:56 -04:00
nubus qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
nvme hw/nvme: fix nvme hotplugging 2025-05-15 12:18:06 +02:00
nvram qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
openrisc qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pci virtio,pci,pc: fixes, features 2025-05-15 13:41:56 -04:00
pci-bridge qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pci-host trivial patches for 2025-05-09 2025-05-12 11:11:27 -04:00
ppc include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
remote qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
riscv hw/riscv/virt.c: enforce s->memmap use in machine_init() 2025-05-19 13:42:56 +10:00
rtc hw/rtc/mc146818rtc: Drop pre-v3 migration stream support 2025-04-30 20:44:20 +02:00
rx qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390x s390x: Fix leak in machine_set_loadparm 2025-05-14 06:58:59 +02:00
scsi vhost-scsi: support VIRTIO_SCSI_F_HOTPLUG 2025-05-14 05:39:15 -04:00
sd qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
sensor qom: Constify TypeInfo::class_data 2025-04-25 17:00:41 +02:00
sh4 include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
smbios ipmi: add fwinfo to pci ipmi devices 2025-04-11 10:50:42 -05:00
sparc qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sparc64 qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
ssi hw/ssi/aspeed_smc: Allow 64-bit wide flash accesses 2025-05-05 09:38:55 +02:00
timer hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
tpm qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
tricore qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
uefi qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ufs qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
usb hw/usb/hcd-xhci: Unmap canceled packet 2025-04-25 17:00:42 +02:00
vfio system/runstate: add VM state change cb with return value 2025-05-14 05:39:14 -04:00
virtio virtio: Move virtio_reset() 2025-05-14 05:39:15 -04:00
vmapple qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
watchdog qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
xen trivial patches for 2025-05-09 2025-05-12 11:11:27 -04:00
xenpv hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
xtensa qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
Kconfig Misc HW patches 2025-03-05 21:54:58 +08:00
meson.build Misc HW patches 2025-03-05 21:54:58 +08:00