qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Markus Armbruster" <armbru@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [RFC PATCH-for-9.1? 2/2] hw/intc/arm_gic: Only provide query-gic-capabilities when GIC built-in
Date: Tue,  6 Aug 2024 16:19:40 +0200	[thread overview]
Message-ID: <20240806141940.22095-3-philmd@linaro.org> (raw)
In-Reply-To: <20240806141940.22095-1-philmd@linaro.org>

When configuring QEMU with --without-default-devices and
not including machines using a GIC, the GIC model is not
built in but the 'query-gic-capabilities' command still
returns false hopes about GIC:

  {"execute": "query-gic-capabilities"}
  {"return": [{"emulated": true, "version": 3, "kernel": false}, {"emulated": true, "version": 2, "kernel": false}]}

Restrict the command to when the GIC is available. If it
isn't we'll get:

  { "execute": "query-gic-capabilities" }
  {"error": {"class": "CommandNotFound", "desc": "The command query-gic-capabilities has not been found"}}

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2484
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 qapi/misc-target.json | 4 ++--
 hw/intc/arm_gic_qmp.c | 2 ++
 hw/intc/meson.build   | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index 8d70bd24d8..b857e44c2e 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -316,7 +316,7 @@
   'data': { 'version': 'int',
             'emulated': 'bool',
             'kernel': 'bool' },
-  'if': 'TARGET_ARM' }
+  'if': 'CONFIG_ARM_GIC' }
 
 ##
 # @query-gic-capabilities:
@@ -335,7 +335,7 @@
 #                     { "version": 3, "emulated": false, "kernel": true } ] }
 ##
 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
-  'if': 'TARGET_ARM' }
+  'if': 'CONFIG_ARM_GIC' }
 
 ##
 # @SGXEPCSection:
diff --git a/hw/intc/arm_gic_qmp.c b/hw/intc/arm_gic_qmp.c
index 71056a0c10..1fc79c775b 100644
--- a/hw/intc/arm_gic_qmp.c
+++ b/hw/intc/arm_gic_qmp.c
@@ -6,6 +6,8 @@
 
 #include "qemu/osdep.h"
 #include "qapi/util.h"
+
+#include CONFIG_DEVICES
 #include "qapi/qapi-commands-misc-target.h"
 #include "kvm_arm.h"
 
diff --git a/hw/intc/meson.build b/hw/intc/meson.build
index 45d3503d49..b9550967e2 100644
--- a/hw/intc/meson.build
+++ b/hw/intc/meson.build
@@ -39,7 +39,7 @@ if config_all_devices.has_key('CONFIG_APIC') or \
 endif
 
 specific_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c', 'apic_common.c'))
-specific_ss.add(when: 'CONFIG_ARM', if_true: files('arm_gic_qmp.c'))
+specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gic_qmp.c'))
 specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif_common.c'))
 specific_ss.add(when: 'CONFIG_ARM_GICV3_TCG', if_true: files('arm_gicv3_cpuif.c'))
 specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c'))
-- 
2.45.2



  parent reply	other threads:[~2024-08-06 14:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 14:19 [RFC PATCH-for-9.1? 0/2] hw/intc/arm_gic: Only provide query-gic-capabilities when GIC built-in Philippe Mathieu-Daudé
2024-08-06 14:19 ` [RFC PATCH-for-9.1? 1/2] target/arm: Move qmp_query_gic_capabilities() to hw/intc/ Philippe Mathieu-Daudé
2024-08-07  3:46   ` Richard Henderson
2024-08-07  7:31     ` Philippe Mathieu-Daudé
2024-08-07 16:17     ` Peter Maydell
2024-08-08  4:32       ` Markus Armbruster
2024-08-08  8:44         ` Peter Maydell
2024-08-08  9:02           ` Markus Armbruster
2024-08-08 10:15             ` Peter Maydell
2024-08-08 11:05               ` Markus Armbruster
2024-08-08 11:23               ` Daniel P. Berrangé
2024-08-08 11:32                 ` Peter Maydell
2024-08-08 11:48                   ` Daniel P. Berrangé
2024-08-08 11:56                     ` Daniel P. Berrangé
2024-08-08 12:04                     ` Peter Maydell
2024-08-07  5:12   ` Markus Armbruster
2024-08-07  7:28     ` Philippe Mathieu-Daudé
2024-08-07  8:16       ` Markus Armbruster
2024-08-06 14:19 ` Philippe Mathieu-Daudé [this message]
2024-08-07  3:47   ` [RFC PATCH-for-9.1? 2/2] hw/intc/arm_gic: Only provide query-gic-capabilities when GIC built-in Richard Henderson
2024-08-07  8:18   ` Markus Armbruster
2024-08-07  9:03     ` Philippe Mathieu-Daudé
2024-08-07 11:10       ` Markus Armbruster
2024-08-07 16:30         ` Peter Maydell
2024-08-08  5:35           ` Markus Armbruster
2024-08-08  8:48             ` Peter Maydell
2025-03-11 11:39 ` [RFC PATCH-for-9.1? 0/2] " 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=20240806141940.22095-3-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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).