From: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
To: luoyonggang@gmail.com
Cc: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
qemu-devel@nongnu.org, "Anton Johansson" <anjo@rev.ng>,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH 00/14] target-info: remove machine_typename
Date: Thu, 3 Sep 2026 09:53:32 -0700 [thread overview]
Message-ID: <33b35d50-d726-4234-8a47-2aaf177d4c5e@oss.qualcomm.com> (raw)
In-Reply-To: <CAE2XoE866Oi_LKi=U10HdOB4TZwgni7R28foJsv203KavhdRtQ@mail.gmail.com>
On 9/3/2026 9:42 AM, Yonggang Luo wrote:
>
>
> On Fri, Sep 4, 2026 at 12:28 AM Pierrick Bouvier
> <pierrick.bouvier@oss.qualcomm.com
> <mailto:pierrick.bouvier@oss.qualcomm.com>> wrote:
>>
>> On 9/3/2026 3:33 AM, Yonggang Luo wrote:
>> >
>> >
>> >>
>> >> > Pierrick Bouvier (14):
>> >> > qom/object: add is_available callback to TypeInfo
>> >>
>> >
>> > Patches for is_available callback to TypeInfo, it's can be merged latter
>> >
>>
>> It's needed because files in patch 2 already depend on existing
>> filtering mechanism to distinguish between arm and aarch64.
>> We found other places where such filter could be used to specify target
>> related types within a single C file, thus allowing to remove #ifdef
>> TARGET_X easily.
>>
>> > The reason is for the following command to execute:
>> >
>> > we need add target_info_select and pass TargetInfo to is_available
>> >
>> > - Move target_info() into qom/object.c. Default to SYS_EMU_TARGET_NONE
>> > until a real target is selected.
>> > - Add target_info_select(); it may be called only once with a non-NULL
>> > TargetInfo that is not SYS_EMU_TARGET_NONE.
>> > - Invoke TypeInfo.is_available after select, passing target_info().
>> > - Change target_* helpers to take const TargetInfo *.
>>
>> We can wait to have a need for this. As long as there is no
>> heterogeneous support, it's safe to assume there is a single target
>> active globally.
>
>
> Because we would have more and more usage of target_* , that's why I
> would suggest merge it as early as possible. I means directly usage of
> these functions.
> Not use is_avaible, for example:
>
> --- a/hw/arm/aspeed_ast27x0.c
> +++ b/hw/arm/aspeed_ast27x0.c
> @@ -420,7 +420,7 @@ static void aspeed_soc_ast2700_init(Object *obj)
> }
>
> for (i = 0; i < sc->num_cpus; i++) {
> - if (qtest_enabled() && !target_aarch64()) {
> + if (qtest_enabled() && !target_aarch64(target_info())) {
> /*
> * Introspection qtest just want to create this object
> * without realizing it. ARM_CPU_TYPE_NAME("cortex-a35")
> @@ -703,7 +703,7 @@ static void aspeed_soc_ast2700_realize(DeviceState
> *dev, Error **errp)
> qemu_irq irq;
> int uart;
>
> - if (qtest_enabled() && !target_aarch64()) {
> + if (qtest_enabled() && !target_aarch64(target_info())) {
> g_assert_not_reached();
> }
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 0871a35e11f..dbdf55dfea9 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -4132,7 +4132,7 @@ static GPtrArray *virt_get_valid_cpu_types(const
> MachineState *ms)
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a15")));
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("max-v8")));
> }
> - if (tcg_enabled() && target_aarch64()) {
> + if (tcg_enabled() && target_aarch64(target_info())) {
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a35")));
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a55")));
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a72")));
> @@ -4144,7 +4144,7 @@ static GPtrArray *virt_get_valid_cpu_types(const
> MachineState *ms)
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("neoverse-n2")));
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("max-v9")));
> }
> - if (target_aarch64()) {
> + if (target_aarch64(target_info())) {
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a53")));
> g_ptr_array_add(vct, g_strdup(ARM_CPU_TYPE_NAME("cortex-a57")));
> if (kvm_enabled() || hvf_enabled() || whpx_enabled()) {
> diff --git a/hw/nitro/machine.c b/hw/nitro/machine.c
> index 88d01960a01..2a924cab4f7 100644
> --- a/hw/nitro/machine.c
> +++ b/hw/nitro/machine.c
> @@ -97,7 +97,7 @@ static char *build_eif(const char *kernel_data, gsize
> kernel_size,
> hdr = (EifHeader) {
> .magic = EIF_MAGIC,
> .version = cpu_to_be16(4),
> - .flags = cpu_to_be16(target_aarch64() ? EIF_HDR_ARCH_ARM64 : 0),
> + .flags = cpu_to_be16(target_aarch64(target_info()) ?
> EIF_HDR_ARCH_ARM64 : 0),
> };
>
> g_byte_array_append(buf, (const uint8_t *)&hdr, sizeof(hdr));
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index c15f2b9f084..26003f2b4df 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -2888,7 +2888,7 @@ void pci_qdev_property_add_specifics(DeviceClass *dc)
> ObjectClass *oc = OBJECT_CLASS(dc);
>
> /* The loadparm property is only supported on s390x */
> - if (target_s390x()) {
> + if (target_s390x(target_info())) {
> object_class_property_add_str(oc, "loadparm",
> pci_qdev_property_get_loadparm,
> pci_qdev_property_set_loadparm);
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index a42f7d8e77d..31170e87a33 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -3190,7 +3190,7 @@ static void
> scsi_property_add_specifics(DeviceClass *dc)
> ObjectClass *oc = OBJECT_CLASS(dc);
>
> /* The loadparm property is only supported on s390x */
> - if (target_s390x()) {
> + if (target_s390x(target_info())) {
> object_class_property_add_str(oc, "loadparm",
> scsi_property_get_loadparm,
> scsi_property_set_loadparm);
> diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c
> index a06cbf3c646..3d747b470cc 100644
> --- a/hw/vfio/migration-multifd.c
> +++ b/hw/vfio/migration-multifd.c
> @@ -54,7 +54,7 @@ bool vfio_load_config_after_iter(VFIODevice *vbasedev)
> * See commit d329f5032e17 ("vfio: Move the saving of the config
> space to
> * the right place in VFIO migration").
> */
> - return target_base_arm();
> + return target_base_arm(target_info());
> }
>
> /* type safety */
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index 2881cec72d9..3383af64859 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -2631,7 +2631,7 @@ static int vhost_user_backend_init(struct
> vhost_dev *dev, void *opaque,
> return -EINVAL;
> }
>
> - const uint64_t vhost_user_max_ram_slots = target_base_ppc() ?
> + const uint64_t vhost_user_max_ram_slots =
> target_base_ppc(target_info()) ?
> SPAPR_MAX_RAM_SLOTS : VHOST_USER_MAX_RAM_SLOTS;
> u->user->memory_slots = MIN(ram_slots,
> vhost_user_max_ram_slots);
> }
> diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-
> impl.h
> index cf42aabbc8b..61404baa4b5 100644
> --- a/include/qemu/target-info-impl.h
>
>
> any way, we can wait the following pull to be merged first
>
> [PULL 00/51] Misc HW/accel patches for 2026-09-03
> https://patchew.org/QEMU/20260903103936.62355-1-philmd@oss.qualcomm.com/
> <https://patchew.org/QEMU/20260903103936.62355-1-philmd@oss.qualcomm.com/>
>
>
> and a better way to deal with it would be appreciated.
>
> I also have patches for riscv needs this.
>
As I mentioned in our private discussion, we understood that some
members of our community don't see the need to introduce the
single-binary in its current form. We take note about this, and decided
to not upstream it. As a consequence, it's not needed to filter *all*
the types, like what previous series were trying to do.
It does not mean we stop working on this topic, simply that we'll keep
this binary downstream until we have heterogeneous emulation ready.
That said, feel free to iterate and send a series on your own. I don't
see any possibility of change in existing opinions, so be prepared to
swim against the tide.
Also, I'll be off next week, so don't be surprised if you don't see any
answer from me.
>
>
> --
> 此致
> 礼
> 罗勇刚
> Yours
> sincerely,
> Yonggang Luo
Regards,
Pierrick
prev parent reply other threads:[~2026-09-03 16:53 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 20:20 [PATCH 00/14] target-info: remove machine_typename Pierrick Bouvier
2026-09-01 20:20 ` [PATCH 01/14] qom/object: add is_available callback to TypeInfo Pierrick Bouvier
2026-09-02 15:53 ` Philippe Mathieu-Daudé
2026-09-02 17:40 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 02/14] hw/arm: filter minimal set of machines Pierrick Bouvier
2026-09-02 14:30 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 03/14] system: query machines using TYPE_MACHINE Pierrick Bouvier
2026-09-02 4:39 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 04/14] target-info: remove machine_typename Pierrick Bouvier
2026-09-02 4:36 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 05/14] configs/targets: remove target info definitions Pierrick Bouvier
2026-09-02 15:55 ` Philippe Mathieu-Daudé
2026-09-02 16:24 ` Pierrick Bouvier
2026-09-02 17:41 ` Pierrick Bouvier
2026-09-01 20:20 ` [PATCH 06/14] target-info: rename target-info-stub.c in target-info-def.c Pierrick Bouvier
2026-09-01 20:20 ` [PATCH 07/14] hw/arm: remove TYPE_TARGET_{AARCH64,ARM}_MACHINE Pierrick Bouvier
2026-09-02 4:37 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 08/14] hw/arm: remove {arm, arm_aarch64, aarch64}_machine_interfaces Pierrick Bouvier via qemu development
2026-09-02 4:37 ` Philippe Mathieu-Daudé
2026-09-03 4:06 ` Yonggang Luo
2026-09-01 20:20 ` [PATCH 09/14] hw/arm: remove DEFINE_MACHINE_{AARCH64,ARM} Pierrick Bouvier
2026-09-02 4:38 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 10/14] hw/arm: remove machines-qom.h Pierrick Bouvier
2026-09-02 4:38 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 11/14] hw/riscv: remove TYPE_TARGET_{RISCV32,RISCV64}_MACHINE Pierrick Bouvier
2026-09-02 4:38 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 12/14] hw/riscv: remove {riscv32, riscv32_64, riscv64}_machine_interfaces Pierrick Bouvier via qemu development
2026-09-02 4:39 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 13/14] hw/riscv: remove DEFINE_MACHINE_{RISCV32,RISCV64} Pierrick Bouvier
2026-09-02 4:39 ` Philippe Mathieu-Daudé
2026-09-01 20:20 ` [PATCH 14/14] hw/riscv: remove machines-qom.h Pierrick Bouvier
2026-09-02 4:39 ` Philippe Mathieu-Daudé
2026-09-02 17:54 ` [PATCH 00/14] target-info: remove machine_typename Philippe Mathieu-Daudé
2026-09-03 10:33 ` Yonggang Luo
2026-09-03 16:28 ` Pierrick Bouvier
2026-09-03 16:42 ` Yonggang Luo
2026-09-03 16:53 ` Pierrick Bouvier [this message]
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=33b35d50-d726-4234-8a47-2aaf177d4c5e@oss.qualcomm.com \
--to=pierrick.bouvier@oss.qualcomm.com \
--cc=anjo@rev.ng \
--cc=luoyonggang@gmail.com \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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.