All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>,
	Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Michael S. Tsirkin <mst@redhat.com>,
	philmd@linaro.org
Subject: [PATCH 0/6] Implement memory_region_new_* functions
Date: Tue, 23 Dec 2025 22:49:55 +0100 (CET)	[thread overview]
Message-ID: <cover.1766525089.git.balaton@eik.bme.hu> (raw)

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



             reply	other threads:[~2025-12-23 21:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 21:49 BALATON Zoltan [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1766525089.git.balaton@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=mst@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.