qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] hw/riscv/virt.c: memmap usage cleanup
@ 2025-04-23 11:06 Daniel Henrique Barboza
  2025-04-23 11:06 ` [PATCH 1/9] hw/riscv/virt.c: enforce s->memmap use in machine_init() Daniel Henrique Barboza
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Daniel Henrique Barboza @ 2025-04-23 11:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, alistair.francis, liwei1518, zhiwei_liu, palmer,
	Daniel Henrique Barboza

I had this on my backlog and decided to get it out of the way.

We have a lot of 'memmap' uses in virt that aren't made via s->memmap.
In fact most of the accesses are done via the static array virt_memmap
directly. Some fdt functions are using it via an extra argument, which
is unneeded since we can access it directly or via s->memmap.

This current state of affairs will hurt us in the long run when we
decide to version the 'virt' board. We might have multiple memmaps for
each version and then we'll have to deal with all these static
references to a specific memmap.  Using s->memmap right now will make
our lives easier in the future.

Aside from a couple of patches the changes are rather trivial. Patch 9
is a change I decided to make after noticing the amount of 'long' casts
we have when formating a fdt string.


Patches based on alistair/riscv-to-apply.next.

Daniel Henrique Barboza (9):
  hw/riscv/virt.c: enforce s->memmap use in machine_init()
  hw/riscv/virt.c: remove trivial virt_memmap references
  hw/riscv/virt.c: use s->memmap in virt_machine_done()
  hw/riscv/virt.c: add 'base' arg in create_fw_cfg()
  hw/riscv/virt.c: use s->memmap in create_fdt() path
  hw/riscv/virt.c: use s->memmap in create_fdt_sockets() path
  hw/riscv/virt.c: use s->memmap in create_fdt_virtio()
  hw/riscv/virt.c: use s->memmap in finalize_fdt() functions
  hw/riscv/virt.c: remove 'long' casts in fmt strings

 hw/riscv/virt.c | 269 +++++++++++++++++++++++++-----------------------
 1 file changed, 138 insertions(+), 131 deletions(-)

-- 
2.49.0



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2025-04-30 11:29 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 11:06 [PATCH 0/9] hw/riscv/virt.c: memmap usage cleanup Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 1/9] hw/riscv/virt.c: enforce s->memmap use in machine_init() Daniel Henrique Barboza
2025-04-24  9:51   ` Joel Stanley
2025-04-25 11:52     ` Daniel Henrique Barboza
2025-04-29  5:25       ` Joel Stanley
2025-04-29 10:27         ` Conor Dooley
2025-04-24 10:39   ` Alistair Francis
2025-04-23 11:06 ` [PATCH 2/9] hw/riscv/virt.c: remove trivial virt_memmap references Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 3/9] hw/riscv/virt.c: use s->memmap in virt_machine_done() Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 4/9] hw/riscv/virt.c: add 'base' arg in create_fw_cfg() Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 5/9] hw/riscv/virt.c: use s->memmap in create_fdt() path Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 6/9] hw/riscv/virt.c: use s->memmap in create_fdt_sockets() path Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 7/9] hw/riscv/virt.c: use s->memmap in create_fdt_virtio() Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 8/9] hw/riscv/virt.c: use s->memmap in finalize_fdt() functions Daniel Henrique Barboza
2025-04-23 11:06 ` [PATCH 9/9] hw/riscv/virt.c: remove 'long' casts in fmt strings Daniel Henrique Barboza
2025-04-23 11:26   ` Philippe Mathieu-Daudé
2025-04-24  9:41   ` Joel Stanley
2025-04-25 12:33     ` Daniel Henrique Barboza
2025-04-29  5:26       ` Joel Stanley
2025-04-29 12:40     ` Daniel Henrique Barboza
2025-04-29 17:11       ` Daniel Henrique Barboza
2025-04-30 11:28         ` Joel Stanley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).