All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: "Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
	"Yonggang Luo" <luoyonggang@gmail.com>,
	qemu-devel@nongnu.org, "Xianglai Li" <lixianglai@loongson.cn>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Chinmay Rath" <rathc@linux.ibm.com>,
	"Sunil V L" <sunilvl@ventanamicro.com>,
	qemu-riscv@nongnu.org, "Alexander Bulekov" <alxndr@bu.edu>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Chao Liu" <chao.liu@processmission.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Song Gao" <17746591750@163.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Glenn Miles" <milesg@linux.ibm.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	qemu-s390x@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"David Hildenbrand" <david@kernel.org>,
	qemu-ppc@nongnu.org, qemu-arm@nongnu.org,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Aleksandar Rikalo" <arikalo@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Darren Kenny" <darren.kenny@oracle.com>
Subject: Re: [PATCH 00/12] single-binary: link ARM and RISC-V into qemu-system
Date: Thu, 27 Aug 2026 10:58:29 +0100	[thread overview]
Message-ID: <apAKRZtz9xsB1U9s@redhat.com> (raw)
In-Reply-To: <7f865144-dc5e-4eaa-9704-8cb3cc6a1158@oss.qualcomm.com>

On Wed, Aug 26, 2026 at 05:41:30PM -0300, Daniel Henrique Barboza wrote:
> 
> 
> On 8/26/2026 10:40 AM, Mark Cave-Ayland wrote:
> > On 26/08/2026 13:32, Daniel P. Berrangé wrote:
> > 
> > > On Sun, Aug 23, 2026 at 11:07:18PM +0800, Yonggang Luo wrote:
> > > 
> > > snip,
> > > 
> > > ..to comment just on the end result for now..
> > > 
> > > > The last patch builds qemu-system (and qemu-systemw on Windows) from
> > > > aarch64 common/system objects plus RISC-V arch objects, and installs
> > > > qemu-system-{arm,aarch64,riscv32,riscv64} as symlinks so argv[0] still
> > > > selects TargetInfo.
> > > > 
> > > > Examples:
> > > > 
> > > >    qemu-system -target aarch64 -M virt ...
> > > >    qemu-system-riscv64 -M virt ...
> > > > 
> > > > A basename that matches no registered token falls through to the unique
> > > > default. A combined binary with no suffix requires -target when more
> > > > than one default TargetInfo is registered.
> > > 
> > > In testing and comparing  the new qemu-system-riscv64 symlink
> > > to qemu-system vs the current standalone qemu-system-riscv64
> > > binary there are some significant user visible changes.
> > > 
> > > The simplest is 'qom-list-types' went from reporting approx
> > > 770 classes, to reporting approx 1530 classes. IOW, the
> > > qemu-system-riscv64 binary is now reporting supporting for
> > > all the classes that were unique to arm.
> > > 
> > > The '-device help' output similarly shows a great many more
> > > devices
> > > 
> > > TL;DR introspecting qemu-system-riscv64 is no longer accurate
> > > wrt riscv64 capabilities.
> > > 
> > > This is not suprising, since we register all TypeInfo meaning
> > > we get all QOM classes present. Some of Pierricks patches try
> > > to filter places which iterate over classes, but this does not
> > > have full coverage.
> > > 
> > > 
> > > I think this is probably also what leads to the increased RAM
> > > usage in qemu-system-riscv64. Starting
> > > 
> > >    qemu-system-riscv64 -nodefaults -display none -M none
> > > 
> > > shows an increase in RAM usage from  17.3 to 20.7 MB which
> > > is about 15% increase. NB this is dirty, private RAM per
> > > process. The shared RAM pages also increase but that's not
> > > a concern since they're common to all QEMU processes.
> > > 
> > > qemu-system-aarch64 shows a much smaller RAM increase, since
> > > it only grew from 1430 classes to 1530 classes.
> > > 
> > > We have many more target though, so if we assume the end
> > > point where every single target is unified, the the union
> > > of all classes for all targets comes to approx 3600.
> > > 
> > > My guesstimate is that would mean a memory increase for
> > > qemu-system-riscv64 from 17.3 to 39.9 MB, which is a
> > > 72% increase.
> > > 
> > > In absolute terms this is still modest, but for deployments
> > > with large VM counts  and small RAM sizes, that gets to be
> > > significant.
> > > 
> > > 
> > > None of this means single binary is a bad idea.
> > > 
> > > 
> > > My main takeaway is that we're creating uneccessary work
> > > for ourselves by trying to make 'qemu-sytem' identical
> > > in behaviour to qemu-system-$TARGET.
> > > 
> > > The complex filtering patches / QOM interfaces that I
> > > found uncomfortable in Pierrick's base series are largely
> > > around the filtering needed to simulate qemu-system-$TARGET,
> > > and they're still incomplete. I don't have high confidence
> > > in our ability to avoid regressions if we go route this
> > > route.
> > > 
> > > 
> > > IMHO we should make a clean break with the past. Leave
> > > the existing qemu-system-$TARGET binaries being built
> > > from the same pieces they are today, such that there
> > > is better confidence that we are not making behavioural
> > > changes to them.
> > > 
> > > 
> > > qemu-system should be built alongside qemu-system-$TARGET
> > > and offer new semantics where it is documented as exposing
> > > everything from all targets whenever introspected and does
> > > not apply target type or target Kconfig filtering to inputs/
> > > outputs.
> > > 
> > > We still get the benefit of only building most  .o files
> > > once, so keeping qemu-system-$TARGET is only a small
> > > overhead in the final step of linking everything together.
> > > 
> > > 
> > > qemu-system will still have the increased memory overhead
> > > but that's fine as qemu-system-$TARGET will be unaffected.
> > > We can tackle the memory overhead of qemu-system at our
> > > leisure through use of loadable modules, and thus not have
> > > that as a task to think about today.
> > > 
> > > 
> > > With the clean break with the past, we also have the
> > > ability to tackle various long standing design mistakes
> > > present in qemu-system-$TARGET instead of carrying them
> > > over into the new binary.
> > > 
> > > Specifically
> > > 
> > >   * -nodefaults should become the default
> > >   * All CLI args should be processed in order from
> > >     the command line, so we eliminate the nonsense
> > >     where we process some -object, then -chardev,
> > >     then more -object through hand crafted deps
> > > 
> > >   * No default machine type
> > 
> > I would even go as far as to suggest that we should make modules mandatory for qemu-system, so that devices can be loaded upon demand during machine construction to help keep the size down.
> > 
> > I'll leave whether that is through dependency tracking or via an explicit load directive for someone else to decide :)
> > >   * Drop all legacy syntax so we only have a single
> > >     QAPI based way of configuring.
> > >     eg drop -hda, -hdb, -cdrom, -drive, etc
> > >        only keeping -blockdev
> > >     eg drop -mon, -monitor, -qmp, etc only
> > >        keeping -object
> > 
> > The only problem with this is that I often get a lot of complaints that QEMU command lines are complicated from retro folks who just want to run their favourite old games. Why would they want to come up with a long-winded -drive command line when they can just use -hda instead?
> > 
> > > We don't have to do all that straightaway. If we declare
> > > qemu-system "experimental" initially we can iterate on
> > > that intentionally breaking compat in releases, without
> > > any impact on qemu-system-$TARGET.
> > > 
> > > Avoiding the back compat task will give us more flexibility
> > > with the follow on work when people come to create new
> > > machine types with heterogenous CPU targets.
> > I agree that this is a good opportunity to explore new things without being tied to past decisions.
> 
> To be fair I don't think Phil and Pierrick are basing their design solely
> on "we must comply to what qemu-system-$target does and has".  From what I
> understood they're trying to get the prototype out of the door to prove that
> it works, i.e. "this is clearest and most viable path we're seeing to make it
> happen". This would naturally adhere to what is already available because,
> well, it's already a proven base to build on top of.

In looking at these patches my impression is introducing "qemu-system"
as its own thing is simpler than trying to make 'qemu-system' be able
to replace & simulate qemu-system-$target, which this does.

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 :|



  reply	other threads:[~2026-08-27  9:59 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23 15:07 [PATCH 00/12] single-binary: link ARM and RISC-V into qemu-system Yonggang Luo
2026-08-23 15:07 ` [PATCH 01/12] accel: use a shared TYPE_ACCEL_CPU parent Yonggang Luo
2026-08-23 15:07 ` [PATCH 02/12] hw/riscv/virt: use unique QOM name and target filter Yonggang Luo
2026-08-23 15:07 ` [PATCH 03/12] hw/arm/virt: " Yonggang Luo
2026-08-26 12:49   ` Daniel P. Berrangé
2026-08-23 15:07 ` [PATCH 04/12] hw/arm/virt: prefix ACPI helpers with arm_virt_ Yonggang Luo
2026-08-24  7:18   ` Philippe Mathieu-Daudé
2026-08-23 15:07 ` [PATCH 05/12] hw/riscv/virt: prefix ACPI helpers with riscv_virt_ Yonggang Luo
2026-08-24  7:19   ` Philippe Mathieu-Daudé
2026-08-23 15:07 ` [PATCH 06/12] hw/loongarch/virt: prefix ACPI helper with loongarch_virt_ Yonggang Luo
2026-08-24  1:00   ` gaosong
2026-08-24  7:20   ` Philippe Mathieu-Daudé
2026-08-23 15:07 ` [PATCH 07/12] target/riscv: uniquify TCG crc32, crc32c, and wfi helper names Yonggang Luo
2026-08-24  7:22   ` Philippe Mathieu-Daudé
2026-08-23 15:07 ` [PATCH 08/12] target/riscv: seed cfg.big_endian from TargetInfo Yonggang Luo
2026-08-26 18:37   ` Philippe Mathieu-Daudé
2026-08-23 15:07 ` [PATCH 09/12] target-info: register le and be TargetInfo variants Yonggang Luo
2026-08-24 16:22   ` Pierrick Bouvier
2026-08-24 19:01     ` Yonggang Luo
2026-08-26 18:41       ` Philippe Mathieu-Daudé
2026-08-23 15:07 ` [PATCH 10/12] target-info: add -target and program-name selection Yonggang Luo
2026-08-24 16:24   ` Pierrick Bouvier
2026-08-26 12:46   ` Daniel P. Berrangé
2026-08-26 18:13     ` Pierrick Bouvier
2026-08-27 10:13       ` Daniel P. Berrangé
2026-08-27 12:25     ` Daniel P. Berrangé
2026-08-23 15:07 ` [PATCH 11/12] target-info: dispatch CPU QMP, dump, and Angel semihosting Yonggang Luo
2026-08-23 15:07 ` [PATCH 12/12] meson: link ARM and RISC-V into qemu-system Yonggang Luo
2026-08-24 16:20   ` Pierrick Bouvier
2026-08-24 19:04     ` Yonggang Luo
2026-08-26 13:00     ` Daniel P. Berrangé
2026-08-26 17:40       ` Pierrick Bouvier
2026-08-26 18:05         ` Philippe Mathieu-Daudé
2026-08-26 18:08           ` Yonggang Luo
2026-08-24 16:36 ` [PATCH 00/12] single-binary: " Pierrick Bouvier
2026-08-25 15:42 ` Daniel P. Berrangé
2026-08-25 16:55   ` Yonggang Luo
2026-08-25 17:22     ` Daniel P. Berrangé
2026-08-25 17:11   ` Yonggang Luo
2026-08-26 12:32 ` Daniel P. Berrangé
2026-08-26 13:40   ` Mark Cave-Ayland
2026-08-26 13:58     ` Daniel P. Berrangé
2026-08-26 14:50     ` Yonggang Luo
2026-08-26 20:41     ` Daniel Henrique Barboza
2026-08-27  9:58       ` Daniel P. Berrangé [this message]
2026-08-26 18:35   ` Pierrick Bouvier
2026-08-26 18:53     ` Pierrick Bouvier
2026-08-27  9:44     ` Daniel P. Berrangé
2026-08-27 16:32       ` Pierrick Bouvier
2026-08-27 17:42         ` Peter Maydell
2026-08-27 17:48         ` Paolo Bonzini
2026-08-27 19:58           ` Pierrick Bouvier
2026-09-04 12:47             ` Paolo Bonzini
2026-09-14  5:46               ` Pierrick Bouvier
2026-08-27 10:22     ` Daniel P. Berrangé
2026-08-27 17:59   ` Paolo Bonzini
2026-08-28  5:44     ` Yonggang Luo

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=apAKRZtz9xsB1U9s@redhat.com \
    --to=berrange@redhat.com \
    --cc=17746591750@163.com \
    --cc=alex.bennee@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=alxndr@bu.edu \
    --cc=anisinha@redhat.com \
    --cc=arikalo@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=chao.liu@processmission.com \
    --cc=cohuck@redhat.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=darren.kenny@oracle.com \
    --cc=david@kernel.org \
    --cc=farman@linux.ibm.com \
    --cc=farosas@suse.de \
    --cc=harshpb@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=imammedo@redhat.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=liwei1518@gmail.com \
    --cc=lixianglai@loongson.cn \
    --cc=luoyonggang@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=maobibo@loongson.cn \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=milesg@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@mailo.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    --cc=sunilvl@ventanamicro.com \
    --cc=zhao1.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 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.