From patchwork Wed May 14 23:41:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 889896 Delivered-To: patch@linaro.org Received: by 2002:adf:fd8a:0:b0:3a1:f579:ae88 with SMTP id d10csp2875962wrr; Wed, 14 May 2025 16:43:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVxIlDxzCfqP9xhTbWf7VRMinhHPxYQQLvC/+PvlvfrIYQL5nrXLnKDkksXNOYWqqZANAUQ+Q==@linaro.org X-Google-Smtp-Source: AGHT+IGKhVoOO+Re5N6BBHQ/7eOOYHkRsVfcjI2ViSMm0JwUijnHJk0XRBYAMaOgYWZ0QXI3J1xW X-Received: by 2002:a05:620a:4051:b0:7c5:4c49:769c with SMTP id af79cd13be357-7cd3c652791mr46155485a.6.1747266203404; Wed, 14 May 2025 16:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747266203; cv=none; d=google.com; s=arc-20240605; b=LxUHx63ylz/ErOkj36kcfNQBsFnoLyNztZ7Ijv9yiiprzeO6ZnkkS/Jd2qNsbsk5BE yMSw5x6L2VX0kOD2WPwJnTjI3sHo7INS+bl6iqNSgNQ7h0qA4jpHkgWAy4rZDHTqzYvD ABCUy/peUdlBkVqeN04MwY/iDxPNck0o42T6nxzhhqLJmBrEFikgmwvoQreu5Yg3cD9u 0rNoiTJxcy7M8K1vwitv8ZfaB5H7nSIc0vWHi7/ancXMm5Uhlq3jYrHgWi1ZHkcH7ET6 WgRDK3GeVkmvArpteqVapaSpUpGIDjO6cqEOni5Zm0M3R1aoxc7cNAm5mINVzmGP8LnO KnRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NqewT8RcOqdr655RwHxx5Aazd/ICT+n56pHpqqFvRbw=; fh=VLmoI/6EX8QpenFjusv8qhWaEfIPciazAbyYTbMJFJo=; b=emEiUX+YD4RKCBLYtqu39djoUQxoLzGcG3i4ZYHqqS38uBbfEIzpUnopPCG1Sk+/iR FzSEZWxCIXUqwpJeowiFMfxJ6YgWA9kXM5D3+gL0cX7ECx5TrALpyYHG7Ve9bE23nzmE HTE5+RPHHKX/0c1tzzQwZheH32CNK1vM7gZf0WN1bHsMjOAg3ejWZmHkwoiKABgllPdi cxJek6wZQtVZLBcQk66BOBm4zZlGbci2An+oi9eOAwd/m1MwRV0CZSkjCwAai0CTZKrl etuKsHfUWQ8JlC++wdShMhc652bxc8jSIyDtL4p+Ew7rD57il6vh9+zIRBbWVeXcP3mg Dl/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W1izTu/2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cd00fed4e1si1441405185a.475.2025.05.14.16.43.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 May 2025 16:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W1izTu/2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uFLj4-0001Uq-5c; Wed, 14 May 2025 19:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uFLj1-0001Pa-Lb for qemu-devel@nongnu.org; Wed, 14 May 2025 19:41:23 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uFLiz-00032O-19 for qemu-devel@nongnu.org; Wed, 14 May 2025 19:41:23 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-22e4db05fe8so3181665ad.0 for ; Wed, 14 May 2025 16:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747266079; x=1747870879; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NqewT8RcOqdr655RwHxx5Aazd/ICT+n56pHpqqFvRbw=; b=W1izTu/2ffk7Q2JmQrNnRvEWmx9sjlbGNRTrFuLlENTIDVn5EQTqhK9z1zhQMcRNXI 8/Gfj+67yxtFT9M85WS3SS6h410F5P65jvEZEB31W5gblQS6pspUzYdspBZPZPMChQNO Sr4CilJvw7I3kNldP0SmEvNiX7Uixde5MVUh3j3z5roeYIqJcyo9p5wgDKq9MjyvVfdG qAhQB2YYEhTDzQi1RlM2n83QyvaA2IkjikM5p6qComuCO/1IoDvN5aa7MWS6s85d3MSs FCBcF48x9pEtwPEFdyTUtrGnq4o0eehqJl09fkNjOcET39+MJVkVg3ww+tzuOeqMAwH0 UQyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747266079; x=1747870879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NqewT8RcOqdr655RwHxx5Aazd/ICT+n56pHpqqFvRbw=; b=s4xgUqONjEBAHgS+RqCaAE5gJPa9TI79v3T/CffqoBKNBfJ9LbrCp+hCNNinKgOr70 kyu+c+P+BpKyY799wDim7xSzs0npuA0+TxzVQbxuo6IBQ7RUmiYdkWxEK6bCAiv9MPSu ukSI1DDQwxBTkIFMf1oP48VqlQ/ylS9GJYhr3fFIDMokIolUVNhNSQ7oX5n0WbSkezmL DhgrQrC1Mt/EK4FHPmyeK1mXqZWpe3v9AcHBFLmAlipbQ6h3Q0B0RwzJC+KAJ3HGgzNI YycKq5iLK9GfZZ9bF/Iyq2PJyhD5/YE76YM9lC8vHLbsA5E3FiuhJoHVJyz4zGpGUzPt NFfA== X-Gm-Message-State: AOJu0YzQ89Ens7ii3WsEExFxoHBbjSC/yPtAeCrmCZ8iOjOkMfL7nNcg 59Rg9UsLg+EVelS4E1J1+yrrxaxeHPVeAMHII9V+E0gKAgnod9r2qXgt++iP1TY0fnfithBlXZL s0gw= X-Gm-Gg: ASbGncuE9QYPv+4IZ7ksC9PnVIEchlkg8lFr5jgcvFFOxxvERaaOYnjGoJqrOtQLgBV VMj+vbAkgcenn4kfE40nVc/SPX7ksujnhuuF4YmMt0L7amj8V2vOl6fBdo2o3LYhLpMy9ZCnXlp Ah4zqc5Mk4LIK4q0YHAm2PdbUo4BOZHjNqv9HRW24iqIagXfIKPzUn2ax87X9J94CJcokHqNodl NpjzWvctBKbF78MeJApe15WYUdb7mjJ5pNEu3gjez/8y39ag50xjL5Q+F6GABINcIDpFjdB9tLL 1KF71/jo1f2I3LNQK0ohqInG7onhL5u30U8hOt/794UXoyHP9GM= X-Received: by 2002:a17:903:946:b0:22d:e57a:2795 with SMTP id d9443c01a7336-231b5ed186amr5294765ad.47.1747266079479; Wed, 14 May 2025 16:41:19 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22fc828b4e4sm104583615ad.182.2025.05.14.16.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 May 2025 16:41:19 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Michael Roth , alex.bennee@linaro.org, Paolo Bonzini , Thomas Huth , berrange@redhat.com, Richard Henderson , peter.maydell@linaro.org, Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 04/12] qapi: expose query-gic-capability command unconditionally Date: Wed, 14 May 2025 16:41:00 -0700 Message-ID: <20250514234108.3746675-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250514234108.3746675-1-pierrick.bouvier@linaro.org> References: <20250514234108.3746675-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé This removes the TARGET_ARM condition from the query-gic-capability command. This requires providing a QMP command stub for non-ARM targets. This in turn requires moving the command out of misc-target.json, since that will trigger symbol poisoning errors when built from target independent code. Following the earlier precedent, this creates a misc-arm.json file to hold this ARM specific command. Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-arm.json | 49 +++++++++++++++++++++++++++++++++++++++ qapi/misc-target.json | 44 ----------------------------------- qapi/qapi-schema.json | 1 + stubs/monitor-arm-gic.c | 12 ++++++++++ target/arm/arm-qmp-cmds.c | 2 +- qapi/meson.build | 1 + stubs/meson.build | 1 + 7 files changed, 65 insertions(+), 45 deletions(-) create mode 100644 qapi/misc-arm.json create mode 100644 stubs/monitor-arm-gic.c diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json new file mode 100644 index 00000000000..f5341372f5a --- /dev/null +++ b/qapi/misc-arm.json @@ -0,0 +1,49 @@ +# -*- Mode: Python -*- +# vim: filetype=python +# +# SPDX-License-Identifier: GPL-2.0-or-later + +## +# @GICCapability: +# +# The struct describes capability for a specific GIC (Generic +# Interrupt Controller) version. These bits are not only decided by +# QEMU/KVM software version, but also decided by the hardware that the +# program is running upon. +# +# @version: version of GIC to be described. Currently, only 2 and 3 +# are supported. +# +# @emulated: whether current QEMU/hardware supports emulated GIC +# device in user space. +# +# @kernel: whether current QEMU/hardware supports hardware accelerated +# GIC device in kernel. +# +# Since: 2.6 +## +{ 'struct': 'GICCapability', + 'data': { 'version': 'int', + 'emulated': 'bool', + 'kernel': 'bool' } } + +## +# @query-gic-capabilities: +# +# It will return a list of GICCapability objects that describe its +# capability bits. +# +# On non-ARM targets this command will report an error as the GIC +# technology is not applicable. +# +# Returns: a list of GICCapability objects. +# +# Since: 2.6 +# +# .. qmp-example:: +# +# -> { "execute": "query-gic-capabilities" } +# <- { "return": [{ "version": 2, "emulated": true, "kernel": false }, +# { "version": 3, "emulated": false, "kernel": true } ] } +## +{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index ba4403a9241..d36292b3321 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,50 +2,6 @@ # vim: filetype=python # -## -# @GICCapability: -# -# The struct describes capability for a specific GIC (Generic -# Interrupt Controller) version. These bits are not only decided by -# QEMU/KVM software version, but also decided by the hardware that the -# program is running upon. -# -# @version: version of GIC to be described. Currently, only 2 and 3 -# are supported. -# -# @emulated: whether current QEMU/hardware supports emulated GIC -# device in user space. -# -# @kernel: whether current QEMU/hardware supports hardware accelerated -# GIC device in kernel. -# -# Since: 2.6 -## -{ 'struct': 'GICCapability', - 'data': { 'version': 'int', - 'emulated': 'bool', - 'kernel': 'bool' }, - 'if': 'TARGET_ARM' } - -## -# @query-gic-capabilities: -# -# This command is ARM-only. It will return a list of GICCapability -# objects that describe its capability bits. -# -# Returns: a list of GICCapability objects. -# -# Since: 2.6 -# -# .. qmp-example:: -# -# -> { "execute": "query-gic-capabilities" } -# <- { "return": [{ "version": 2, "emulated": true, "kernel": false }, -# { "version": 3, "emulated": false, "kernel": true } ] } -## -{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'], - 'if': 'TARGET_ARM' } - ## # @SGXEPCSection: # diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 96f6aa44133..e96bff8d38c 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -61,6 +61,7 @@ { 'include': 'replay.json' } { 'include': 'yank.json' } { 'include': 'misc.json' } +{ 'include': 'misc-arm.json' } { 'include': 'misc-i386.json' } { 'include': 'misc-target.json' } { 'include': 'audio.json' } diff --git a/stubs/monitor-arm-gic.c b/stubs/monitor-arm-gic.c new file mode 100644 index 00000000000..b3429243ef8 --- /dev/null +++ b/stubs/monitor-arm-gic.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-misc-arm.h" + + +GICCapabilityList *qmp_query_gic_capabilities(Error **errp) +{ + error_setg(errp, "GIC hardware is not available on this target"); + return NULL; +} diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index a1a944adb43..ef18c867ca4 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -27,7 +27,7 @@ #include "qapi/visitor.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-commands-machine-target.h" -#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qapi-commands-misc-arm.h" #include "qobject/qdict.h" #include "qom/qom-qobject.h" diff --git a/qapi/meson.build b/qapi/meson.build index 3a9bd061047..5e93e6b8cfd 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -64,6 +64,7 @@ if have_system 'qdev', 'pci', 'rocker', + 'misc-arm', 'misc-i386', 'tpm', 'uefi', diff --git a/stubs/meson.build b/stubs/meson.build index 9922ec7b88e..07e9d3799a5 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -77,6 +77,7 @@ if have_system stub_ss.add(files('target-monitor-defs.c')) stub_ss.add(files('win32-kbd-hook.c')) stub_ss.add(files('xen-hw-stub.c')) + stub_ss.add(files('monitor-arm-gic.c')) stub_ss.add(files('monitor-i386-rtc.c')) stub_ss.add(files('monitor-i386-sev.c')) endif