From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
qemu-devel@nongnu.org
Cc: anjo@rev.ng,
"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Alexander Graf" <agraf@csgraf.de>
Subject: Re: [PATCH 25/47] target-info: add target_config_nitro
Date: Mon, 31 Aug 2026 16:33:54 +0200 [thread overview]
Message-ID: <0edef42e-06b2-4fca-af6f-8d17b0f15a3f@oss.qualcomm.com> (raw)
In-Reply-To: <4b9aa2f9-8546-4aee-92f0-d27e935be53c@oss.qualcomm.com>
On 2026-08-31 9:15, Philippe Mathieu-Daudé wrote:
> On 29/8/26 00:58, Pierrick Bouvier wrote:
>
> Also wondering why we need a special config for a target device.
>
> So why are we listing we can not plug? Maybe the bus Kconfig is
> missing the accelerator dependency?
>
> -- >8 --
> diff --git a/hw/nitro/Kconfig b/hw/nitro/Kconfig
> index cfae85920a0..2e4125f8710 100644
> --- a/hw/nitro/Kconfig
> +++ b/hw/nitro/Kconfig
> @@ -1,4 +1,5 @@
> config NITRO_VSOCK_BUS
> + depends on NITRO
> bool
>
> config NITRO_SERIAL_VSOCK
> ---
>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>> ---
>> include/qemu/target-info-impl.h | 2 ++
>> include/qemu/target-info.h | 7 +++++++
>> target-info-def.c | 3 +++
>> target-info.c | 5 +++++
>> 4 files changed, 17 insertions(+)
>>
>> diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-
>> info-impl.h
>> index dbd7a5a2071..4f6c898c707 100644
>> --- a/include/qemu/target-info-impl.h
>> +++ b/include/qemu/target-info-impl.h
>> @@ -33,6 +33,8 @@ typedef struct TargetInfo {
>> /* CONFIG_MULTIPROCESS */
>> bool config_multiprocess;
>> + /* CONFIG_NITRO */
>> + bool config_nitro;
>> } TargetInfo;
>> /**
>> diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
>> index 579c43332fb..d775c94d1e3 100644
>> --- a/include/qemu/target-info.h
>> +++ b/include/qemu/target-info.h
>> @@ -49,6 +49,13 @@ bool target_big_endian(void);
>> */
>> bool target_config_multiprocess(void);
>> +/**
>> + * target_config_nitro:
>> + *
>> + * Returns true if target defines CONFIG_NITRO.
>> + */
>> +bool target_config_nitro(void);
>> +
>> /**
>> * target_base_arm:
>> *
>> diff --git a/target-info-def.c b/target-info-def.c
>> index 9d51371f766..96fd1f8c73d 100644
>> --- a/target-info-def.c
>> +++ b/target-info-def.c
>> @@ -46,6 +46,9 @@ static const TargetInfo target_info_stub = {
>> #ifdef CONFIG_MULTIPROCESS
>> .config_multiprocess = true,
>> #endif
>> +#ifdef CONFIG_NITRO
>> + .config_nitro = true,
>> +#endif
>> };
>> target_info_init(target_info_stub)
>> diff --git a/target-info.c b/target-info.c
>> index 5db2a6049ac..67127da16fe 100644
>> --- a/target-info.c
>> +++ b/target-info.c
>> @@ -47,6 +47,11 @@ bool target_config_multiprocess(void)
>> return target_info()->config_multiprocess;
>> }
>> +bool target_config_nitro(void)
>> +{
>> + return target_info()->config_nitro;
>> +}
>> +
>> bool target_base_arm(void)
>> {
>> switch (target_arch()) {
>
Since the goal of this effort is solely to keep the CLI
output unchanged, we can do simpler without having to add
TargetInfo::config_nitro:
-- >8 --
diff --git a/hw/nitro/Kconfig b/hw/nitro/Kconfig
index cfae85920a..2e4125f871 100644
--- a/hw/nitro/Kconfig
+++ b/hw/nitro/Kconfig
@@ -1,2 +1,3 @@
config NITRO_VSOCK_BUS
+ depends on NITRO
bool
diff --git a/hw/nitro/meson.build b/hw/nitro/meson.build
index b9bd0d4300..39a087f8d7 100644
--- a/hw/nitro/meson.build
+++ b/hw/nitro/meson.build
@@ -1 +1,2 @@
+system_ss.add(when: 'CONFIG_NITRO', if_true: files('nitro-common.c'))
system_ss.add(when: 'CONFIG_NITRO_VSOCK_BUS', if_true:
files('nitro-vsock-bus.c'))
diff --git a/hw/nitro/nitro-common.c b/hw/nitro/nitro-common.c
new file mode 100644
index 0000000000..cfb47a9a49
--- /dev/null
+++ b/hw/nitro/nitro-common.c
@@ -0,0 +1,15 @@
+/*
+ * Nitro common helpers
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#include "qemu/osdep.h"
+#include "qemu/target-info.h"
+#include "system/nitro-accel.h"
+
+bool target_config_nitro(void)
+{
+ return (target_aarch64() || target_x86_64()) && nitro_enabled();
+}
diff --git a/include/system/nitro-accel.h b/include/system/nitro-accel.h
index a93aa6fb00..a5126bcf02 100644
--- a/include/system/nitro-accel.h
+++ b/include/system/nitro-accel.h
@@ -18,2 +18,4 @@ static inline bool nitro_enabled(void)
+bool target_config_nitro(void);
+
#define TYPE_NITRO_ACCEL ACCEL_CLASS_NAME("nitro")
---
Amending in patches #30 "hw/nitro: filter from CONFIG_NITRO":
-- >8 --
diff --git a/hw/nitro/heartbeat.c b/hw/nitro/heartbeat.c
index dc41323266..c4d2a4637e 100644
--- a/hw/nitro/heartbeat.c
+++ b/hw/nitro/heartbeat.c
@@ -21,2 +21,3 @@
#include "hw/nitro/heartbeat.h"
+#include "system/nitro-accel.h"
#include "trace.h"
diff --git a/hw/nitro/serial-vsock.c b/hw/nitro/serial-vsock.c
index 1d56c33804..ec5aea4617 100644
--- a/hw/nitro/serial-vsock.c
+++ b/hw/nitro/serial-vsock.c
@@ -25,2 +25,3 @@
#include "hw/nitro/serial-vsock.h"
+#include "system/nitro-accel.h"
#include "trace.h"
---
And with another preliminary patch introducing target_x86_64():
-- >8 --
diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
index 5cce27d4f6..f71a1b8bb6 100644
--- a/include/qemu/target-info.h
+++ b/include/qemu/target-info.h
@@ -128,2 +128,9 @@ bool target_riscv64(void);
+/**
+ * target_x86_64:
+ *
+ * Returns whether the target architecture is 64-bit x86.
+ */
+bool target_x86_64(void);
+
#endif
diff --git a/target-info.c b/target-info.c
index c9e0be3279..6f03f412b7 100644
--- a/target-info.c
+++ b/target-info.c
@@ -116 +116,6 @@ bool target_riscv64(void)
}
+
+bool target_x86_64(void)
+{
+ return target_arch() == SYS_EMU_TARGET_X86_64;
+}
---
Only tested on Linux/Aarch64, not Linux/x86_64.
next prev parent reply other threads:[~2026-08-31 14:34 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 22:58 [PATCH 00/47] single-binary: implement dynamic filtering for QOM types Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 01/47] target/arm: Move -cpu max stuff out of cpu32.c Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 02/47] target/arm: Build cpu32.c once in system mode Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 03/47] target/arm: Rename and adjust aarch32_max_v8_tcg_initfn Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 04/47] target/arm: Introduce cpu types max-v8 and max-v9 Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 05/47] target/arm: Use -cpu max-v8 with aarch64=off Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 06/47] target/arm: Separate cpu types max-v8 and max-v9 Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 07/47] hw/remote/machine: remove unsupported arm target Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 09/47] qom/object: add is_available callback to TypeInfo Pierrick Bouvier
2026-08-31 6:37 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 10/47] hw/arm: filter minimal set of machines Pierrick Bouvier
2026-08-31 6:38 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 11/47] system: query machines using TYPE_MACHINE Pierrick Bouvier
2026-08-31 6:40 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 12/47] target-info: remove machine_typename Pierrick Bouvier
2026-08-31 6:40 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 13/47] configs/targets: remove target info definitions Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 14/47] target-info: rename target-info-stub.c in target-info-def.c Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 15/47] hw/arm: remove TYPE_TARGET_{AARCH64,ARM}_MACHINE Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 16/47] hw/arm: remove {arm, arm_aarch64, aarch64}_machine_interfaces Pierrick Bouvier via qemu development
2026-08-28 22:58 ` [PATCH 17/47] hw/arm: remove DEFINE_MACHINE_{AARCH64,ARM} Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 18/47] hw/arm: remove machines-qom.h Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 19/47] hw/riscv: remove TYPE_TARGET_{RISCV32,RISCV64}_MACHINE Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 20/47] hw/riscv: remove {riscv32, riscv32_64, riscv64}_machine_interfaces Pierrick Bouvier via qemu development
2026-08-28 22:58 ` [PATCH 21/47] hw/riscv: remove DEFINE_MACHINE_{RISCV32,RISCV64} Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 22/47] hw/riscv: remove machines-qom.h Pierrick Bouvier
2026-08-31 12:36 ` Yonggang Luo
2026-08-31 17:58 ` Pierrick Bouvier
2026-08-31 18:28 ` Yonggang Luo
2026-08-28 22:58 ` [PATCH 23/47] target-info: add target_config_multiprocess Pierrick Bouvier
2026-08-31 14:48 ` Philippe Mathieu-Daudé
2026-08-31 14:57 ` Yonggang Luo
2026-08-31 18:00 ` Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 24/47] hw/remote/machine: filter from CONFIG_MULTIPROCESS Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 25/47] target-info: add target_config_nitro Pierrick Bouvier
2026-08-31 7:15 ` Philippe Mathieu-Daudé
2026-08-31 14:33 ` Philippe Mathieu-Daudé [this message]
2026-08-31 18:05 ` Pierrick Bouvier
2026-08-31 18:03 ` Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 26/47] hw/nitro/machine: filter from CONFIG_NITRO Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 27/47] hw/arm: filter aarch64 only machines Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 28/47] target-info: add target_config_dpcd Pierrick Bouvier
2026-08-31 7:04 ` Philippe Mathieu-Daudé
2026-08-31 10:15 ` Philippe Mathieu-Daudé
2026-08-31 18:07 ` Pierrick Bouvier
2026-08-31 18:08 ` Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 29/47] hw/display/dpcd: filter from CONFIG_DPCD Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 30/47] hw/nitro: filter from CONFIG_NITRO Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 31/47] hw/remote/proxy: filter from CONFIG_MULTIPROCESS Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 32/47] target/arm: filter cpus from target Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 33/47] system/vl: add new option -target Pierrick Bouvier
2026-08-31 12:39 ` Yonggang Luo
2026-08-31 18:10 ` Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 34/47] system/vl: fallback to detect target from argv[0] Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 35/47] meson: build single binary for arm+aarch64 targets Pierrick Bouvier
2026-08-31 14:50 ` Philippe Mathieu-Daudé
2026-08-31 15:21 ` Yonggang Luo
2026-08-31 18:12 ` Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 36/47] scripts: add single-binary-compare-cmdline.sh Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 37/47] hw/core/boards.h: add available callback to DEFINE_MACHINE_EXTENDED Pierrick Bouvier
2026-08-31 12:43 ` Yonggang Luo
2026-08-31 18:13 ` Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 38/47] hw/core/boards.h: remove unused DEFINE_MACHINE_WITH_INTERFACE* Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 39/47] hw/core/boards.h: add available callback to DEFINE_MACHINE Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 40/47] hw/arm: filter arm machines Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 41/47] target-info: add target_microblaze Pierrick Bouvier
2026-08-31 7:16 ` Philippe Mathieu-Daudé
2026-08-31 15:01 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 42/47] hw/microblaze: filter microblaze machines Pierrick Bouvier
2026-08-31 7:17 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 43/47] target/microblaze/cpu: filter microblaze cpu Pierrick Bouvier
2026-08-31 7:17 ` Philippe Mathieu-Daudé
2026-08-28 22:58 ` [PATCH 44/47] hw: filter arm devices Pierrick Bouvier
2026-08-28 22:58 ` [PATCH 45/47] target-info: add target_config_cxl Pierrick Bouvier
2026-08-28 22:59 ` [PATCH 46/47] hw/pci-bridge: filter from CONFIG_CXL Pierrick Bouvier
2026-08-28 22:59 ` [PATCH 47/47] meson: add microblaze to single-binary Pierrick Bouvier
2026-08-28 23:13 ` [PATCH 00/47] single-binary: implement dynamic filtering for QOM types Pierrick Bouvier
2026-08-28 23:17 ` Pierrick Bouvier
2026-09-04 8:19 ` Daniel P. Berrangé
2026-09-04 8:58 ` Yonggang Luo
2026-09-04 9:13 ` Peter Maydell
2026-09-04 9:34 ` Yonggang Luo
2026-09-04 9:41 ` Peter Maydell
2026-09-04 13:02 ` Philippe Mathieu-Daudé
2026-09-04 9:55 ` Daniel P. Berrangé
2026-09-04 10:04 ` Yonggang Luo
2026-09-04 10:11 ` Daniel P. Berrangé
2026-09-04 13:08 ` Philippe Mathieu-Daudé
2026-09-04 10:23 ` Peter Maydell
2026-09-04 10:33 ` Daniel P. Berrangé
2026-09-04 11:19 ` Markus Armbruster
2026-09-04 11:27 ` Daniel P. Berrangé
2026-09-04 11:55 ` Markus Armbruster
2026-09-04 13:05 ` Philippe Mathieu-Daudé
2026-09-04 11:01 ` Markus Armbruster
2026-09-04 11:06 ` Daniel P. Berrangé
2026-09-04 9:45 ` Daniel P. Berrangé
2026-09-04 11:25 ` Markus Armbruster
2026-09-04 11:36 ` Daniel P. Berrangé
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=0edef42e-06b2-4fca-af6f-8d17b0f15a3f@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=agraf@csgraf.de \
--cc=anjo@rev.ng \
--cc=berrange@redhat.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@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.