From: "Cédric Le Goater" <clg@redhat.com>
To: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Cédric Le Goater" <clg@kaod.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Jamin Lin" <jamin_lin@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Eric Auger" <eric.auger@redhat.com>,
"Helge Deller" <deller@gmx.de>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Aleksandar Rikalo" <arikalo@gmail.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Ninad Palsule" <ninad@linux.ibm.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Jason Wang" <jasowang@redhat.com>, "Yi Liu" <yi.l.liu@intel.com>,
"Clément Mathieu--Drif" <clement.mathieu--drif@eviden.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Aditya Gupta" <adityag@linux.ibm.com>,
"Gautam Menghani" <gautam@linux.ibm.com>,
"Song Gao" <gaosong@loongson.cn>,
"Bibo Mao" <maobibo@loongson.cn>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Jonathan Cameron" <jonathan.cameron@huawei.com>,
"Fan Ni" <fan.ni@samsung.com>,
"David Hildenbrand" <david@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Xiao Guangrong" <xiaoguangrong.eric@gmail.com>,
"Beniamino Galvani" <b.galvani@gmail.com>,
"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
"Jan Kiszka" <jan.kiszka@web.de>,
"Laurent Vivier" <laurent@vivier.eu>,
"Andrey Smirnov" <andrew.smirnov@gmail.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"Bernhard Beschow" <shentey@gmail.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
"Jagannathan Raman" <jag.raman@oracle.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Weiwei Li" <liwei1518@gmail.com>,
"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Thomas Huth" <thuth@redhat.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Fam Zheng" <fam@euphon.net>, "Bin Meng" <bmeng.cn@gmail.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Peter Xu" <peterx@redhat.com>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
qemu-s390x@nongnu.org, qemu-block@nongnu.org,
kvm@vger.kernel.org,
"Alex Williamson" <alex.williamson@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Alistair Francis" <alistair.francis@wdc.com>
Subject: Re: [PATCH 00/35] memory: QOM-ify AddressSpace
Date: Thu, 18 Sep 2025 14:39:49 +0200 [thread overview]
Message-ID: <a06a989d-b685-4e62-be06-d96fb91ed6ea@redhat.com> (raw)
In-Reply-To: <20250917-qom-v1-0-7262db7b0a84@rsg.ci.i.u-tokyo.ac.jp>
Hello Akihiko,
On 9/17/25 14:56, Akihiko Odaki wrote:
> Based-on: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp>
> ("[PATCH 00/14] Fix memory region use-after-finalization")
>
> Make AddressSpaces QOM objects to ensure that they are destroyed when
> their owners are finalized and also to get a unique path for debugging
> output.
>
> Suggested by BALATON Zoltan:
> https://lore.kernel.org/qemu-devel/cd21698f-db77-eb75-6966-d559fdcab835@eik.bme.hu/
>
> Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
I wonder if this is going to fix an issue I was seeing a while ago
in the FSI models. I couldn't find a clean way to avoid corrupting
memory because of how the address_space was created and later on
destroyed. See below,
Thanks,
C.
from hw/fsi/ :
typedef struct OPBus {
BusState bus;
MemoryRegion mr;
AddressSpace as;
} OPBus;
typedef struct AspeedAPB2OPBState {
...
OPBus opb[ASPEED_FSI_NUM];
...
}
static void fsi_aspeed_apb2opb_realize(DeviceState *dev, Error **errp)
{
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
AspeedAPB2OPBState *s = ASPEED_APB2OPB(dev);
int i;
/*
* TODO: The OPBus model initializes the OPB address space in
* the .instance_init handler and this is problematic for test
* device-introspect-test. To avoid a memory corruption and a QEMU
* crash, qbus_init() should be called from realize(). Something to
* improve. Possibly, OPBus could also be removed.
*/
for (i = 0; i < ASPEED_FSI_NUM; i++) {
qbus_init(&s->opb[i], sizeof(s->opb[i]), TYPE_OP_BUS, DEVICE(s),
NULL);
}
....
static void fsi_opb_init(Object *o)
{
OPBus *opb = OP_BUS(o);
memory_region_init(&opb->mr, 0, TYPE_FSI_OPB, UINT32_MAX);
address_space_init(&opb->as, &opb->mr, TYPE_FSI_OPB);
}
next prev parent reply other threads:[~2025-09-18 12:39 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 12:56 [PATCH 00/35] memory: QOM-ify AddressSpace Akihiko Odaki
2025-09-17 12:56 ` [PATCH 01/35] " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 02/35] hw/core/loader: Use address_space_get_path() Akihiko Odaki
2025-09-17 12:56 ` [PATCH 03/35] vfio: " Akihiko Odaki
2025-09-18 9:52 ` Cédric Le Goater
2025-09-17 12:56 ` [PATCH 04/35] hw/alpha: QOM-ify AddressSpace Akihiko Odaki
2025-09-17 12:56 ` [PATCH 05/35] hw/arm: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 06/35] hw/display: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 07/35] hw/dma: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 08/35] hw/fsi: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 09/35] hw/i2c: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 10/35] hw/i386: " Akihiko Odaki
2025-09-18 5:53 ` CLEMENT MATHIEU--DRIF
2025-09-18 12:16 ` Akihiko Odaki
2025-09-17 12:56 ` [PATCH 11/35] hw/intc: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 12/35] hw/loongarch: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 13/35] hw/mem: " Akihiko Odaki
2025-09-17 13:24 ` Jonathan Cameron
2025-09-17 12:56 ` [PATCH 14/35] hw/misc: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 15/35] hw/net: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 16/35] hw/nubus: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 17/35] hw/pci: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 18/35] hw/pci-host: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 19/35] hw/ppc: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 20/35] hw/remote: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 21/35] hw/riscv: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 22/35] hw/s390x: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 23/35] hw/scsi: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 24/35] hw/sd: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 25/35] hw/sparc: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 26/35] hw/sparc64: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 27/35] hw/ssi: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 28/35] hw/usb: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 29/35] " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 30/35] hw/virtio: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 31/35] system/physmem: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 32/35] target/i386: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 33/35] target/mips: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 34/35] target/xtensa: " Akihiko Odaki
2025-09-17 12:56 ` [PATCH 35/35] memory: Drop non-QOM AddressSpace support Akihiko Odaki
2025-09-18 12:39 ` Cédric Le Goater [this message]
2025-09-18 12:47 ` [PATCH 00/35] memory: QOM-ify AddressSpace Akihiko Odaki
2025-09-29 20:58 ` Peter Xu
2025-09-30 8:06 ` Cédric Le Goater
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=a06a989d-b685-4e62-be06-d96fb91ed6ea@redhat.com \
--to=clg@redhat.com \
--cc=adityag@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=alistair@alistair23.me \
--cc=andrew.smirnov@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=arikalo@gmail.com \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=b.galvani@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=bmeng.cn@gmail.com \
--cc=borntraeger@linux.ibm.com \
--cc=clement.mathieu--drif@eviden.com \
--cc=clg@kaod.org \
--cc=david@redhat.com \
--cc=dbarboza@ventanamicro.com \
--cc=deller@gmx.de \
--cc=edgar.iglesias@gmail.com \
--cc=eduardo@habkost.net \
--cc=elena.ufimtseva@oracle.com \
--cc=eric.auger@redhat.com \
--cc=fam@euphon.net \
--cc=fan.ni@samsung.com \
--cc=farman@linux.ibm.com \
--cc=gaosong@loongson.cn \
--cc=gautam@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=hpoussin@reactos.org \
--cc=iii@linux.ibm.com \
--cc=imammedo@redhat.com \
--cc=jag.raman@oracle.com \
--cc=jamin_lin@aspeedtech.com \
--cc=jan.kiszka@web.de \
--cc=jasowang@redhat.com \
--cc=jcmvbkbc@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=joel@jms.id.au \
--cc=jonathan.cameron@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=laurent@vivier.eu \
--cc=leetroy@gmail.com \
--cc=liwei1518@gmail.com \
--cc=maobibo@loongson.cn \
--cc=marcel.apfelbaum@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mjrosato@linux.ibm.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=ninad@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=palmer@dabbelt.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sgarzare@redhat.com \
--cc=shentey@gmail.com \
--cc=steven_lee@aspeedtech.com \
--cc=strahinja.p.jankovic@gmail.com \
--cc=sundeep.lkml@gmail.com \
--cc=thuth@redhat.com \
--cc=xiaoguangrong.eric@gmail.com \
--cc=yi.l.liu@intel.com \
--cc=zhiwei_liu@linux.alibaba.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox