[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 00/15] hw: expand DEFINE_MACHINE to explicit TypeInfo registration
- To: Daniel P. Berrangé <berrange@xxxxxxxxxx>
- From: Yonggang Luo <luoyonggang@xxxxxxxxx>
- Date: Thu, 5 Nov 2026 19:29:08 +0800
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=N6YNeSVq516in4se9KIqzFq1rO/6YIHrrr7AeykheZo=; fh=WO+2NvSEfXFY/eK2blaRfchrtrM7RA095bDLGwZkWeI=; b=hqsa/zoaVEgf46aCLsSe9akzYmgbK4uGy0rg3riDQyXwlNRQwtvyvH2EgLHHmiKxMz dvjphsu6kbb4SYdpHwIzcmwgpkzNz53LOQ84kp47fjkOQdzp868HFFK7wv9xyQOW99CJ LJ/EiS74KY72o/JhgNFqeaoM4msx62Ygq+tSGlXI72rkVMJ06YuuN8G46OR/OHng2i3/ u+B34FBp+vgRaizk/mrlIqAcGXRjhsToJnlsY+lINXRYVSYvKh99xeys8RbsWj1u5Y5+ P6XIU+6EAuc0bk37VzAdo15KoF9gFNOtEaVWj597qWXLvYrE70MbnWbVJnxr0y1u1xAM Iq2w==; darn=lists.xenproject.org
- Arc-seal: i=1; a=rsa-sha256; t=1793878162; cv=none; d=google.com; s=arc-20260327; b=aVjy1k97os2aY/yIcJuafNPb+8r11ZSs5/qVTl2P2NSOZDAS6N+srF99ZqDM0sMhpj lm1PGjCiD0MS44N8RvSVBA7SVvZ8r2K+jHymwlihv0hA54H89Msv7HCGiAoiiEVkwQcg BBocrS9A9e7NDrwR8FlDqHeaEykgnuWzC/IyhS8Y93W8gOlKXY3ZfRAjum1bM9fgBVSZ nojFSpyyvOaVNjp/NK/NZSi6n6MVhVrVTV9J2Jfnft8ZEZGF03L+mpP84cQNST0Wpbqy X4uTqB/nOPbhwRnYg8J/ZN5VcWlDaRdwC+mwqWzwBHdPq46QYAWITVz5UDLSGlH0GYZc h8Pw==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20260707 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:Reply-To:In-Reply-To:References:MIME-Version"
- Cc: Pierrick Bouvier <pierrick.bouvier@xxxxxxxxxxxxxxxx>, BALATON Zoltan <balaton@xxxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Felipe Balbi <balbi@xxxxxxxxxx>, Aleksandar Rikalo <arikalo@xxxxxxxxx>, Philippe Mathieu-Daude <philmd@xxxxxxxxx>, Antony Pavlov <antonynpavlov@xxxxxxxxx>, Daniel Henrique Barboza <daniel.barboza@xxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Subbaraya Sundeep <sundeep.lkml@xxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Niek Linnenbank <nieklinnenbank@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "qemu-riscv@xxxxxxxxxx" <qemu-riscv@xxxxxxxxxx>, Jean-Christophe Dubois <jcd@xxxxxxxxxxxxxxx>, "qemu-ppc@xxxxxxxxxx" <qemu-ppc@xxxxxxxxxx>, Alexandre Iooss <erdnaxe@xxxxxxxxx>, Weiwei Li <liwei1518@xxxxxxxxx>, Zhao Liu <zhao1.liu@xxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Strahinja Jankovic <strahinja.p.jankovic@xxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxxxxxxxx>, Thomas Huth <th.huth+qemu@xxxxxxxxx>, Clément Chigot <chigot@xxxxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Yoshinori Sato <yoshinori.sato@xxxxxxxxx>, Frederic Konrad <konrad.frederic@xxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Chao Liu <chao.liu@xxxxxxxxxxxxxxxxxx>, Sai Pavan Boddu <sai.pavan.boddu@xxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Gaurav Sharma <gaurav.sharma_7@xxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, "qemu-arm@xxxxxxxxxx" <qemu-arm@xxxxxxxxxx>
- Delivery-date: Thu, 05 Nov 2026 11:29:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thursday, November 5, 2026, Daniel P. Berrangé <berrange@xxxxxxxxxx> wrote:
>
> On Thu, Nov 05, 2026 at 12:27:18AM -0800, Pierrick Bouvier wrote:
> > On 11/3/2026 5:55 AM, Daniel P. Berrangé wrote:
> > > On Tue, Nov 03, 2026 at 09:48:44PM +0800, Yonggang Luo wrote:
> > >> On Tue, Nov 3, 2026 at 9:23 PM BALATON Zoltan <balaton@xxxxxxxxxx> wrote:
> > >>>
> > >>> On Tue, 3 Nov 2026, Yonggang Luo wrote:
> > >>> That means exposing all the boiler plate for all machines other than the
> > >>> simplest case. I think it would be better to keep
> > >>> DEFINE_MACHINE_EXTENDED
> > >>> but maybe rethink the existing wrappers and drop unused ones and maybe
> > >>> add
> > >>> new ones that reduce the usage of DEFINE_MACHINE_EXTENDED but still keep
> > >>> the boiler plate hidden.
> > >>
> > >> Thanks, I'll go this way, remove unused macros, and keep
> > >> DEFINE_MACHINE_EXTENDED
> > >> and extend both DEFINE_MACHINE_EXTENDED DEFINE_MACHINE supports
> > >> "targets" or "arch_mask" parameter.
> > >
> > > Given that we don't need to do general per-arch type filtering in
> > > QOM, we could just move 'is_available' out of TypeInfo, and into the
> > > MachineClass, so it is a regular class level property, which can be
> > > set in the class_init methods, and thus avoid any changes to the
> > > DEFINE_MACHINE macros.
> > >
> >
> > Some cpus need it also, and it's used for filtering purpose at this time
> > (to avoid duplication at registration). We already depend on this behavior.
>
> Can you give me more info on the problem with the CPUs ? What cases
> have duplicate class names with CPUs ?
Hi, please take a look at this
https://lore.kernel.org/qemu-devel/20261031164009.2048-1-luoyonggang@xxxxxxxxx/
Also the single-binary RISC-V patches also faced the same issues,
trying to access
the target_info() in class_init that can be also avoided by this idea,
the bucket TypeImpl .
The patches is at:
https://lore.kernel.org/qemu-riscv/20260916-hw-riscv-cpu-int-v4-0-babc367b60f5@xxxxxx/
The riscv machine need choose different cpu machine according to the
target in class_init ,
specifically
https://lore.kernel.org/qemu-riscv/20260916-hw-riscv-cpu-int-v4-1-babc367b60f5@xxxxxx/
https://lore.kernel.org/qemu-riscv/20260916-hw-riscv-cpu-int-v4-7-babc367b60f5@xxxxxx/
By the introduction of TypeBucket idea, these all can be resolved. and
we have no need to rename
The QOM typename at all.
>
> With regards,
> Daniel
> --
> |: https://berrange.com ~~ https://hachyderm.io/@berrange :|
> |: https://libvirt.org ~~ https://entangle-photo.org :|
> |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
>
|