All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Implement memory_region_new_* functions
@ 2025-12-23 21:49 BALATON Zoltan
  2025-12-23 21:49 ` [PATCH 1/6] memory: Add internal memory_region_set_ops helper function BALATON Zoltan
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: BALATON Zoltan @ 2025-12-23 21:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Xu, Akihiko Odaki, Paolo Bonzini, Michael S. Tsirkin,
	philmd

Our documentation says that memory regions are automatically freed
when the owner dies and the reference counting to do this is also
implemented. However this relies on the QOM free funtion that can only
be set by creating objects with object_new but memory API only
provides constructors that call object_initialize which clears the
free function that prevents QOM to manage the memory region lifetime.
Implement corresponding memory_region_new_* functions that do the same
as the memory_region_init_* functions but create the memory region
with object_new so the lifetime can be automatically managed by QOM as
documented.

BALATON Zoltan (6):
  memory: Add internal memory_region_set_ops helper function
  memory: Factor out common ram region initialization
  memory: Factor out more common ram region initialization
  memory: Shorten memory_region_init_rom_nomigrate
  memory: Add internal memory_region_register_ram function
  memory: Add memory_region_new* functions

 include/system/memory.h | 360 ++++++++++++++++++++++++++++++
 system/memory.c         | 484 +++++++++++++++++++++++++---------------
 2 files changed, 668 insertions(+), 176 deletions(-)

-- 
2.41.3



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

end of thread, other threads:[~2026-01-25 20:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-23 21:49 [PATCH 0/6] Implement memory_region_new_* functions BALATON Zoltan
2025-12-23 21:49 ` [PATCH 1/6] memory: Add internal memory_region_set_ops helper function BALATON Zoltan
2025-12-23 21:49 ` [PATCH 2/6] memory: Factor out common ram region initialization BALATON Zoltan
2025-12-24 15:33   ` Peter Xu
2026-01-25 20:19     ` BALATON Zoltan
2025-12-23 21:49 ` [PATCH 3/6] memory: Factor out more " BALATON Zoltan
2025-12-26 11:31   ` Philippe Mathieu-Daudé
2025-12-23 21:50 ` [PATCH 4/6] memory: Shorten memory_region_init_rom_nomigrate BALATON Zoltan
2025-12-23 21:50 ` [PATCH 5/6] memory: Add internal memory_region_register_ram function BALATON Zoltan
2025-12-26 11:32   ` Philippe Mathieu-Daudé
2025-12-23 21:50 ` [PATCH 6/6] memory: Add memory_region_new* functions BALATON Zoltan
2025-12-24  5:21 ` [PATCH 0/6] Implement memory_region_new_* functions Akihiko Odaki
2025-12-24 13:47   ` BALATON Zoltan
2025-12-24 15:36     ` Peter Xu
2025-12-25  5:22     ` Akihiko Odaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.