From: BALATON Zoltan <balaton@eik.bme.hu>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [RFC PATCH 04/18] qemu: Introduce 'qemu/legacy_binary_info.h'
Date: Thu, 6 Mar 2025 14:45:52 +0100 (CET) [thread overview]
Message-ID: <c6953b69-a54d-6d42-343e-dae07266306f@eik.bme.hu> (raw)
In-Reply-To: <Z8mMhjwiYCY7Pq4H@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 4105 bytes --]
On Thu, 6 Mar 2025, Daniel P. Berrangé wrote:
> On Thu, Mar 06, 2025 at 12:34:13PM +0100, Paolo Bonzini wrote:
>> Il gio 6 mar 2025, 10:27 Philippe Mathieu-Daudé <philmd@linaro.org> ha
>> scritto:
>>
>>> This API is to allow refactoring code for heterogeneous emulation,
>>> without changing user-facing behavior of current qemu-system binaries,
>>> which I now consider as 'legacy'.
>>>
>>> Once all current restrictions removed, the new qemu-system-heterogeneous
>>> binary is expected to run any combination of targets.
>>>
>>> qemu-system-$target will be a call to qemu-system-heterogeneous with
>>> a restricted subset, possibly in the form of:
>>>
>>> $ qemu-system-heterogeneous --target aarch64-softmmu
>>>
>>
>> Or just qemu-system I guess.
>>
>> ^ equivalent of today's qemu-system-aarch64
>>>
>>> If you don't like 'qemu_legacy_binary_' prefix, I can use
>>> 'qemu_single_binary_' instead.
>>>
>>
>> Still there is a problem with renaming binaries (both the "qemu-kvm" case
>> and the good/bad case that Richard pointed out).
>
> We could special case the '-kvm' suffix, because by its nature it
> implies the current binary build target.
>
>>
>> I think you should try creating two versions of system/arch_init.c, so that
>> it has a separate implementation for heterogeneous vs. single-target
>> binaries. Then you can keep separate linking steps for single-target
>> binaries and you naturally get the right target info from either the
>> target-specific arch_init-single.c, or the --target option for
>> arch_init-multi.c.
>>
>> (Is --target even necessary? As long as you have a way disambiguate
>> same-named machines like -M virt, and have no default machine in the
>> multi-target binary, you shouldn't need it).
>
> If we did 'query-machines' on qemu-system-heterogeneous, it would
> return all machines from all targets. To disambiguate naming there
> are various options
>
> * The query-machines command would have to gain a new 'target'
> field and we would have to document that uniqness is across
> the tuple (name, target), not merely name. That's a semantic
> change.
>
> We would still need a way to express the 'target' when asking
> to instantiate a machine
>
> * The query-machines command would have to gain a new 'target'
> paramter so callers can restrict the data they receive back
>
> We would still need a way to express the 'target' when asking
> to instantiate a machine
>
> * Rename all machine types so they are '<target>-<machine>'
> The query-machines command doesn't change. Apps would have
> to "parse" the machine name to see what 'target' each is
> associated with, or we include an explicit 'target' field
> in the returned data. Instianting a machine would not need
> changing
I think -machine m68k:virt could work, -M help would list machines like:
arm:raspi
i386:pc
etc.
Management apps could easily find : to separate arch but those that don't
care about arch would just work and list more possible machines. Some
machines like pc or mac99 that may appear differently in different single
arch binary might need to get resolved first. Maybe need a way to search
machine list by pattern e.g. as -machine x86_64:help.
I tend to agree with Peter that if a multi binary qemu-system-arm would be
able to also create the 64 bit machines that's not a problem as long as
all the 32 bit machines still work the same. This would just make
qemu-system-arm and qemu-system-aarch64 the same or maybe you can set the
search pattern from command name so qemu-system-arm -M help would be the
same as qemu-system -M arm:help.
Allowing renaming binaries and still keep single arch behaviour probably
needs to keep a way to build single arch binaries so you can't convert
everything to runtime check and drop #ifdefs.
Regards,
BALATON Zoltan
> * Require --target CLI arg, meaning query-machines remains
> unchanged, as does instantiating machines
>
> Any other options ?
>
> The last is the simplest option if we just make --target be defaulted
> based on the binary name.
>
> With regards,
> Daniel
>
next prev parent reply other threads:[~2025-03-06 13:46 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 15:39 [RFC PATCH 00/18] hw/microblaze: Quick single binary proof of concept Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 01/18] hw/xen/hvm: Fix Aarch64 typo Philippe Mathieu-Daudé
2025-03-05 16:53 ` Pierrick Bouvier
2025-03-06 1:35 ` Richard Henderson
2025-03-13 8:10 ` Michael Tokarev
2025-03-13 9:40 ` Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 02/18] hw/vfio/common: Get target page size using runtime helpers Philippe Mathieu-Daudé
2025-03-06 1:37 ` Richard Henderson
2025-03-05 15:39 ` [RFC PATCH 03/18] include: Poison TARGET_PHYS_ADDR_SPACE_BITS definition Philippe Mathieu-Daudé
2025-03-06 1:37 ` Richard Henderson
2025-03-05 15:39 ` [RFC PATCH 04/18] qemu: Introduce 'qemu/legacy_binary_info.h' Philippe Mathieu-Daudé
2025-03-05 16:59 ` Pierrick Bouvier
2025-03-06 7:26 ` Thomas Huth
2025-03-06 9:26 ` Philippe Mathieu-Daudé
2025-03-06 11:34 ` Paolo Bonzini
2025-03-06 11:52 ` Daniel P. Berrangé
2025-03-06 13:45 ` BALATON Zoltan [this message]
2025-03-06 15:15 ` Daniel P. Berrangé
2025-03-06 15:28 ` BALATON Zoltan
2025-03-06 21:45 ` Pierrick Bouvier
2025-03-07 0:46 ` BALATON Zoltan
2025-03-05 19:19 ` Paolo Bonzini
2025-03-06 1:56 ` Richard Henderson
2025-03-06 12:13 ` Daniel P. Berrangé
2025-03-19 14:25 ` Philippe Mathieu-Daudé
2025-03-22 6:59 ` Markus Armbruster
2025-03-05 15:39 ` [RFC PATCH 05/18] qemu: Introduce legacy_binary_is_64bit() helper Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 06/18] hw/mips/mipssim: Replace TARGET_MIPS64 by legacy_binary_is_64bit() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 07/18] hw/mips/malta: " Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 08/18] hw/i386: Inline TARGET_DEFAULT_CPU_TYPE definition Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 09/18] hw/ppc/mac: Replace TARGET_PPC64 by legacy_binary_is_64bit() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 10/18] qemu: Introduce legacy_binary_is_big_endian() helper Philippe Mathieu-Daudé
2025-03-06 7:28 ` Thomas Huth
2025-03-06 14:10 ` Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 11/18] hw/mips/jazz: Replace TARGET_BIG_ENDIAN by legacy_binary_is_big_endian Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 12/18] hw/mips/mipssim: Use legacy_binary_is_big_endian() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 13/18] hw/xtensa/sim: Replace TARGET_BIG_ENDIAN by legacy_binary_is_big_endian Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 14/18] hw/xtensa/xtfpga: Check endianness via legacy_binary_is_big_endian() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 15/18] hw/microblaze/petalogix_ml605_mmu: Use legacy_binary_is_big_endian() Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 16/18] hw/microblaze/petalogix_s3adsp1800_mmu: Use legacy_binary_is_big_endian Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 17/18] meson: Allow symlinking system emulation binaries Philippe Mathieu-Daudé
2025-03-05 15:39 ` [RFC PATCH 18/18] configs/targets: Merge qemu-system-microblaze{el} binaries Philippe Mathieu-Daudé
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=c6953b69-a54d-6d42-343e-dae07266306f@eik.bme.hu \
--to=balaton@eik.bme.hu \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.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;
as well as URLs for NNTP newsgroup(s).