Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Yonggang Luo <luoyonggang@gmail.com>
Cc: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	qemu-devel@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-arm@nongnu.org, kvm@vger.kernel.org,
	"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v4 46/55] qapi: add query-targets
Date: Mon, 28 Sep 2026 11:57:03 +0100	[thread overview]
Message-ID: <arpH_2anGV-JU12e@redhat.com> (raw)
In-Reply-To: <CAE2XoE9qsZZ+AnfGQ797SQj5yXP8SDOZyxYoKP=oh57UPFqq0Q@mail.gmail.com>

On Mon, Sep 28, 2026 at 06:51:41PM +0800, Yonggang Luo wrote:
> On Mon, Sep 28, 2026 at 6:39 PM Philippe Mathieu-Daudé <
> philmd@oss.qualcomm.com> wrote:
> >
> > On 28/9/26 12:13, Daniel P. Berrangé wrote:
> > > On Sat, Sep 26, 2026 at 03:00:45PM +0800, Yonggang Luo wrote:
> > >> query-targets lists each linked target, including none, with its
> > >> arch, endianness, and the machines that target accepts.
> > >>
> > >> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> > >> ---
> > >>   hw/core/machine-qmp-cmds.c | 30 ++++++++++++++++++++++++++++++
> > >>   qapi/machine.json          | 35 +++++++++++++++++++++++++++++++++++
> > >>   2 files changed, 65 insertions(+)
> > >
> > >
> > >> diff --git a/qapi/machine.json b/qapi/machine.json
> > >> index 6aaa2af709a..d8cdea6203e 100644
> > >> --- a/qapi/machine.json
> > >> +++ b/qapi/machine.json
> > >> @@ -307,6 +307,41 @@
> > >>   ##
> > >>   { 'command': 'query-target', 'returns': 'QemuTargetInfo' }
> > >>
> > >> +##
> > >> +# @TargetMachines:
> > >> +#
> > >> +# One registered system target and the machines that can run on it.
> > >> +#
> > >> +# @arch: the target architecture
> > >> +#
> > >> +# @endianness: the target endianness
> > >> +#
> > >> +# @machines: machine type names, not aliases
> > >> +#
> > >> +# Since: 11.2
> > >> +##
> > >> +{ 'struct': 'TargetMachines',
> > >> +  'data': { 'arch': 'SysEmuTarget',
> > >> +            'endianness': 'EndianMode',
> > >> +            'machines': ['str'] } }
> > >
> > > We already have  'QemuTargetInfo' struct which is used
> > > with 'query-target', that should also be used with the
> > > new 'query-targets' command.
> > >
> > > We need to add the 'endianness' field to QemuTargetInfo.
> >
> > Why do we want to expose endianness, and what endianness to
> > expose? Endianness is a runtime bit state of CPUs. Sometime
> > this bit is hardwired but that is an implementation detail.
> 
> For some targets it's, but for some targets it's not. for example
> 
> mips-softmmu.mak
> mipsel-softmmu.mak
> mips64el-softmmu.mak
> mips64-softmmu.mak
> 
> 
> mips64el-softmmu.mak
> mips64-softmmu.mak
> only differ the endianless

"EndianMode" is a tri-state including 'unspecified' as a value,
so we can cope with both scenarios - the targets where endianness
is runtime switchable in the CPU can use 'unspecified' as the
EndianMode. That behaviour should be documented in the QAPI
docs for QemuTargetInfo

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


  parent reply	other threads:[~2026-09-28 10:57 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26  6:59 [PATCH v4 00/55] single-binary: link multi-targets into qemu-system Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 01/55] target-info: Introduce target_riscv32 Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 02/55] configs/targets: remove target info definitions Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 03/55] target-info: rename target-info-stub.c in target-info-def.c Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 04/55] target-info: rename target-info-impl.h to target-info-def.h Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 05/55] vl: parse early options before target-info init Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 06/55] target-info: replace QOM registration with a constructor list Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 07/55] tests/unit: add test-target-info Yonggang Luo
2026-09-28  9:07   ` Markus Armbruster
     [not found]     ` <CAE2XoE9_R13NsUWu-s12QA9RBJykR87TEMh3VmndNEXQsCkNtg@mail.gmail.com>
2026-09-28  9:43       ` Daniel P. Berrangé
2026-09-28  9:48       ` Markus Armbruster
2026-09-26  7:00 ` [PATCH v4 08/55] tests/qtest: prepare machine-list-test for combined qemu-system Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 09/55] kconfig: rename REGISTER to HW_REGISTER Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 10/55] target-info: add TargetKconfig Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 11/55] target-info: add target_is_* helpers for each architecture Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 12/55] target-info: add target_is_any() Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 13/55] qom: pass TargetInfo to is_available for latter use Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 14/55] target/arm: move kvm_arm_set_cpreg_mig_tolerances to kvm.c Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 15/55] target/arm: allow -cpu host with Nitro Yonggang Luo
2026-09-28 10:06   ` Philippe Mathieu-Daudé
2026-09-26  7:00 ` [PATCH v4 16/55] target/arm: gate -cpu host with TypeIsAvailable Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 17/55] target/arm: replace target_long in A64 translate Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 18/55] target/arm: use vaddr for the A64 insn_start pc Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 19/55] tests/qtest: raise aspeed_smc-test timeout to 12 minutes Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 20/55] target-info: add tl_is_64() and target_is_tl32/64 helpers Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 21/55] tcg: declare TCGv in tcg.h Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 22/55] tcg: dispatch TL memory helpers from tcg-op-mem.h Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 23/55] tcg: dispatch tcg_gen_*_tl without TARGET_LONG_BITS Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 24/55] tcg: dispatch tcg_gen_gvec_dup_tl at runtime Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 25/55] tcg: give common-system helper tl an i64 slot Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 26/55] accel/tcg: move helper_exit_atomic next to cpu_loop_exit_atomic Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 27/55] tcg: move dup_const into tcg.c Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 28/55] tcg: move goto_tb helpers into tcg-op-ldst.c Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 29/55] accel/tcg: move gvec helpers into tcg-runtime-gvec.h Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 30/55] accel/tcg: move helper_lookup_tb_ptr into cpu-exec.h Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 31/55] accel/tcg: move memory helpers out of tcg-runtime.h Yonggang Luo
2026-09-28 10:40   ` Markus Armbruster
2026-09-26  7:00 ` [PATCH v4 32/55] tests/unit: cover common-system tl dispatch and calls Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 33/55] target/arm: fix A64 guest address width at 64 Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 34/55] target/arm: pass tl temps into SVE and SME helpers Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 35/55] exec: provide target_ulong for softmmu common code Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 36/55] exec: compile abi_ptr.h without per-target cpu-param.h Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 37/55] accel/tcg: keep cpu-ldst endian aliases per-target Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 38/55] target/arm: fold arm_ss into common source sets Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 39/55] target/microblaze: fold system sources " Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 40/55] meson: link shared objects into qemu-system Yonggang Luo
2026-09-28 11:41   ` Markus Armbruster
2026-09-28 11:47     ` Daniel P. Berrangé
2026-09-28 12:23       ` Markus Armbruster
2026-09-26  7:00 ` [PATCH v4 41/55] target-info: add SysEmuTarget none Yonggang Luo
2026-09-28 11:47   ` Markus Armbruster
     [not found]     ` <CAE2XoE_QozVhBix251nyUQkFMi6p_4idGXpVOT0LSP7VYK8ddw@mail.gmail.com>
2026-09-28 12:17       ` Markus Armbruster
     [not found]         ` <CAE2XoE88wDu5dYzqVd4gvwNV=bf8qcztLos0xx3iMFnWB+=Nvw@mail.gmail.com>
2026-09-28 12:24           ` Markus Armbruster
2026-09-26  7:00 ` [PATCH v4 42/55] module: load every arch-tagged module when target is none Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 43/55] accel/tcg: tolerate NULL target_cpu_type for -M none Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 44/55] target-info: select combined qemu-system target by name Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 45/55] vl: parse arch: machine types on combined qemu-system Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 46/55] qapi: add query-targets Yonggang Luo
2026-09-28 10:13   ` Daniel P. Berrangé
2026-09-28 10:39     ` Philippe Mathieu-Daudé
     [not found]       ` <CAE2XoE9qsZZ+AnfGQ797SQj5yXP8SDOZyxYoKP=oh57UPFqq0Q@mail.gmail.com>
2026-09-28 10:57         ` Daniel P. Berrangé [this message]
2026-09-28 11:29           ` Philippe Mathieu-Daudé
2026-09-28 11:36             ` Daniel P. Berrangé
2026-09-28 11:34         ` Philippe Mathieu-Daudé
2026-09-28 18:50           ` Yonggang Luo
     [not found]       ` <CAE2XoE8Fp8w4m0WBjEXF3LceFXUqKDcXhdSmhCThgkAM3wRVaQ@mail.gmail.com>
2026-09-28 19:11         ` Philippe Mathieu-Daudé
2026-09-28 19:18           ` Yonggang Luo
2026-09-29  1:36           ` Yonggang Luo
2026-09-28 12:03     ` Markus Armbruster
2026-09-28 12:08       ` Daniel P. Berrangé
2026-09-28 14:24     ` Yonggang Luo
2026-09-28 14:37       ` Daniel P. Berrangé
2026-09-28 16:05         ` Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 47/55] target-info: add target_is_microblaze Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 48/55] hw/microblaze: set petalogix-s3adsp1800 TypeInfo.is_available Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 49/55] hw/microblaze: expand petalogix-ml605 and xlnx-zynqmp-pmu to TypeInfo Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 50/55] hw/arm: expand leftover 32-bit DEFINE_MACHINE " Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 51/55] hw/arm: expand imx8mm-evk " Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 52/55] hw/arm: set virt TypeInfo.is_available Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 53/55] hw/arm: set remaining 32-bit machine TypeInfo.is_available Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 54/55] hw/arm: set aarch64-only " Yonggang Luo
2026-09-26  7:00 ` [PATCH v4 55/55] tests/qtest: cover combined qemu-system machines 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=arpH_2anGV-JU12e@redhat.com \
    --to=berrange@redhat.com \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=farosas@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=luoyonggang@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.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