From: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
To: Yonggang Luo <luoyonggang@gmail.com>, qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Laurent Vivier" <lvivier@redhat.com>,
"Zhao Liu" <zhao1.liu@intel.com>, "John Snow" <jsnow@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Joel Stanley" <joel@jms.id.au>,
"Fabiano Rosas" <farosas@suse.de>,
"Kane Chen" <kane_chen@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Troy Lee" <leetroy@gmail.com>,
"Jamin Lin" <jamin_lin@aspeedtech.com>,
"Stafford Horne" <shorne@gmail.com>,
qemu-arm@nongnu.org, "Philippe Mathieu-Daude" <philmd@mailo.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Alexander Bulekov" <alxndr@bu.edu>,
"Darren Kenny" <darren.kenny@oracle.com>
Subject: Re: [PATCH 7/8] target-info: Replace handwritten architecture checks with generated code
Date: Wed, 7 Oct 2026 13:36:02 -0700 [thread overview]
Message-ID: <51f90aaa-e37b-490f-a207-a31f14407df8@oss.qualcomm.com> (raw)
In-Reply-To: <20261007115253.328-8-luoyonggang@gmail.com>
On 10/7/2026 4:48 AM, Yonggang Luo wrote:
> Add scripts/gen-target-info.py to generate declarations and definitions
> for exact-target and base-family architecture checks from system target
> names and their TARGET_BASE_ARCH values.
>
> Provide target_is_<arch>() and target_is_base_<family>() checks for an
> explicit TargetInfo. Retain target_<arch>() and target_base_<family>()
> as wrappers using the current target.
>
> Wire the generator into Meson using all system target definitions so
> the available checks do not depend on --target-list.
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
> include/qemu/target-info.h | 76 ++++-------------------------
> meson.build | 16 ++++++
> scripts/gen-target-info.py | 99 ++++++++++++++++++++++++++++++++++++++
> target-info.c | 62 +-----------------------
> 4 files changed, 125 insertions(+), 128 deletions(-)
> create mode 100644 scripts/gen-target-info.py
>
If I had to pick between simple and manual boilerplate, and a python
script generating C code, I would tend to choose the former.
In this case, the set of targets is bounded, so manual code is really
the way to go for me.
If the repetition is really unbearable, macros are a way to deal with
this. However, note that we will not need all the target_X to be
defined, so I would prefer to not see any new variant added as long as
it's not used.
Regards,
Pierrick
next prev parent reply other threads:[~2026-10-07 20:36 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 11:47 [PATCH 0/8] qom: pass TargetInfo to the is_available callback Yonggang Luo
2026-10-07 11:47 ` [PATCH 1/8] configs/targets: remove target info definitions Yonggang Luo
2026-10-07 20:26 ` Pierrick Bouvier
2026-10-08 9:46 ` Philippe Mathieu-Daudé
2026-10-07 11:47 ` [PATCH 2/8] target-info: rename target-info-stub.c in target-info-def.c Yonggang Luo
2026-10-07 11:48 ` [PATCH 3/8] target-info: rename target-info-impl.h to target-info-def.h Yonggang Luo
2026-10-07 20:27 ` Pierrick Bouvier
2026-10-07 11:48 ` [PATCH 4/8] target-info: replace QOM registration with a constructor list Yonggang Luo
2026-10-07 20:29 ` Pierrick Bouvier
2026-10-07 20:50 ` Yonggang Luo
2026-10-07 22:31 ` Pierrick Bouvier
2026-10-07 22:54 ` Yonggang Luo
2026-10-07 23:24 ` Pierrick Bouvier
2026-10-13 9:26 ` Daniel P. Berrangé
2026-10-13 15:53 ` Pierrick Bouvier
2026-10-07 23:02 ` Yonggang Luo
2026-10-07 23:28 ` Pierrick Bouvier
2026-10-12 21:27 ` Yonggang Luo
2026-10-13 3:57 ` Pierrick Bouvier
2026-10-13 8:58 ` Yonggang Luo
2026-10-07 11:48 ` [PATCH 5/8] tests/unit: add target-info coverage for multi-target builds Yonggang Luo
2026-10-07 11:48 ` [PATCH 6/8] meson: load all target .mak files into target_mak_all Yonggang Luo
2026-10-07 20:30 ` Pierrick Bouvier
2026-10-07 11:48 ` [PATCH 7/8] target-info: Replace handwritten architecture checks with generated code Yonggang Luo
2026-10-07 20:36 ` Pierrick Bouvier [this message]
2026-10-07 11:48 ` [PATCH 8/8] qom: pass TargetInfo to is_available for later use Yonggang Luo
2026-10-07 20:44 ` Pierrick Bouvier
2026-10-07 21:42 ` Yonggang Luo
2026-10-08 0:00 ` Pierrick Bouvier
2026-10-08 0:03 ` Pierrick Bouvier
2026-10-08 2:08 ` Yonggang Luo
2026-10-08 15:58 ` Pierrick Bouvier
2026-10-08 9:36 ` Daniel P. Berrangé
2026-10-08 9:56 ` Yonggang Luo
2026-10-08 16:01 ` Pierrick Bouvier
2026-10-08 17:04 ` Yonggang Luo
2026-10-08 18:26 ` Pierrick Bouvier
2026-10-08 18:33 ` Yonggang Luo
2026-10-08 18:40 ` Pierrick Bouvier
2026-10-07 20:25 ` [PATCH 0/8] qom: pass TargetInfo to the is_available callback Pierrick Bouvier
2026-10-08 9:42 ` Daniel P. Berrangé
2026-10-08 9:46 ` Yonggang Luo
2026-10-08 16:06 ` Pierrick Bouvier
2026-10-08 17:13 ` Yonggang Luo
2026-10-08 18:34 ` Pierrick Bouvier
2026-10-08 18:48 ` Yonggang Luo
2026-10-11 20:22 ` Yonggang Luo
2026-10-12 2:13 ` Pierrick Bouvier
2026-10-12 2:21 ` Yonggang Luo
2026-10-12 2:25 ` Pierrick Bouvier
2026-10-12 4:26 ` Yonggang Luo
2026-10-12 7:11 ` Pierrick Bouvier
2026-10-13 1:26 ` Pierrick Bouvier
2026-10-13 2:43 ` Yonggang Luo
2026-10-13 3:53 ` Pierrick Bouvier
2026-10-13 4:03 ` Yonggang Luo
2026-10-13 15:56 ` Pierrick Bouvier
2026-10-11 20:32 ` Yonggang Luo
2026-10-07 20:46 ` Pierrick Bouvier
2026-10-09 21:58 ` Pierrick Bouvier
2026-10-09 22:08 ` Yonggang Luo
2026-10-09 22:21 ` Pierrick Bouvier
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=51f90aaa-e37b-490f-a207-a31f14407df8@oss.qualcomm.com \
--to=pierrick.bouvier@oss.qualcomm.com \
--cc=alxndr@bu.edu \
--cc=andrew@codeconstruct.com.au \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=crosa@redhat.com \
--cc=darren.kenny@oracle.com \
--cc=farosas@suse.de \
--cc=jamin_lin@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=jsnow@redhat.com \
--cc=kane_chen@aspeedtech.com \
--cc=laurent@vivier.eu \
--cc=leetroy@gmail.com \
--cc=luoyonggang@gmail.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=shorne@gmail.com \
--cc=stefanha@redhat.com \
--cc=steven_lee@aspeedtech.com \
--cc=zhao1.liu@intel.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.