From patchwork Thu May 22 19:05:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891717 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806237wrm; Thu, 22 May 2025 12:08:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVo9CiPCOA/7CLW5V5A++l1mbmZNGVHWypgAK2+yc0LwSU4/AsTiLPPxzRE9bdwdCb7wKe7IQ==@linaro.org X-Google-Smtp-Source: AGHT+IHnLLhTs9InVw8Q4PaUdYTxtJ/7Nd4hb4fW2gpDQTPxHO3cir46DwZ6Wj9OiauqJRc3URsZ X-Received: by 2002:a05:6e02:198d:b0:3dc:90fc:2837 with SMTP id e9e14a558f8ab-3dc92bf67e5mr7035265ab.8.1747940896021; Thu, 22 May 2025 12:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940896; cv=none; d=google.com; s=arc-20240605; b=kNK/psJg889WJhQo3CRdXO1R7dxhgGYXymY8OV8cTfgQXwm73z2D6RQSIrvTxhbkUQ SDmaLxrlPeLQSjJitV1H5ROHsKn7l97RawnSaNCyrujwSrRZ8X/rObxWRfxDayzkAZY4 uDKnW+rTFarfecokoCoINVPzs133jx5goXz6QR08s/5s6ISftZMChUI4fF++FACrVyOk Ssyc8jQAYPNz57y8dAV/nblcYxzMZIkzsS7LxRLng3CrXPwxrCHromEU2VrbbVSA9+Q/ GasFe6yc+Xn5KG84a2oQPPashbjjRkBITFWrLbD8MhdLbiW9e6LM1Dic4gZKlsDJCxFq ZtgA== 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=0N4C9DptqevA9wK4usU3+DxvuKBaI+3ZGbXSlc09sfk=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=de2R9dXMHELN5Bp31RUAjQ0D6f6k5H9oCcxSVyUs3rwzSybf28+ApK4Z7ZzXweYq8N +omcHYazp9SodFaYMV4kkfjmBqm/a8BYkO4t5xoOLBBpFESFDC2g0laAV7bCKdnGI8pP SXk5DgEiDM0e+y1eHkCSUVQBmEWjd3H2v36cAFIp6sSr/TLAsAlemlj+4lTshjxP/9qV X8piiS3MN9qgXNtZfX058AFwh+C/hre+gLRc5EVBfzZw4NGicTyE7vlyZlOvVPsj/prD laKYi/VQeUWCKeemwM7tFvUXLOhj4zfYaKrXjRn+9FfC7EuZEgXJ6rLORXo26yfdNsPb jiXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvMtgx0r; 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 e9e14a558f8ab-3dc875f44c6si53449105ab.1.2025.05.22.12.08.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:16 -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=fvMtgx0r; 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 1uIBEp-0000uy-NB; Thu, 22 May 2025 15:05:55 -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 1uIBEm-0000uF-W5 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:53 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEk-0006Rg-Nm for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:52 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7398d65476eso163539b3a.1 for ; Thu, 22 May 2025 12:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940749; x=1748545549; 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=0N4C9DptqevA9wK4usU3+DxvuKBaI+3ZGbXSlc09sfk=; b=fvMtgx0rHhSJPe7Jicc2QMVNTB54yhnZj7Ncz3EZgTdP/IAXwNvS5b3HNALTkzv6vv Z5RAo1cBmWq+41y6ATIlV5CxKYEaq9oJH8s9ERcRJtds5JdkQyZ9PtEHaN6f6U55V2T4 4WE5R7KClIU5iIchgmt4nzv2au7P/9Ner41Al7IMPe83xyKr9xSmqoOLNU9JoOiAcmwm HcnTV+kZQ6Bklbz/UJX9OIkgasIa5cRNuZAT3tULMmte3ixzpWRV6i0MGOL1PCJbdLao v4kO/63gP2A+w9cLxKCbsZZuU2pcgcczp6E3pzTn1xN99h605TbslQEKATMT99macJKG mUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940749; x=1748545549; 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=0N4C9DptqevA9wK4usU3+DxvuKBaI+3ZGbXSlc09sfk=; b=UczxtQTXhUhCgmDtIqqgvKVSGVIo2sHZhcZoNgKI1g9wFlVj3obfI4dHYN7gtS6dM4 LZ3VQcxw7g94XslTAs2CmH4jXCQdddVvJyvZezjxhRDZSXsmZzTWdhWqG46ysgHkFUSJ ZR3PVOrDfx0BKaSYC83DPuQbL5CGNM4zqfHFbBP7B5yFa6dAuzcbyNRKkMVnYCKF6HAs oESgDLSZ58hj9Hb0T+WXZvFyO6pN35H4HF2xg/nJn9vk3pu5tAuE6FCuu2PmaLOW0RIm PNQtTb4oyCVexOVcyS6nbRIKS1JBDjKWeJBlMP+5t7g9N/6a1yyWcS3M+8AsAVyHbc1a p4yQ== X-Gm-Message-State: AOJu0YzyvDqpGWrIC+QrCwws2CPNweyHL3d7QNLKo981nO4ciWon5ieU EAPTUbLM4vaZnEm8O62T6+C9825YLwe6WCji53gIQuVcf1E9GRfisznUHi9we/atx8Gw3Kt0dU7 wEhmJ X-Gm-Gg: ASbGncvLnKucg1l8bQFX1MFXcUFFcv8KXm4IcMn95UK8GNk8QbUZA4eV7/QAU7cqwJD LmvRwvFrNUvvTNEyKFkCDLkKnVUOcdEnFaHBnt8vUexxa/8fmUpjmR/Svv8mGuIDDCUYk9I/1Ny CXS9KW6Z2KcvjE5ogTaerJrag6SyrPsSwBRmEs80gm8jFJosf9+aNZMSSgRlxNM8uvS7S/CWjgH xlkl8C/k/YVnQgElp0p0zi7zarx5EIdZ9oI/i19VARvKKBBXDOoTdWsY0syOEvF3rwu5LB1+tdP 7aYLJRZ8dpe5RPTgOmakYZr1MM+uXgrw3LCBkAAZnnhTHxroJfI= X-Received: by 2002:a05:6a00:e06:b0:742:b31e:e9c1 with SMTP id d2e1a72fcca58-745ece8e3c9mr778740b3a.11.1747940749349; Thu, 22 May 2025 12:05:49 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:48 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 01/15] qapi: expose rtc-reset-reinjection command unconditionally Date: Thu, 22 May 2025 12:05:28 -0700 Message-ID: <20250522190542.588267-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x436.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_I386 condition from the rtc-reset-reinjection command. This requires providing a QMP command stub for non-i386 target. 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. Rather than putting the command into misc.json, it is proposed to create misc-$TARGET.json files to hold commands whose impl is conceptually only applicable to a single target. This gives an obvious docs hint to consumers that the command is only useful in relation a specific target, while misc.json is for commands applicable to 2 or more targets. The current impl of qmp_rtc_reset_reinject() is a no-op if the i386 RTC is disabled in Kconfig, or if the running machine type lack any RTC device. The stub impl for non-i386 targets retains this no-op behaviour. However, it is now reporting an Error mentioning this command is not available for current target. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 24 ++++++++++++++++++++++++ qapi/misc-target.json | 17 ----------------- qapi/qapi-schema.json | 1 + hw/i386/monitor.c | 2 +- stubs/monitor-i386-rtc.c | 12 ++++++++++++ qapi/meson.build | 1 + stubs/meson.build | 1 + 7 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 qapi/misc-i386.json create mode 100644 stubs/monitor-i386-rtc.c diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json new file mode 100644 index 00000000000..d5bfd91405e --- /dev/null +++ b/qapi/misc-i386.json @@ -0,0 +1,24 @@ +# -*- Mode: Python -*- +# vim: filetype=python +# +# SPDX-License-Identifier: GPL-2.0-or-later + +## +# @rtc-reset-reinjection: +# +# This command will reset the RTC interrupt reinjection backlog. Can +# be used if another mechanism to synchronize guest time is in effect, +# for example QEMU guest agent's guest-set-time command. +# +# Use of this command is only applicable for x86 machines with an RTC, +# and on other machines will silently return without performing any +# action. +# +# Since: 2.1 +# +# .. qmp-example:: +# +# -> { "execute": "rtc-reset-reinjection" } +# <- { "return": {} } +## +{ 'command': 'rtc-reset-reinjection' } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index f7ec695caad..c5f9f6be7e1 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,23 +2,6 @@ # vim: filetype=python # -## -# @rtc-reset-reinjection: -# -# This command will reset the RTC interrupt reinjection backlog. Can -# be used if another mechanism to synchronize guest time is in effect, -# for example QEMU guest agent's guest-set-time command. -# -# Since: 2.1 -# -# .. qmp-example:: -# -# -> { "execute": "rtc-reset-reinjection" } -# <- { "return": {} } -## -{ 'command': 'rtc-reset-reinjection', - 'if': 'TARGET_I386' } - ## # @SevState: # diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 7bc600bb768..96f6aa44133 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-i386.json' } { 'include': 'misc-target.json' } { 'include': 'audio.json' } { 'include': 'acpi.json' } diff --git a/hw/i386/monitor.c b/hw/i386/monitor.c index 1921e4d52e9..79df96562f6 100644 --- a/hw/i386/monitor.c +++ b/hw/i386/monitor.c @@ -26,7 +26,7 @@ #include "monitor/monitor.h" #include "qobject/qdict.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qapi-commands-misc-i386.h" #include "hw/i386/x86.h" #include "hw/rtc/mc146818rtc.h" diff --git a/stubs/monitor-i386-rtc.c b/stubs/monitor-i386-rtc.c new file mode 100644 index 00000000000..8420d7c93c2 --- /dev/null +++ b/stubs/monitor-i386-rtc.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-i386.h" + +void qmp_rtc_reset_reinjection(Error **errp) +{ + error_setg(errp, + "RTC interrupt reinjection backlog reset is not available for" + "this machine"); +} diff --git a/qapi/meson.build b/qapi/meson.build index eadde4db307..3a9bd061047 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -64,6 +64,7 @@ if have_system 'qdev', 'pci', 'rocker', + 'misc-i386', 'tpm', 'uefi', ] diff --git a/stubs/meson.build b/stubs/meson.build index 63392f5e785..9907b54c1e6 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-i386-rtc.c')) endif if have_system or have_user From patchwork Thu May 22 19:05:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891707 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2805294wrm; Thu, 22 May 2025 12:06:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWaNve0vjGh1aKKlOWOAFZJlT0mzeT0RRe6MmVLuyDpeDCVNOcXr0OoIu+9fv//hBYPcPvQ5Q==@linaro.org X-Google-Smtp-Source: AGHT+IGjl+FtJawSotoXUDBg5HWSL8lVso4bAk7MDC2BltbcD9H0zxF7tV58PnQjlf0fJhCeJvpc X-Received: by 2002:a05:6602:488d:b0:85d:a5d3:618c with SMTP id ca18e2360f4ac-86caf1070aemr18427539f.11.1747940780066; Thu, 22 May 2025 12:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940780; cv=none; d=google.com; s=arc-20240605; b=lYzw+cRZqZ5yowFL6gFuBhbeM4RltPFNp+Hq1Q25viJmNlWhDbcPDtdnbq3TAW8gHn M9pBEuhp2mHH06czsWM5YHKoRe6zTnToXNBdXtbImI4uu9yWt47eMf+Lzd3cONPSGGtJ mtw/r0Fhm8dM9CqVoLhTPZELKMDDBAZ5/m3KYMzBPfHXbp7cNq9GWORdokxmRbmBiRjA hvzQ5bXiWpGICVGouOgThbNCjcnLFrHdRp9O/lj4mabuSSKeJPCYJ+PkbeOVDTVZa9pd Yw0FefVh4eA5He3IomFHZ0BMW3nHDWcAEj5GAlESOlZ6vIJlHBEpELYLzdUlS2m9qnx9 EDUQ== 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=fNQNvYWp/z3kSBykHJK9nPCJGqDZwEVbVWsgm8QVtr4=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=LMZ2RUDrFMa7L4KV3hmLutzZPO8h13mkdjBniGl7GMrelauOE1Sd3RWdk76epFgILC TXoaa3PkD2KFwoohtMPVJYtTLSNXI7V+sF/Rn21fUPConTp9gYzhs6g/3jCg3pfC0q3N tVu4TUxpyZ0ddAUJDq9FoZhN5N9R+vdZR5TCXsSFtjXqnTQmrm+hJXuMybt6drPY4ILQ 3yqv7zmAxgb27PQr/SIrYhreLloC7VblP3psre3kJHLYWdsVCPOOmwvpTxqu1QheIzNa 52bT9A4VsygDBNUeuNG4c1/J5UdspQmEo9twmjg3mllDVQWgOMc7i9fBZTWaxkZzcGUJ gvzA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dTWJWjJn; 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 8926c6da1cb9f-4fbcc4b2e96si16072158173.118.2025.05.22.12.06.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:06:20 -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=dTWJWjJn; 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 1uIBEv-0000vl-0F; Thu, 22 May 2025 15:06:01 -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 1uIBEo-0000up-DG for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:54 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEm-0006Rz-KT for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:54 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-73c17c770a7so8932607b3a.2 for ; Thu, 22 May 2025 12:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940751; x=1748545551; 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=fNQNvYWp/z3kSBykHJK9nPCJGqDZwEVbVWsgm8QVtr4=; b=dTWJWjJnh2Blz8nOWuKHNph+Z8a8NomPeSV7TWpvODGLKs0lF3q8mekcSxX9BULLUE vi+VFuJgnHuqo5FkKbxfSbm97CKetq8MtnuIqSgyikFMldbY8jU2Ri47bvSeWqLV1Klm fRiLzeiqHhaDvwPX2lra2ou4ZAqsQlUb9PEV8C2Ppi3DI4DZ3Rwj8sS0+R0RbhAT/Oby NXHSjo7aPkVRmJqeTlwlhpULL9BiEITlkAc8HYiciCcHfteuoMeuHDyehxRh7QPao6LN Pi4hfVqTD9Ysvy+zqM3p8jygezwcqaVBO75sOP25S1uvieIv8ZU70GHfVRk0vk+y9Srh KjIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940751; x=1748545551; 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=fNQNvYWp/z3kSBykHJK9nPCJGqDZwEVbVWsgm8QVtr4=; b=ekj3+oFktU6UguutG1GzNAaB+MUQmg9uUeR7th0kjQJG28t90Ai4uE7WN/4tm6JdvW gXJz5jwSdC3J3q3nDuy7DGl591k2Skln1TfuTS4GZpS057G/bHTNd0o6o8iX4GEVuh2+ NURwVWSqoJFyBaOJxe0wjjdST0C64OrKvFp+Y1LWDvQwuAAIqEUFodcrBjlPf7MzBZyI /lFG8uo51s4Hb8zGoTOUmTGOizxz+2WUEZ9pZO0kbtJ+CynytroivLH55HTnwzV6SLaO KLnRXUncw8BzD+eoF2iFAc1/Vavm4KxT+YySrMeN3cOb4feRCtBEg7eUZzhvALf+p47j nC6w== X-Gm-Message-State: AOJu0YzkAGQT5N1m00Q7vakfCIqalEnJrxwp5hASrGZZIXHeNZLAi2cI 6ElnGXm5BdntpGjw+CxQEhqb+QaMIBV12Hp7ScFDBKTRTi8l3WKtCQrlVTwJO+Ph8pkUaNxxLM0 MePvw X-Gm-Gg: ASbGncumUF6Xngf5ttWzjuKgzJEc3Y66/6a/a8FIN3nyeL7xTcGaBHEK0yc85l+/bkP GFhjBUhRMirbYWdMcY0tcp57K8PKXeAVSlVuxtBh6dZDChYBTE2pGi2u3aNlVJEODYEAoSxOxU0 DTLAUM92HsHebPhaWancv9lyJp1hfp/sfJD8QLUIY8lzXCl8HsGl7y0piq43m7eZvla7fajy5VQ 1sKcEcq+xyQoHUz8dYoYOM+JSN7YT13PYMQ5RxO211pxM0MtjNOXth5xh64Ld55H9w1HDk73iT6 w/Wcs20Ajrv9Fgv7amIcMOqoDrlTw5yjLiWvsQm4/iWFcNO+moY= X-Received: by 2002:a05:6a00:3a04:b0:732:a24:7354 with SMTP id d2e1a72fcca58-745ed84a0d9mr328091b3a.4.1747940750891; Thu, 22 May 2025 12:05:50 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:49 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 02/15] qapi: expand docs for SEV commands Date: Thu, 22 May 2025 12:05:29 -0700 Message-ID: <20250522190542.588267-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x435.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 gives some more context about the behaviour of the commands in unsupported guest configuration or platform scenarios. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-target.json | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/qapi/misc-target.json b/qapi/misc-target.json index c5f9f6be7e1..6b857efc1cc 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -110,7 +110,11 @@ ## # @query-sev: # -# Returns information about SEV +# Returns information about SEV/SEV-ES/SEV-SNP. +# +# If unavailable due to an incompatible configuration the +# returned @enabled field will be set to 'false' and the +# state of all other fields is undefined. # # Returns: @SevInfo # @@ -141,7 +145,16 @@ ## # @query-sev-launch-measure: # -# Query the SEV guest launch information. +# Query the SEV/SEV-ES guest launch information. +# +# This is only valid on x86 machines configured with KVM and the +# 'sev-guest' confidential virtualization object. The launch +# measurement for SEV-SNP guests is only available within +# the guest. +# +# This will return an error if the launch measurement is +# unavailable, either due to an invalid guest configuration +# or if the guest has not reached the required SEV state. # # Returns: The @SevLaunchMeasureInfo for the guest # @@ -185,8 +198,9 @@ ## # @query-sev-capabilities: # -# This command is used to get the SEV capabilities, and is supported -# on AMD X86 platforms only. +# This command is used to get the SEV capabilities, and is only +# supported on AMD X86 platforms with KVM enabled. If SEV is not +# available on the platform an error will be returned. # # Returns: SevCapability objects. # @@ -205,7 +219,15 @@ ## # @sev-inject-launch-secret: # -# This command injects a secret blob into memory of SEV guest. +# This command injects a secret blob into memory of a SEV/SEV-ES guest. +# +# This is only valid on x86 machines configured with KVM and the +# 'sev-guest' confidential virtualization object. SEV-SNP guests +# do not support launch secret injection +# +# This will return an error if launch secret injection is not possible, +# either due to an invalid guest configuration, or if the guest has not +# reached the required SEV state. # # @packet-header: the launch secret packet header encoded in base64 # @@ -236,8 +258,15 @@ ## # @query-sev-attestation-report: # -# This command is used to get the SEV attestation report, and is -# supported on AMD X86 platforms only. +# This command is used to get the SEV attestation report. +# +# This is only valid on x86 machines configured with KVM and the +# 'sev-guest' confidential virtualization object. The attestation +# report for SEV-SNP guests is only available within the guest. +# +# This will return an error if the attestation report is +# unavailable, either due to an invalid guest configuration +# or if the guest has not reached the required SEV state. # # @mnonce: a random 16 bytes value encoded in base64 (it will be # included in report) From patchwork Thu May 22 19:05:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891715 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806082wrm; Thu, 22 May 2025 12:07:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUR8Pz8BBvVmd6T21fpZ6yf4vzmefnDAn0urqTjKZ8UTjY++Qx1UQDa99KTtNcB+5H/RpUVxw==@linaro.org X-Google-Smtp-Source: AGHT+IGVTcEKht9xnuByWzyso0JnK1lhgpyMK4TTXdaF4rEeApEVJdXKXO6oJIqT0GaBc008RtoK X-Received: by 2002:a05:6e02:1745:b0:3db:7b4c:309b with SMTP id e9e14a558f8ab-3db8429768amr318918825ab.2.1747940875624; Thu, 22 May 2025 12:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940875; cv=none; d=google.com; s=arc-20240605; b=G4vmYPKYefkL31fg96P4jyLNkAgI45kIVfT6NudnwZfI1MJr9FeIbJvViHMAzHoJu2 K/s+hsL2zNXrtgx06mAvdEyFBTCkEzglzKo011Efl/a8FGt9Yt45cQ7ao6cPASLnJGYG dM+uGgrGO1ptyouqxrgXCfg5utpKrG/vqSitIa1YRWGuzSEaQZBJsXGOIh2DuBcs+r8o ptDw7vNoTKGfPwVMbnhBd/Ko3cvGOl3INhmBDNMGXSc7WvdaIki/UuUvNttp9VNjjpJf h0uilkkGxdZ2otkXDyqb8cWzdTf1d3cBJO7OHj28X9hBQkjxwYumWSGDVXCRVBICzCwk L2Sg== 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=htF0VZgASZ43ct5qX/VW/MjRlaWWMAyaJawS0GNM9SY=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=LPOLAv2K3qXEAVXS2FNjUrm4jsFy8t17NvTyBK/tEfwBs0XdiziDdhxLeUYbgECwXo beqKUyVYEptT1/cXpwslX7S1Ga6GW2+6iLXNMTPbSqIlwOMUjzyoUViX8sREgU/WUAlP 6T2CfCO4NuqKuqDvB2uXdR2/9m7HRYxJzCUNZwtHS6PreTNPxYwu4Kvsi70jBCflBpKh s6vdFINaWaxNKZPerjWxnJGjPcyKuQWFYnKcH/g73FWOSOsnniQI3/XK/F5HJoFd9NEz gtkb4NsdSzKgeHy5+GTb0ve8eVzVOHxZPkb/cQHV8QWOu7s2ifn35GcNFjU5OOx5pY5i bt0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rZVshwKi; 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 8926c6da1cb9f-4fbcc4bed85si11585672173.146.2025.05.22.12.07.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:55 -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=rZVshwKi; 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 1uIBEy-0000wN-5N; Thu, 22 May 2025 15:06:05 -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 1uIBEq-0000vG-74 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:57 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEn-0006SD-DQ for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:55 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-742c035f2afso3759295b3a.2 for ; Thu, 22 May 2025 12:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940752; x=1748545552; 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=htF0VZgASZ43ct5qX/VW/MjRlaWWMAyaJawS0GNM9SY=; b=rZVshwKiv7YJKwqEubwpD1EIjZGaj4c7RpFql/Clvofgg916OPswb2OzmzizE5uFNT MeLG5sbJWrAEuRx7wTc9d9YDjaAfTbfex8DAYAlVlZC5eZOaN4E3FDown2UcsdgI2PtU /aNUHYGvlrggZFAfH2pcU6r+WG1wpilkEnqREgDybMmDmZ0BaXhFZDBwAoe7hgWf2XQ5 v7EVUVFHpNbaMftFShEwZiy1EsaAHp8WfWKdylz9lt91eIH6gMiIsq4LX2qTnlsYUF/+ rCW1qMusjQYfBlEQM0BqE4eJlwt63pcmGZWpB5UNiIQIfYiY+xQPw0oDu8exjs1Ts66A nXaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940752; x=1748545552; 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=htF0VZgASZ43ct5qX/VW/MjRlaWWMAyaJawS0GNM9SY=; b=n2vT3b3P/WpQobr46McmkRxbYaXRr5UZTwMIrxw7DZbNr0zUwjnPNkySEYYzB9hNDh xzOMu/R2LdCpOvTuUGmrFijDoaAXhu6GinQDi/+taypjzjOY/0qfdTdyE2AGdW3yyfn8 QjTdRuzvdnx9mRWx+o1Sv2JtA9y94Mzxj88BLG721izz7IjH5vUGHpHIINkWtRgW1ReW ghLO/rVAZzZXVYwM0/GAB7vvXWRzLRZyQ5XkQ4359GJT22URiR2+QUMguCG7MK/MHz6L ixEHzkvQVZNTga1DrHlbXvh+J9No4Gykn6ou9q23h40J2O128dbLdSgfFJ8L3q0PzpCJ Z94A== X-Gm-Message-State: AOJu0Yzbj1T8RsjE06prce6GlVQzHA108BE1FMu2hQYCQAOk8vOMjWGD a2r8zYnscQeGTZ7dXTrELfE54h2tf3tMeDSqSNDYyt+hUq+XgZgSSNMo0daq8A+20C8jK9fVqCa 8aGEP X-Gm-Gg: ASbGncvkdIZ/yRKqc75CJeuDIhiDWCf6auPqOS2z6TOalF4SXxBs2kOx3Z566Z+JMwO oMUH125DF7xFifQZKcyhuOz35n7pcfA2P1FgjPY3pFPbpjUTFBbt4FCVIEQOoeAQgLbRxsv6lLz lso3MdpJ8CP3xHON95U4hRgM0OvQV1pOiOa5pJ7BND5rm/ptTlgvZ+arpwRUmZgzlF4bRVnUIIi RX41ygSIZJkkumdC/GBS3VaXDEZMViCrAEkVAC8Xxcl04C0qSpXwpJVNuic8iE9qzVKjvHGTzcl YwfrlxZZgSbGgLZsgV2ztcdXVCUgotVl5HOZZCAWpkTqOjRhPp4= X-Received: by 2002:a05:6a20:258e:b0:1f5:7fcb:397d with SMTP id adf61e73a8af0-2162189eedemr36771719637.16.1747940751836; Thu, 22 May 2025 12:05:51 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:51 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 03/15] qapi: make SEV commands unconditionally available Date: Thu, 22 May 2025 12:05:30 -0700 Message-ID: <20250522190542.588267-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42e.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_I386 condition from the SEV confidential virtualization commands, moving them to the recently introduced misc-i386.json QAPI file, given they are inherantly i386 specific commands. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 271 ++++++++++++++++++++++++++++++++ qapi/misc-target.json | 284 ---------------------------------- stubs/monitor-i386-sev.c | 36 +++++ target/i386/sev-system-stub.c | 32 ---- target/i386/sev.c | 2 +- stubs/meson.build | 1 + 6 files changed, 309 insertions(+), 317 deletions(-) create mode 100644 stubs/monitor-i386-sev.c diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json index d5bfd91405e..de0e4ab67ff 100644 --- a/qapi/misc-i386.json +++ b/qapi/misc-i386.json @@ -22,3 +22,274 @@ # <- { "return": {} } ## { 'command': 'rtc-reset-reinjection' } + +## +# @SevState: +# +# An enumeration of SEV state information used during @query-sev. +# +# @uninit: The guest is uninitialized. +# +# @launch-update: The guest is currently being launched; plaintext +# data and register state is being imported. +# +# @launch-secret: The guest is currently being launched; ciphertext +# data is being imported. +# +# @running: The guest is fully launched or migrated in. +# +# @send-update: The guest is currently being migrated out to another +# machine. +# +# @receive-update: The guest is currently being migrated from another +# machine. +# +# Since: 2.12 +## +{ 'enum': 'SevState', + 'data': ['uninit', 'launch-update', 'launch-secret', 'running', + 'send-update', 'receive-update' ] } + +## +# @SevGuestType: +# +# An enumeration indicating the type of SEV guest being run. +# +# @sev: The guest is a legacy SEV or SEV-ES guest. +# +# @sev-snp: The guest is an SEV-SNP guest. +# +# Since: 6.2 +## +{ 'enum': 'SevGuestType', + 'data': [ 'sev', 'sev-snp' ] } + +## +# @SevGuestInfo: +# +# Information specific to legacy SEV/SEV-ES guests. +# +# @policy: SEV policy value +# +# @handle: SEV firmware handle +# +# Since: 2.12 +## +{ 'struct': 'SevGuestInfo', + 'data': { 'policy': 'uint32', + 'handle': 'uint32' } } + +## +# @SevSnpGuestInfo: +# +# Information specific to SEV-SNP guests. +# +# @snp-policy: SEV-SNP policy value +# +# Since: 9.1 +## +{ 'struct': 'SevSnpGuestInfo', + 'data': { 'snp-policy': 'uint64' } } + +## +# @SevInfo: +# +# Information about Secure Encrypted Virtualization (SEV) support +# +# @enabled: true if SEV is active +# +# @api-major: SEV API major version +# +# @api-minor: SEV API minor version +# +# @build-id: SEV FW build id +# +# @state: SEV guest state +# +# @sev-type: Type of SEV guest being run +# +# Since: 2.12 +## +{ 'union': 'SevInfo', + 'base': { 'enabled': 'bool', + 'api-major': 'uint8', + 'api-minor' : 'uint8', + 'build-id' : 'uint8', + 'state' : 'SevState', + 'sev-type' : 'SevGuestType' }, + 'discriminator': 'sev-type', + 'data': { + 'sev': 'SevGuestInfo', + 'sev-snp': 'SevSnpGuestInfo' } } + + +## +# @query-sev: +# +# Returns information about SEV/SEV-ES/SEV-SNP. +# +# If unavailable due to an incompatible configuration the +# returned @enabled field will be set to 'false' and the +# state of all other fields is undefined. +# +# Returns: @SevInfo +# +# Since: 2.12 +# +# .. qmp-example:: +# +# -> { "execute": "query-sev" } +# <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0, +# "build-id" : 0, "policy" : 0, "state" : "running", +# "handle" : 1 } } +## +{ 'command': 'query-sev', 'returns': 'SevInfo' } + +## +# @SevLaunchMeasureInfo: +# +# SEV Guest Launch measurement information +# +# @data: the measurement value encoded in base64 +# +# Since: 2.12 +## +{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} } + +## +# @query-sev-launch-measure: +# +# Query the SEV/SEV-ES guest launch information. +# +# This is only valid on x86 machines configured with KVM and the +# 'sev-guest' confidential virtualization object. The launch +# measurement for SEV-SNP guests is only available within +# the guest. +# +# This will return an error if the launch measurement is +# unavailable, either due to an invalid guest configuration +# or if the guest has not reached the required SEV state. +# +# Returns: The @SevLaunchMeasureInfo for the guest +# +# Since: 2.12 +# +# .. qmp-example:: +# +# -> { "execute": "query-sev-launch-measure" } +# <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } } +## +{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' } + +## +# @SevCapability: +# +# The struct describes capability for a Secure Encrypted +# Virtualization feature. +# +# @pdh: Platform Diffie-Hellman key (base64 encoded) +# +# @cert-chain: PDH certificate chain (base64 encoded) +# +# @cpu0-id: Unique ID of CPU0 (base64 encoded) (since 7.1) +# +# @cbitpos: C-bit location in page table entry +# +# @reduced-phys-bits: Number of physical Address bit reduction when +# SEV is enabled +# +# Since: 2.12 +## +{ 'struct': 'SevCapability', + 'data': { 'pdh': 'str', + 'cert-chain': 'str', + 'cpu0-id': 'str', + 'cbitpos': 'int', + 'reduced-phys-bits': 'int'} } + +## +# @query-sev-capabilities: +# +# This command is used to get the SEV capabilities, and is only +# supported on AMD X86 platforms with KVM enabled. If SEV is not +# available on the platform an error will be returned. +# +# Returns: SevCapability objects. +# +# Since: 2.12 +# +# .. qmp-example:: +# +# -> { "execute": "query-sev-capabilities" } +# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", +# "cpu0-id": "2lvmGwo+...61iEinw==", +# "cbitpos": 47, "reduced-phys-bits": 1}} +## +{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability' } + +## +# @sev-inject-launch-secret: +# +# This command injects a secret blob into memory of a SEV/SEV-ES guest. +# +# This is only valid on x86 machines configured with KVM and the +# 'sev-guest' confidential virtualization object. SEV-SNP guests +# do not support launch secret injection +# +# This will return an error if launch secret injection is not possible, +# either due to an invalid guest configuration, or if the guest has not +# reached the required SEV state. +# +# @packet-header: the launch secret packet header encoded in base64 +# +# @secret: the launch secret data to be injected encoded in base64 +# +# @gpa: the guest physical address where secret will be injected. +# +# Since: 6.0 +## +{ 'command': 'sev-inject-launch-secret', + 'data': { 'packet-header': 'str', 'secret': 'str', '*gpa': 'uint64' } } + +## +# @SevAttestationReport: +# +# The struct describes attestation report for a Secure Encrypted +# Virtualization feature. +# +# @data: guest attestation report (base64 encoded) +# +# Since: 6.1 +## +{ 'struct': 'SevAttestationReport', + 'data': { 'data': 'str'} } + +## +# @query-sev-attestation-report: +# +# This command is used to get the SEV attestation report. +# +# This is only valid on x86 machines configured with KVM and the +# 'sev-guest' confidential virtualization object. The attestation +# report for SEV-SNP guests is only available within the guest. +# +# This will return an error if the attestation report is +# unavailable, either due to an invalid guest configuration +# or if the guest has not reached the required SEV state. +# +# @mnonce: a random 16 bytes value encoded in base64 (it will be +# included in report) +# +# Returns: SevAttestationReport objects. +# +# Since: 6.1 +# +# .. qmp-example:: +# +# -> { "execute" : "query-sev-attestation-report", +# "arguments": { "mnonce": "aaaaaaa" } } +# <- { "return" : { "data": "aaaaaaaabbbddddd"} } +## +{ 'command': 'query-sev-attestation-report', + 'data': { 'mnonce': 'str' }, + 'returns': 'SevAttestationReport' } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index 6b857efc1cc..c0d7b311f30 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,290 +2,6 @@ # vim: filetype=python # -## -# @SevState: -# -# An enumeration of SEV state information used during @query-sev. -# -# @uninit: The guest is uninitialized. -# -# @launch-update: The guest is currently being launched; plaintext -# data and register state is being imported. -# -# @launch-secret: The guest is currently being launched; ciphertext -# data is being imported. -# -# @running: The guest is fully launched or migrated in. -# -# @send-update: The guest is currently being migrated out to another -# machine. -# -# @receive-update: The guest is currently being migrated from another -# machine. -# -# Since: 2.12 -## -{ 'enum': 'SevState', - 'data': ['uninit', 'launch-update', 'launch-secret', 'running', - 'send-update', 'receive-update' ], - 'if': 'TARGET_I386' } - -## -# @SevGuestType: -# -# An enumeration indicating the type of SEV guest being run. -# -# @sev: The guest is a legacy SEV or SEV-ES guest. -# -# @sev-snp: The guest is an SEV-SNP guest. -# -# Since: 6.2 -## -{ 'enum': 'SevGuestType', - 'data': [ 'sev', 'sev-snp' ], - 'if': 'TARGET_I386' } - -## -# @SevGuestInfo: -# -# Information specific to legacy SEV/SEV-ES guests. -# -# @policy: SEV policy value -# -# @handle: SEV firmware handle -# -# Since: 2.12 -## -{ 'struct': 'SevGuestInfo', - 'data': { 'policy': 'uint32', - 'handle': 'uint32' }, - 'if': 'TARGET_I386' } - -## -# @SevSnpGuestInfo: -# -# Information specific to SEV-SNP guests. -# -# @snp-policy: SEV-SNP policy value -# -# Since: 9.1 -## -{ 'struct': 'SevSnpGuestInfo', - 'data': { 'snp-policy': 'uint64' }, - 'if': 'TARGET_I386' } - -## -# @SevInfo: -# -# Information about Secure Encrypted Virtualization (SEV) support -# -# @enabled: true if SEV is active -# -# @api-major: SEV API major version -# -# @api-minor: SEV API minor version -# -# @build-id: SEV FW build id -# -# @state: SEV guest state -# -# @sev-type: Type of SEV guest being run -# -# Since: 2.12 -## -{ 'union': 'SevInfo', - 'base': { 'enabled': 'bool', - 'api-major': 'uint8', - 'api-minor' : 'uint8', - 'build-id' : 'uint8', - 'state' : 'SevState', - 'sev-type' : 'SevGuestType' }, - 'discriminator': 'sev-type', - 'data': { - 'sev': 'SevGuestInfo', - 'sev-snp': 'SevSnpGuestInfo' }, - 'if': 'TARGET_I386' } - - -## -# @query-sev: -# -# Returns information about SEV/SEV-ES/SEV-SNP. -# -# If unavailable due to an incompatible configuration the -# returned @enabled field will be set to 'false' and the -# state of all other fields is undefined. -# -# Returns: @SevInfo -# -# Since: 2.12 -# -# .. qmp-example:: -# -# -> { "execute": "query-sev" } -# <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0, -# "build-id" : 0, "policy" : 0, "state" : "running", -# "handle" : 1 } } -## -{ 'command': 'query-sev', 'returns': 'SevInfo', - 'if': 'TARGET_I386' } - -## -# @SevLaunchMeasureInfo: -# -# SEV Guest Launch measurement information -# -# @data: the measurement value encoded in base64 -# -# Since: 2.12 -## -{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'}, - 'if': 'TARGET_I386' } - -## -# @query-sev-launch-measure: -# -# Query the SEV/SEV-ES guest launch information. -# -# This is only valid on x86 machines configured with KVM and the -# 'sev-guest' confidential virtualization object. The launch -# measurement for SEV-SNP guests is only available within -# the guest. -# -# This will return an error if the launch measurement is -# unavailable, either due to an invalid guest configuration -# or if the guest has not reached the required SEV state. -# -# Returns: The @SevLaunchMeasureInfo for the guest -# -# Since: 2.12 -# -# .. qmp-example:: -# -# -> { "execute": "query-sev-launch-measure" } -# <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } } -## -{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo', - 'if': 'TARGET_I386' } - -## -# @SevCapability: -# -# The struct describes capability for a Secure Encrypted -# Virtualization feature. -# -# @pdh: Platform Diffie-Hellman key (base64 encoded) -# -# @cert-chain: PDH certificate chain (base64 encoded) -# -# @cpu0-id: Unique ID of CPU0 (base64 encoded) (since 7.1) -# -# @cbitpos: C-bit location in page table entry -# -# @reduced-phys-bits: Number of physical Address bit reduction when -# SEV is enabled -# -# Since: 2.12 -## -{ 'struct': 'SevCapability', - 'data': { 'pdh': 'str', - 'cert-chain': 'str', - 'cpu0-id': 'str', - 'cbitpos': 'int', - 'reduced-phys-bits': 'int'}, - 'if': 'TARGET_I386' } - -## -# @query-sev-capabilities: -# -# This command is used to get the SEV capabilities, and is only -# supported on AMD X86 platforms with KVM enabled. If SEV is not -# available on the platform an error will be returned. -# -# Returns: SevCapability objects. -# -# Since: 2.12 -# -# .. qmp-example:: -# -# -> { "execute": "query-sev-capabilities" } -# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", -# "cpu0-id": "2lvmGwo+...61iEinw==", -# "cbitpos": 47, "reduced-phys-bits": 1}} -## -{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability', - 'if': 'TARGET_I386' } - -## -# @sev-inject-launch-secret: -# -# This command injects a secret blob into memory of a SEV/SEV-ES guest. -# -# This is only valid on x86 machines configured with KVM and the -# 'sev-guest' confidential virtualization object. SEV-SNP guests -# do not support launch secret injection -# -# This will return an error if launch secret injection is not possible, -# either due to an invalid guest configuration, or if the guest has not -# reached the required SEV state. -# -# @packet-header: the launch secret packet header encoded in base64 -# -# @secret: the launch secret data to be injected encoded in base64 -# -# @gpa: the guest physical address where secret will be injected. -# -# Since: 6.0 -## -{ 'command': 'sev-inject-launch-secret', - 'data': { 'packet-header': 'str', 'secret': 'str', '*gpa': 'uint64' }, - 'if': 'TARGET_I386' } - -## -# @SevAttestationReport: -# -# The struct describes attestation report for a Secure Encrypted -# Virtualization feature. -# -# @data: guest attestation report (base64 encoded) -# -# Since: 6.1 -## -{ 'struct': 'SevAttestationReport', - 'data': { 'data': 'str'}, - 'if': 'TARGET_I386' } - -## -# @query-sev-attestation-report: -# -# This command is used to get the SEV attestation report. -# -# This is only valid on x86 machines configured with KVM and the -# 'sev-guest' confidential virtualization object. The attestation -# report for SEV-SNP guests is only available within the guest. -# -# This will return an error if the attestation report is -# unavailable, either due to an invalid guest configuration -# or if the guest has not reached the required SEV state. -# -# @mnonce: a random 16 bytes value encoded in base64 (it will be -# included in report) -# -# Returns: SevAttestationReport objects. -# -# Since: 6.1 -# -# .. qmp-example:: -# -# -> { "execute" : "query-sev-attestation-report", -# "arguments": { "mnonce": "aaaaaaa" } } -# <- { "return" : { "data": "aaaaaaaabbbddddd"} } -## -{ 'command': 'query-sev-attestation-report', - 'data': { 'mnonce': 'str' }, - 'returns': 'SevAttestationReport', - 'if': 'TARGET_I386' } - ## # @GICCapability: # diff --git a/stubs/monitor-i386-sev.c b/stubs/monitor-i386-sev.c new file mode 100644 index 00000000000..d4f024128ca --- /dev/null +++ b/stubs/monitor-i386-sev.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-misc-i386.h" + +SevInfo *qmp_query_sev(Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); + return NULL; +} + +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); + return NULL; +} + +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); + return NULL; +} + +void qmp_sev_inject_launch_secret(const char *packet_header, const char *secret, + bool has_gpa, uint64_t gpa, Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); +} + +SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce, + Error **errp) +{ + error_setg(errp, "SEV is not available in this QEMU"); + return NULL; +} diff --git a/target/i386/sev-system-stub.c b/target/i386/sev-system-stub.c index d5bf886e799..7c5c02a5657 100644 --- a/target/i386/sev-system-stub.c +++ b/target/i386/sev-system-stub.c @@ -14,34 +14,9 @@ #include "qemu/osdep.h" #include "monitor/monitor.h" #include "monitor/hmp-target.h" -#include "qapi/qapi-commands-misc-target.h" #include "qapi/error.h" #include "sev.h" -SevInfo *qmp_query_sev(Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); - return NULL; -} - -SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); - return NULL; -} - -SevCapability *qmp_query_sev_capabilities(Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); - return NULL; -} - -void qmp_sev_inject_launch_secret(const char *packet_header, const char *secret, - bool has_gpa, uint64_t gpa, Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); -} - int sev_encrypt_flash(hwaddr gpa, uint8_t *ptr, uint64_t len, Error **errp) { g_assert_not_reached(); @@ -56,13 +31,6 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) g_assert_not_reached(); } -SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce, - Error **errp) -{ - error_setg(errp, "SEV is not available in this QEMU"); - return NULL; -} - void hmp_info_sev(Monitor *mon, const QDict *qdict) { monitor_printf(mon, "SEV is not available in this QEMU\n"); diff --git a/target/i386/sev.c b/target/i386/sev.c index 7ee700d6a35..56dd64e659a 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -37,7 +37,7 @@ #include "qom/object.h" #include "monitor/monitor.h" #include "monitor/hmp-target.h" -#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qapi-commands-misc-i386.h" #include "confidential-guest.h" #include "hw/i386/pc.h" #include "system/address-spaces.h" diff --git a/stubs/meson.build b/stubs/meson.build index 9907b54c1e6..9922ec7b88e 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -78,6 +78,7 @@ if have_system stub_ss.add(files('win32-kbd-hook.c')) stub_ss.add(files('xen-hw-stub.c')) stub_ss.add(files('monitor-i386-rtc.c')) + stub_ss.add(files('monitor-i386-sev.c')) endif if have_system or have_user From patchwork Thu May 22 19:05:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891721 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806478wrm; Thu, 22 May 2025 12:08:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCViOaxO2W2m6fhQ85rKBQ+E/EVdKev6fi5etVWf30SC0hcw0zRTxnAXVEGej1yCczy8oW/s5g==@linaro.org X-Google-Smtp-Source: AGHT+IGlWukPnNd9xsJQopZPrc/xVBNvbFWYWvrpzjA4YwzghABwJqT3eOV/9TFVjccVERgnzf94 X-Received: by 2002:a05:6602:2748:b0:85b:4ad1:70e with SMTP id ca18e2360f4ac-86caf0ee679mr33269639f.6.1747940927617; Thu, 22 May 2025 12:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940927; cv=none; d=google.com; s=arc-20240605; b=BjeonjdK3cEBkDuaDgjj60WkGlaLhXbWFjaJguN5qHJFeDnM4ZdTBiWZF4EqsTuhmC vsvd/w+zlbPQeE6yVt7KylIW2/5DzQsBKM2ABpFf/dmM7Vh1oRvMYVb7SiLGfVxnppdi 65KnEl/s/zjANRR1MPG/ElxMaAwKptkBy70B6BB3VcCOFcWhXieuY/rx/7xkaA0NUELX YmOnooedZmsvbyIi6LKw0z9LG/gmCCgL/o3OAssT2vEaLbMNmTbEwrj9WoYKSZ9K5ADE atIXrhkE5UOlWwTzArzU4mp0QKL6/kMdCerYVsCj6dJ/xr6u9FG/jfcP8nO2Ry8i6Wmw m5pQ== 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=LJmzJEfKJJ8E8nGh8tBJZD/8AHQeg+38e6Umva3AajU=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=GXpNUld+oMyWdZvUBfVadVJAa28LIQsOJd/Sz4/9VnwQMkOOrpYlnhrrIsM3Tgm5n2 KpS3kJvy37gSG1CSEiGEtjaXR/UQlvJYSSal0ABYs76yOGZw9T53VmQMrCdUo8191tQX EgULccp8/uyOU06STVz1o5ZO1EGn5h0SkrFtvadBu+GdQ1XzlRk/T1uluj76MUQPyD7w c4wT+Oy/gKGDkWKwvyca7Pa1om33YFx+rRMJchNTXO5j4M9Jhql2fnuQbYa7WypfS/p1 faU+GEoZkw0utb8zwg525k1ILIGqQQrooIziCw+P28z0su9fKBURbPFeUMAkAXfgYpw7 u24w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G6Gm6sRY; 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 ca18e2360f4ac-86a23737182si1215828639f.105.2025.05.22.12.08.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:47 -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=G6Gm6sRY; 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 1uIBF0-0000wT-6U; Thu, 22 May 2025 15:06:06 -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 1uIBEq-0000vH-E7 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:59 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEo-0006SW-IO for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:56 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-742c5f3456fso4188100b3a.0 for ; Thu, 22 May 2025 12:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940753; x=1748545553; 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=LJmzJEfKJJ8E8nGh8tBJZD/8AHQeg+38e6Umva3AajU=; b=G6Gm6sRY1EOqik7DlDrs/S+o7+S3odxAUYrPRWZcksoq3aa/7vPb7/AFk5tGq+ESKQ cavYux3keJE3vtX1UOKzcLJUW1Cq3VgEHMJjMcIbMa3TuMmNyxN3VwxU2GiY/QwnZtRT QuAQ2s/HmWiSA0uGRCc6xN063G4Jg3FKDl9ckHf4hHDxsnkwjfnlGrasCtTct/cR6xWv YquhIxrdv7QGX50sMpJXNNKYkq8DJFQ6kpyopUQ+mWZtnqfXeVR8T7m3d2tzcT8Kfy6N mVC3XdaPy/eHnlMQR63ox/UYpJLyto7AjHFYX8KXH8LEQJ9z81SHnHmp9CFBiiGFjDMz 0Tuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940753; x=1748545553; 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=LJmzJEfKJJ8E8nGh8tBJZD/8AHQeg+38e6Umva3AajU=; b=JzoQu10FYvIY4JqiUHSTKHqFVodkW7XbQ/D9wuEkdsKP01AwK0l6PBTwnScVrLJu6n OzT1sUO1j8IFhQdikea+Jfw01ZThxQHBHPGSlYdwo18+ACAvSSj45YIsw2q+gqhcVbJy rOlRrUuBl/qreKdbM9u+a/qL1bSmxcTUG/wtEh8H0qeEw0ZVSlplIW0rKX0yiYu8xoih fobp0GfqLYSEJDpE9sVKpsQwyDat4egj6H9ulb0Rbnf7SGRMRu6IofdSDWfVjK1V800J XyYpNAF3tqF6M2gzdJYA4MMgdtweyJUE/piWRd9OItxs2974Msn+1w/bmuOTp3dCAc9P EdfA== X-Gm-Message-State: AOJu0YxJ+oNzNIXJwxmvgI1y4MySzHrBltdmLoBwEZP3ahE7fFqdt5QS 09aBWRLEtLJyuReVgqIevvRRLHsAt6ex+TB/aHFv2nVJ7nwwkFLl29cSypiEY1GSKl025N6+J/s rLrXX X-Gm-Gg: ASbGnct8wfrCtqCdRRnFRhLccjpNg1hQBA813kL9Ic3o1VQ5hwlgOBIveMshZcIB3lv YlULTUzth0RxnDwx8ooPw7VFuS3IscpfgwlcLsaadgX5vqmGSB+KE7w8X+pq+xuyJLVFrrEkv8n S+nVMN02RgC64nN8kPlf3BmbRIP3jxDB2mQE+6WJfN3vuoFAJi18C8zeopXJOJPyIeux8CAtShh PQhehR/ixN6Ll7K9GzpluMa7Mwejub9xrD9bApbm6Txb+Zyu8k3+nJKJLRkY4gnIU+IGnj8DKXX Dcsh5/rviTjbA3lUAbCzdz5sM0OQiojMyrMwG1Tb9tMPoOQzJss= X-Received: by 2002:a05:6a20:7353:b0:215:df62:7d51 with SMTP id adf61e73a8af0-216218ca4acmr38115553637.11.1747940753099; Thu, 22 May 2025 12:05:53 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:52 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 04/15] qapi: expose query-gic-capability command unconditionally Date: Thu, 22 May 2025 12:05:31 -0700 Message-ID: <20250522190542.588267-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42e.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. Reviewed-by: Richard Henderson 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 c0d7b311f30..cc472ce91cb 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 From patchwork Thu May 22 19:05:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891711 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2805946wrm; Thu, 22 May 2025 12:07:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWy9lKj8aYZSDV+cGt4+XgRmheNsQi4NX5MsMi0erwZNLgCcMz2oCQO6UjN/05/VRnnaadHOg==@linaro.org X-Google-Smtp-Source: AGHT+IFNuyB8i3bXdFtjKfl6FJPmx/ClTiDZegd5hOANmapPBl4fEzI/rUE0fGmGE1sL5Q0x4g1c X-Received: by 2002:a05:6602:3999:b0:86a:2373:aa3d with SMTP id ca18e2360f4ac-86caf0576c6mr35853139f.3.1747940861598; Thu, 22 May 2025 12:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940861; cv=none; d=google.com; s=arc-20240605; b=gm0FU2rrpspy/B2q6Gmvv69GCHsZMlV+JhS27AVrylMfqlQj++o6NAIPq4jiu3lWX/ zsDNyvNMwjew1zmtawtMQNlVfhiAWc/t+2dHELmgP8ccRtbbUT1yrgdP+Y2YGG8YVxkk UUEroOu1DQ+2U1o7M/OU3tGyVsbMMkjLX7C76CEHnpzYyui+C5gWfQ3jsZFcbrXUbjIg thPPy629mdJw9U2v9RTFCzhjMebAhYQHNnrVw9WJdlrQ34oyYrC6C3LVQz2UpsZGusmI alhCM/srkucYISSL6jCbkMmcHzIz7X0VZxrJsnB/UYJTllaKZJqKLSm39sc15jRhLEDR 0j/g== 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=HPVF35l9UHbNMEec1/7K6eJuGQybRaf36tQqQS1N9wo=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=V6O0UJ4d5tSD5KHbrwyXy2V3+qd3TGLMjM7RDtef+Ct2ppxmog663/kAKnIoIT/Qps xRHlu0O0lsj0D58d0yY/Q9uN7IIa5mgESqPR9KYxehymchxgs9KQToIWk3lwuXHFzA/J 0kAIYyIe+pedm3QQy0Wdt8I87tkS3fCCPxKtwoaQbI3ZeaL0Ws+lCTbfm+Y97UweLh/5 zGsQtBM8xwkAzyoXAlhq9pN9P4+kG1qCQ+TBTgJuMS3ciUnupmkMtHTaFR8uD0OA7yne jOAqWDsNT/AmQPIfY1KVfCi9/tXttXER7WEOgIrU+ryGyGMDw4ylrlveqJgwIbcqa3/e OHPg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sh298Yw+; 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 ca18e2360f4ac-86a2376e344si1605992139f.123.2025.05.22.12.07.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:41 -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=sh298Yw+; 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 1uIBF0-0000wZ-7P; Thu, 22 May 2025 15:06:06 -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 1uIBEr-0000vI-Qp for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:59 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEp-0006Sl-LZ for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:57 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-30e8feb1886so6850841a91.0 for ; Thu, 22 May 2025 12:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940754; x=1748545554; 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=HPVF35l9UHbNMEec1/7K6eJuGQybRaf36tQqQS1N9wo=; b=sh298Yw+BFjpBYRUOmlbLgWld6PVF6Da1OR/86CjaTmq7WfBRAEgR67XwZLHx9N1Vi Csdv8UEIdWcv1MdCDnqYOEajfpsqbLH7XOp45/T3kN1ncRZ89CPir4f7lNaqpVnx+mAR 9HbY1bePy0RIL9h0Yj6ZGM+oFVDStJNUDtsT8ggbNzdhKsZdbFJJ6EumTNjRR+9IYT7/ X3BAHmwnC64IXzEYFLuWqGtWx/f9lvygS55kdn3U1SOCgVQJ2/f/yCp0Ih+9aRVGGxlS PHVVWCcxIDVnBtmQBe1EgMnTzu8D7bxMhxgfFRUtkJ9IdzJdUvALh0w2EzViFgickOMs EIEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940754; x=1748545554; 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=HPVF35l9UHbNMEec1/7K6eJuGQybRaf36tQqQS1N9wo=; b=xBC1+7aQjBJMyI6Ch26jdwBOj5DaZt4X9pqy3psagxSsbJ/pGCW3mqrtYjDMx5jKp0 id/8hoSJfMhaCDy6m9gUlBA6rNjell5pfAxaPSjBEAI57wlIB4Kr4AOiZmuOEitqdh/U oCa/tTy+woedNb9tyecQwedgBUdOS9u+Oi61klABfsx8ZIlu5rJWBT/r9BRsDDxshy9N py3TlTCPBFJWPTqDzXH6VrM4kGGcDIKaXSozfcmPElGi7QZbfxF74WzLQoxYV3NaBQgq 9/D12FVHQV6EDbr+4gR2AGwtuXgHMWL5ov7VinshcfBisiW9vWx6GVBUQ4hMnRMNvYmD IBCQ== X-Gm-Message-State: AOJu0YzRWQ2sblnsj2aYbuVFzVcbf2K+bmb9hreXAMpjFcLxmF+nKoVE NJeToLG0ZKEyq5fekDYWh/QSqy39NW9ziiMJVCqQ1saHlI50gbYH2k2BSTsHyD4Y7Lg6L1L5Rth py2t1 X-Gm-Gg: ASbGncuI1FwlGpDduNTuJAsfYy3mD4b8MKBtxVvqbSQ5Hi83HgLLAOtZPfkuswA2o3D nXcBRu2M3O/MrnDaHJ3ELNJ+btDAoeolQ3p63Y9/R/8pyodYtZkrQbNfqCNqr+LHipeM4QCPy9Q vgFvviF0TC5TlAF3hTjo2kY+kKyQ8GQQLpZSzcgyWnhv/KWcipy1amHbPPRk2rmYO0y6nD4Z3/O 29p/30ep+Mjifei/Vd6XaqFiqwQjrQYpvfCvbhGBm21Kxo4JrLOV7XZEQsSXjhRaE0Q8TxJKQzr WhYYWI7avHPwCYMa0rqIxOPBRwv3K+tACHyl4EIPl09Tlwe48Dk= X-Received: by 2002:a17:90b:1e01:b0:30c:540b:99e with SMTP id 98e67ed59e1d1-310e96cbff2mr454734a91.13.1747940754108; Thu, 22 May 2025 12:05:54 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:53 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 05/15] qapi: make SGX commands unconditionally available Date: Thu, 22 May 2025 12:05:32 -0700 Message-ID: <20250522190542.588267-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1036.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_I386 condition from the SGX confidential virtualization commands, moving them to the recently introduced misc-i386.json QAPI file, given they are inherantly i386 specific commands. Observe a pre-existing bug that the "SGXEPCSection" struct lacked a TARGET_I386 condition, despite its only usage being behind a TARGET_I386 condition. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 77 +++++++++++++++++++++++++++++++++++++++ qapi/misc-target.json | 79 ---------------------------------------- hw/i386/sgx-stub.c | 2 +- hw/i386/sgx.c | 2 +- stubs/monitor-i386-sgx.c | 17 +++++++++ stubs/meson.build | 1 + 6 files changed, 97 insertions(+), 81 deletions(-) create mode 100644 stubs/monitor-i386-sgx.c diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json index de0e4ab67ff..92751d5e180 100644 --- a/qapi/misc-i386.json +++ b/qapi/misc-i386.json @@ -293,3 +293,80 @@ { 'command': 'query-sev-attestation-report', 'data': { 'mnonce': 'str' }, 'returns': 'SevAttestationReport' } + +## +# @SgxEpcSection: +# +# Information about intel SGX EPC section +# +# @node: the numa node +# +# @size: the size of EPC section +# +# Since: 7.0 +## +{ 'struct': 'SgxEpcSection', + 'data': { 'node': 'int', + 'size': 'uint64'}} + +## +# @SgxInfo: +# +# Information about intel Safe Guard eXtension (SGX) support +# +# @sgx: true if SGX is supported +# +# @sgx1: true if SGX1 is supported +# +# @sgx2: true if SGX2 is supported +# +# @flc: true if FLC is supported +# +# @sections: The EPC sections information (Since: 7.0) +# +# Since: 6.2 +## +{ 'struct': 'SgxInfo', + 'data': { 'sgx': 'bool', + 'sgx1': 'bool', + 'sgx2': 'bool', + 'flc': 'bool', + 'sections': ['SgxEpcSection']} } + +## +# @query-sgx: +# +# Returns information about configured SGX capabilities of guest +# +# Returns: @SgxInfo +# +# Since: 6.2 +# +# .. qmp-example:: +# +# -> { "execute": "query-sgx" } +# <- { "return": { "sgx": true, "sgx1" : true, "sgx2" : true, +# "flc": true, +# "sections": [{"node": 0, "size": 67108864}, +# {"node": 1, "size": 29360128}]} } +## +{ 'command': 'query-sgx', 'returns': 'SgxInfo' } + +## +# @query-sgx-capabilities: +# +# Returns information about SGX capabilities of host +# +# Returns: @SgxInfo +# +# Since: 6.2 +# +# .. qmp-example:: +# +# -> { "execute": "query-sgx-capabilities" } +# <- { "return": { "sgx": true, "sgx1" : true, "sgx2" : true, +# "flc": true, +# "section" : [{"node": 0, "size": 67108864}, +# {"node": 1, "size": 29360128}]} } +## +{ 'command': 'query-sgx-capabilities', 'returns': 'SgxInfo' } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index cc472ce91cb..d62db37d7cf 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,85 +2,6 @@ # vim: filetype=python # -## -# @SgxEpcSection: -# -# Information about intel SGX EPC section -# -# @node: the numa node -# -# @size: the size of EPC section -# -# Since: 7.0 -## -{ 'struct': 'SgxEpcSection', - 'data': { 'node': 'int', - 'size': 'uint64'}} - -## -# @SgxInfo: -# -# Information about intel Safe Guard eXtension (SGX) support -# -# @sgx: true if SGX is supported -# -# @sgx1: true if SGX1 is supported -# -# @sgx2: true if SGX2 is supported -# -# @flc: true if FLC is supported -# -# @sections: The EPC sections information (Since: 7.0) -# -# Since: 6.2 -## -{ 'struct': 'SgxInfo', - 'data': { 'sgx': 'bool', - 'sgx1': 'bool', - 'sgx2': 'bool', - 'flc': 'bool', - 'sections': ['SgxEpcSection']}, - 'if': 'TARGET_I386' } - -## -# @query-sgx: -# -# Returns information about configured SGX capabilities of guest -# -# Returns: @SgxInfo -# -# Since: 6.2 -# -# .. qmp-example:: -# -# -> { "execute": "query-sgx" } -# <- { "return": { "sgx": true, "sgx1" : true, "sgx2" : true, -# "flc": true, -# "sections": [{"node": 0, "size": 67108864}, -# {"node": 1, "size": 29360128}]} } -## -{ 'command': 'query-sgx', 'returns': 'SgxInfo', 'if': 'TARGET_I386' } - -## -# @query-sgx-capabilities: -# -# Returns information about SGX capabilities of host -# -# Returns: @SgxInfo -# -# Since: 6.2 -# -# .. qmp-example:: -# -# -> { "execute": "query-sgx-capabilities" } -# <- { "return": { "sgx": true, "sgx1" : true, "sgx2" : true, -# "flc": true, -# "section" : [{"node": 0, "size": 67108864}, -# {"node": 1, "size": 29360128}]} } -## -{ 'command': 'query-sgx-capabilities', 'returns': 'SgxInfo', 'if': 'TARGET_I386' } - - ## # @EvtchnPortType: # diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index ccb21a975d7..d295e54d239 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -3,8 +3,8 @@ #include "monitor/hmp-target.h" #include "hw/i386/pc.h" #include "hw/i386/sgx-epc.h" +#include "qapi/qapi-commands-misc-i386.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc-target.h" void sgx_epc_build_srat(GArray *table_data) { diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index c80203b438e..e2801546ad6 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -19,7 +19,7 @@ #include "monitor/hmp-target.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qapi-commands-misc-i386.h" #include "system/address-spaces.h" #include "system/hw_accel.h" #include "system/reset.h" diff --git a/stubs/monitor-i386-sgx.c b/stubs/monitor-i386-sgx.c new file mode 100644 index 00000000000..00e081d52dd --- /dev/null +++ b/stubs/monitor-i386-sgx.c @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-misc-i386.h" + +SgxInfo *qmp_query_sgx(Error **errp) +{ + error_setg(errp, "SGX support is not compiled in"); + return NULL; +} + +SgxInfo *qmp_query_sgx_capabilities(Error **errp) +{ + error_setg(errp, "SGX support is not compiled in"); + return NULL; +} diff --git a/stubs/meson.build b/stubs/meson.build index 07e9d3799a5..f2eb4880181 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -80,6 +80,7 @@ if have_system stub_ss.add(files('monitor-arm-gic.c')) stub_ss.add(files('monitor-i386-rtc.c')) stub_ss.add(files('monitor-i386-sev.c')) + stub_ss.add(files('monitor-i386-sgx.c')) endif if have_system or have_user From patchwork Thu May 22 19:05:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891722 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806539wrm; Thu, 22 May 2025 12:08:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVjT/2jJK4qs/IzPqPzmlD+VSQepera68OmdvR6uDWkgpBDZtFCRDXvO9lpldhuvaKzol43Dw==@linaro.org X-Google-Smtp-Source: AGHT+IGd8S9zuednu4Jp5eKnPJmbHso5sq0hGN+eQDvE4CPqsX8wcTjF9bQANNLNjDBtIHQwNmVc X-Received: by 2002:a05:6e02:3a01:b0:3d6:cbad:235c with SMTP id e9e14a558f8ab-3db8573b700mr261254555ab.6.1747940937222; Thu, 22 May 2025 12:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940937; cv=none; d=google.com; s=arc-20240605; b=fR+YEXSpnRLlxZd/LPh4UgFSaDDQ6tOm6gDJDpKUfkSV6lK3sPli9WczzAge5rnfDe jZfHzpCbiqTKh8QviHMZ3TUdCaa7jvbAtwH2F/Kh5tHkrvipOLEk5g82mBWI2v0bf1pk MmF1/HjvTVnFI2Lnwd0cdj9m0Q91Xbc6Z3F0MunPYhVJ+CECH+zYy7f0hpwWGZ7iuX7s XifV64Pxvs7EvZx+ekfP5WNDyrZNL/nMG0TINa67jTzEOowhzfkDjVtUpOj8cE9mNBuH natyWcGveY7BZPUhmXEol7Mn+6Rl6vgdgU9kJUNft6K03DPGjDuhG/T5WDgtTlUxXjF0 hE2g== 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=gMEOAZnlEJm4Cel43J2TXjtD8bt/qKeMwnzVffeoXSU=; fh=TM82I98qaqDb2KBBYaIIpRlS54+yIkK4Mc6ebv4HwOY=; b=a4ruMngbCJ6LqixG84T/j/M/mIpXr0ShyvhAaoNKvpBsTy50NsVEdDSHXXLvLv9Etl dW4VkLE0Ci4EQXXfIVbP/pVQ1ttnBcF7uKTzMlwl22E6V0HU+KQcvbf+KjlQG1OFmiYJ jhtYdMSPiessutjZrMhi9qLLxSu958GhFtihlsvo37KvxQOG/5MUYiTLfKy+g4zsxpNU blX8WNf+40rdo8Lg6cFQsBAFP9GWuFT2jiPcbZfaRygsF+BFeLhJ178TfGRmycerK7vU DPmClxAcnSK+YKe2Wu/ifJ/xhnrWczxXsSdCEy0W/TtSU0AbJcJiBqvbldrLpfrxWC6A MYUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kg5BufUH; 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 e9e14a558f8ab-3dc6c0a31efsi110570045ab.58.2025.05.22.12.08.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:57 -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=Kg5BufUH; 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 1uIBFM-0001CC-LV; Thu, 22 May 2025 15:06:28 -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 1uIBEz-0000wU-VK for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:06 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEr-0006TD-QA for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:59 -0400 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-30e57a37294so7906234a91.2 for ; Thu, 22 May 2025 12:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940755; x=1748545555; 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=gMEOAZnlEJm4Cel43J2TXjtD8bt/qKeMwnzVffeoXSU=; b=Kg5BufUHXILgZdipCxRkl/4CRvIsyGvc8qml5KEcdeH/wUmht4tKVg1E8h3DTRuhah 4C8anl5dQqd/s/qpKzpDhRw1pDmi3wqgkVYG+15/oPzfa5rFZczQES8buYbZvXuuVOne UrCpVH4Pelh4SD7vXl8NqXAAtTozWj7Zcp9AyMRSd8zMyH1XvByh4Eegi74nSg9E8O5Z TMuUbMhjVB2uhuKrSfZ5gGkaL+uuDJ+lbAgFMfTQQg+eWlV9M9DmywKijU+PB1ljdMfY Ze1ZgGXsRM0mag9TAf26IVE4OC3SrmCZMsEk+2X5V0TmxblU05HbBZCCnS5ryK/MIlOV d+ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940755; x=1748545555; 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=gMEOAZnlEJm4Cel43J2TXjtD8bt/qKeMwnzVffeoXSU=; b=UcmRB0X0i/BQNxIY2qsiIc+zN+KXw2eTQY4WN6kZg3Nv+MCERavIyR3oESCztmaPT6 iOpcK3FWGqpjswtFD6MaoizR7X3U2KFwdXWiWSWuvpt6mfKwa/ozGJGAq58OfQnblzZP 4YGF1YV4a55qY1oQmXaaFw6GEGJ6hPb7iW2YJkdG5Wg6g+WpTDMScBiqjdXCpOpf89Ix 1XMx+Jwcel1G7qd2vV6qcvF93BVxPWibLBhGW9gB8rlmOM8kDQzCYNX7EoG2yfd7M0iw n49vzIGbCfYY+py3vMJEMSVTA02ZiigFOPThlw8V6JHm3+jSrTZH3jgJlkiPzoiAaYeI cQMw== X-Gm-Message-State: AOJu0Yyrfu3GTjTZmHSINVlH4ajOfhEt3ofHaVKQ4e+QxrEC9qXfPZdi eVmyWI90Fk+aVvuuyhzBn9CYpXuPdQbSSGIfODCuAKU49wwZ+/F1Iu5sw3OosjSym270D46dv0W LvLw3 X-Gm-Gg: ASbGncsFYcna3qCu527CL3nVzbWwNEE4INBqIIpipW0Vjp1V4KxcoF3tuBVQyECFlXT 50Alr1kqBRD6Kpn+ou7KPIxjBpD4f/pOXYq+qek259jmeFTceC7HjSr1AAWRmX/WQ0qli4tMibK CKGwTs/i1Izji0zKb2YOcfNviQYD1AG+KoxD5ziHYuWjx2iJexpf3LH1GLjlT+71Wx/xvO7DlSK 587qEkH/NyqIPtz7uQ/VwCZCJtAUph7Z6VDNSaUjKycCsrqOb2Mxvo5GSDyaY1TKr6paImfx5QJ eT5e1qJjdPd3skofzYia4s7QgBvbefbNxUzHZSV/joLCzUGC/hWZLVgrnM+l7A== X-Received: by 2002:a17:90b:5344:b0:30a:b93e:381b with SMTP id 98e67ed59e1d1-30e8323efb1mr37558178a91.35.1747940755128; Thu, 22 May 2025 12:05:55 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:54 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org, David Woodhouse Subject: [PATCH v4 06/15] qapi: make Xen event commands unconditionally available Date: Thu, 22 May 2025 12:05:33 -0700 Message-ID: <20250522190542.588267-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102d.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_I386 condition from the Xen event channel commands, moving them to the recently introduced misc-i386.json QAPI file, given they are inherantly i386 specific commands. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Acked-by: David Woodhouse Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 107 +++++++++++++++++++++++++++++++++++++ qapi/misc-target.json | 111 --------------------------------------- hw/i386/kvm/xen-stubs.c | 13 ----- hw/i386/kvm/xen_evtchn.c | 2 +- stubs/monitor-i386-xen.c | 16 ++++++ stubs/meson.build | 1 + 6 files changed, 125 insertions(+), 125 deletions(-) create mode 100644 stubs/monitor-i386-xen.c diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json index 92751d5e180..cbf85233eba 100644 --- a/qapi/misc-i386.json +++ b/qapi/misc-i386.json @@ -370,3 +370,110 @@ # {"node": 1, "size": 29360128}]} } ## { 'command': 'query-sgx-capabilities', 'returns': 'SgxInfo' } + +## +# @EvtchnPortType: +# +# An enumeration of Xen event channel port types. +# +# @closed: The port is unused. +# +# @unbound: The port is allocated and ready to be bound. +# +# @interdomain: The port is connected as an interdomain interrupt. +# +# @pirq: The port is bound to a physical IRQ (PIRQ). +# +# @virq: The port is bound to a virtual IRQ (VIRQ). +# +# @ipi: The post is an inter-processor interrupt (IPI). +# +# Since: 8.0 +## +{ 'enum': 'EvtchnPortType', + 'data': ['closed', 'unbound', 'interdomain', 'pirq', 'virq', 'ipi'] } + +## +# @EvtchnInfo: +# +# Information about a Xen event channel port +# +# @port: the port number +# +# @vcpu: target vCPU for this port +# +# @type: the port type +# +# @remote-domain: remote domain for interdomain ports +# +# @target: remote port ID, or virq/pirq number +# +# @pending: port is currently active pending delivery +# +# @masked: port is masked +# +# Since: 8.0 +## +{ 'struct': 'EvtchnInfo', + 'data': {'port': 'uint16', + 'vcpu': 'uint32', + 'type': 'EvtchnPortType', + 'remote-domain': 'str', + 'target': 'uint16', + 'pending': 'bool', + 'masked': 'bool'} } + + +## +# @xen-event-list: +# +# Query the Xen event channels opened by the guest. +# +# Returns: list of open event channel ports. +# +# Since: 8.0 +# +# .. qmp-example:: +# +# -> { "execute": "xen-event-list" } +# <- { "return": [ +# { +# "pending": false, +# "port": 1, +# "vcpu": 1, +# "remote-domain": "qemu", +# "masked": false, +# "type": "interdomain", +# "target": 1 +# }, +# { +# "pending": false, +# "port": 2, +# "vcpu": 0, +# "remote-domain": "", +# "masked": false, +# "type": "virq", +# "target": 0 +# } +# ] +# } +## +{ 'command': 'xen-event-list', + 'returns': ['EvtchnInfo'] } + +## +# @xen-event-inject: +# +# Inject a Xen event channel port (interrupt) to the guest. +# +# @port: The port number +# +# Since: 8.0 +# +# .. qmp-example:: +# +# -> { "execute": "xen-event-inject", "arguments": { "port": 1 } } +# <- { "return": { } } +## +{ 'command': 'xen-event-inject', + 'data': { 'port': 'uint32' } } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index d62db37d7cf..c9ea1ab23e7 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -1,114 +1,3 @@ # -*- Mode: Python -*- # vim: filetype=python # - -## -# @EvtchnPortType: -# -# An enumeration of Xen event channel port types. -# -# @closed: The port is unused. -# -# @unbound: The port is allocated and ready to be bound. -# -# @interdomain: The port is connected as an interdomain interrupt. -# -# @pirq: The port is bound to a physical IRQ (PIRQ). -# -# @virq: The port is bound to a virtual IRQ (VIRQ). -# -# @ipi: The post is an inter-processor interrupt (IPI). -# -# Since: 8.0 -## -{ 'enum': 'EvtchnPortType', - 'data': ['closed', 'unbound', 'interdomain', 'pirq', 'virq', 'ipi'], - 'if': 'TARGET_I386' } - -## -# @EvtchnInfo: -# -# Information about a Xen event channel port -# -# @port: the port number -# -# @vcpu: target vCPU for this port -# -# @type: the port type -# -# @remote-domain: remote domain for interdomain ports -# -# @target: remote port ID, or virq/pirq number -# -# @pending: port is currently active pending delivery -# -# @masked: port is masked -# -# Since: 8.0 -## -{ 'struct': 'EvtchnInfo', - 'data': {'port': 'uint16', - 'vcpu': 'uint32', - 'type': 'EvtchnPortType', - 'remote-domain': 'str', - 'target': 'uint16', - 'pending': 'bool', - 'masked': 'bool'}, - 'if': 'TARGET_I386' } - - -## -# @xen-event-list: -# -# Query the Xen event channels opened by the guest. -# -# Returns: list of open event channel ports. -# -# Since: 8.0 -# -# .. qmp-example:: -# -# -> { "execute": "xen-event-list" } -# <- { "return": [ -# { -# "pending": false, -# "port": 1, -# "vcpu": 1, -# "remote-domain": "qemu", -# "masked": false, -# "type": "interdomain", -# "target": 1 -# }, -# { -# "pending": false, -# "port": 2, -# "vcpu": 0, -# "remote-domain": "", -# "masked": false, -# "type": "virq", -# "target": 0 -# } -# ] -# } -## -{ 'command': 'xen-event-list', - 'returns': ['EvtchnInfo'], - 'if': 'TARGET_I386' } - -## -# @xen-event-inject: -# -# Inject a Xen event channel port (interrupt) to the guest. -# -# @port: The port number -# -# Since: 8.0 -# -# .. qmp-example:: -# -# -> { "execute": "xen-event-inject", "arguments": { "port": 1 } } -# <- { "return": { } } -## -{ 'command': 'xen-event-inject', - 'data': { 'port': 'uint32' }, - 'if': 'TARGET_I386' } diff --git a/hw/i386/kvm/xen-stubs.c b/hw/i386/kvm/xen-stubs.c index d03131e6864..ce73119ee7a 100644 --- a/hw/i386/kvm/xen-stubs.c +++ b/hw/i386/kvm/xen-stubs.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc-target.h" #include "xen_evtchn.h" #include "xen_primary_console.h" @@ -38,15 +37,3 @@ void xen_primary_console_create(void) void xen_primary_console_set_be_port(uint16_t port) { } -#ifdef TARGET_I386 -EvtchnInfoList *qmp_xen_event_list(Error **errp) -{ - error_setg(errp, "Xen event channel emulation not enabled"); - return NULL; -} - -void qmp_xen_event_inject(uint32_t port, Error **errp) -{ - error_setg(errp, "Xen event channel emulation not enabled"); -} -#endif diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c index b5190549a81..dd566c49679 100644 --- a/hw/i386/kvm/xen_evtchn.c +++ b/hw/i386/kvm/xen_evtchn.c @@ -19,7 +19,7 @@ #include "monitor/monitor.h" #include "monitor/hmp.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qapi-commands-misc-i386.h" #include "qobject/qdict.h" #include "qom/object.h" #include "exec/target_page.h" diff --git a/stubs/monitor-i386-xen.c b/stubs/monitor-i386-xen.c new file mode 100644 index 00000000000..95b826f9795 --- /dev/null +++ b/stubs/monitor-i386-xen.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-misc-i386.h" + +EvtchnInfoList *qmp_xen_event_list(Error **errp) +{ + error_setg(errp, "Xen event channel emulation not enabled"); + return NULL; +} + +void qmp_xen_event_inject(uint32_t port, Error **errp) +{ + error_setg(errp, "Xen event channel emulation not enabled"); +} diff --git a/stubs/meson.build b/stubs/meson.build index f2eb4880181..0ef11976a2f 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -81,6 +81,7 @@ if have_system stub_ss.add(files('monitor-i386-rtc.c')) stub_ss.add(files('monitor-i386-sev.c')) stub_ss.add(files('monitor-i386-sgx.c')) + stub_ss.add(files('monitor-i386-xen.c')) endif if have_system or have_user From patchwork Thu May 22 19:05:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891708 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2805662wrm; Thu, 22 May 2025 12:07:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVHuuDockPK/hcaxVapUWHpCzxDeBrAcRtpIITCrM6sUl54E0O7mHSbsL2Di0DyjmhNFYDNLg==@linaro.org X-Google-Smtp-Source: AGHT+IHwprL/Zipl+WSXoUZicYsUCX0z5H7COT93st7+ERKHCUF3YHz2ic6PjIZt0AYwcfilEqcZ X-Received: by 2002:a92:ca49:0:b0:3d9:39f3:f250 with SMTP id e9e14a558f8ab-3db84296e9dmr280462025ab.3.1747940822776; Thu, 22 May 2025 12:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940822; cv=none; d=google.com; s=arc-20240605; b=C109c+G+LHlfi1lUlxL7wnt1s055q8IOvpGu8RNzU2WedK33WF8JX8RjHMi1LCHVj5 xsGGhp5IkEmkyZ3iObS1Fz7Yh0rCQJvQbbqivYkv6V6DMlTLwxOh1L8mXGN3+OFTvKW1 3WCNZq1Xn7kThCWp5HRoOzjuT0HdTqkyF8GOAM/OV1eUCnAFk+97sRn2uMN7TBoU6QOf WIVd2YNuKGsQ2lZsz5Wf0MTsdTa0wrlxqbkGP/sVmsTqhGAwW3ApqEK142rj2EiEO0Cf EhAqu+7UXOnu/JeJtDnJKp1e9kRlBGCS/bxMN6RZG//p3EHMTkkesqw1uD8yrXmIPxJl xZ+Q== 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=CNI2BFFgTeljdJ/HtYFFxLLCliw0wPHFB2HapKUt6b4=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=YAN53G7U7eJDxMZKwCX07/65FuMyzeniayyG0cpSQSmdS0HjNb2STkdcllpNBSLT6K TpdTu+gL4St2mVs5CoFomOsv58bLgeXsPOXpjbSMSmzL6dYxG1q7LAynvp2KCZYOIdQN Gs+N5RIeke2qnJc/Wub6Kbna8Nk8LE94+im/f1SL5LYy8xRt/14+gRK0/Q9tBHVooR+h mfxNrrIrVIdtWmRYuxxdDz1Il7npW2KHFVUNeROjv39lpDqPnxfk3yD11Hizwlg2gXOj p2AQXvkkEybw7yftSkhZddhz/ONbn6cR69IK6flQQSDqnVZUp5NB28o7av27W1D/6Oxt zUPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rg8ehPIW; 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 e9e14a558f8ab-3dc8298d940si57889115ab.129.2025.05.22.12.07.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:02 -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=Rg8ehPIW; 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 1uIBFA-00012R-8T; Thu, 22 May 2025 15:06:18 -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 1uIBEz-0000wV-W5 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:06 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEr-0006TB-Fm for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:59 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-742c27df0daso4788451b3a.1 for ; Thu, 22 May 2025 12:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940756; x=1748545556; 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=CNI2BFFgTeljdJ/HtYFFxLLCliw0wPHFB2HapKUt6b4=; b=Rg8ehPIWU6S9leFG50xQ+fs1L6+VLfeiA7pE/QPeS7my63CaLfno77OD/pEXAu5uA/ bQkZ0lYfjn0X3bA0fs+YcJoOmL1H6B95aJEyv8OSg6bPE2Z2mtKK8mthDT+y2FRyFNvh FQ3FB3fR/U+up8pYDhuVG0BLwKp9K96V1QbQArDvGgVM/ootzRE6kFMSJvZVntKoCZNR tGGEzU6YB8eCj2UCX+Hhz0c+D0nx8CECHWzFOx4CCTI7IwMDgkqA6L2/m1xC/PhFmb1E xu8l4whZckoZldb5PqPBNDGxvp6/yodtWa6cwAlqdEhQylDPOO5S1X5apy0fKSb/qSWX JhnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940756; x=1748545556; 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=CNI2BFFgTeljdJ/HtYFFxLLCliw0wPHFB2HapKUt6b4=; b=qBO6FJT/wJL538fgtRMyIYtkSsQ6qB0dAXwUuPngyfz6dr4XIWNty+kxz4rBaST+nd Td+X6uvSWqaYClFCNyOE84/9sJq/Tiu3gbXUQvdggwCqMdRuzyXgpvKVJ5SP00Kros+L UAPHa+o+CxzL6+MmwF9EP/dMB59MsGixMp6HN3Hyc8t3pKs6vmuhmEFu1Zk3nCFlkVmA ybTZH8jVwOk8fLTkQH/skG2DU7QiD2QiqOoMM1bhJHRZsHQjzXhYkYIdx3j9XefAWc6I aun0jP9asKMaroi6Tl+1wM2xRXI8R+SG1b8pdRuFvC0G4zEGa9gNWjFtGA4UbmxzCj6x yegg== X-Gm-Message-State: AOJu0YyxUF5G9xuLnauIfeYtHvfG4ZwdZitJ+fo8Szg/a5WQf/41PqYA UxvrCQTo6v/euQ0cHftHc3xZm/n6eP18lx6RHD57PWnWzvXvVtIRRo4Bk+pq/3ukRA/ZdBLEP2X cnEIa X-Gm-Gg: ASbGncsBIqpopCEUhj1b/Z72iI5GTREKRGTh6dgYqg7DgsWkyinzdgkTzQeUPlQc6Ll TR+iGn3P7qvlZv9E6ytRwcqVdKg7OPitMehIjfiNzYwe9EFUAix1PuYq1gdKgV1+Z3Q7PBxemtu 59KJbSRp79r/+vJEtMxZy+b1tD9D61BWBP0qeu3pYCtGuwCQq2cx8Nfynx6FM/a6ufesKnUQJWh RJFG3Q1K7bO+Q4KmjrlmL2m3sjyYF6Rr0Ep9MPNWGoe34FRf5bOvsGGfc4Hk6lIvaPVMSIGB9aD TBDmbpOKtotYhpAUWBHH3XQSYErQMnL4jFUz3sipBkjDcunADoF42U7NGlOT/WDGa+1Pa/4q X-Received: by 2002:a17:90b:5750:b0:30e:3737:7c71 with SMTP id 98e67ed59e1d1-30e7d57e4e6mr37868026a91.20.1747940756020; Thu, 22 May 2025 12:05:56 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:55 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 07/15] qapi: remove the misc-target.json file Date: Thu, 22 May 2025 12:05:34 -0700 Message-ID: <20250522190542.588267-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42a.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 file is now empty and can thus be removed. Observe the pre-existing bug with s390-skeys.c and target/i386/monitor.c both including qapi-commands-misc-target.h despite not requiring it. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-target.json | 3 --- qapi/qapi-schema.json | 1 - hw/s390x/s390-skeys.c | 1 - target/i386/monitor.c | 1 - qapi/meson.build | 1 - 5 files changed, 7 deletions(-) delete mode 100644 qapi/misc-target.json diff --git a/qapi/misc-target.json b/qapi/misc-target.json deleted file mode 100644 index c9ea1ab23e7..00000000000 --- a/qapi/misc-target.json +++ /dev/null @@ -1,3 +0,0 @@ -# -*- Mode: Python -*- -# vim: filetype=python -# diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index e96bff8d38c..d8eb79cfda6 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -63,7 +63,6 @@ { 'include': 'misc.json' } { 'include': 'misc-arm.json' } { 'include': 'misc-i386.json' } -{ 'include': 'misc-target.json' } { 'include': 'audio.json' } { 'include': 'acpi.json' } { 'include': 'pci.json' } diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index aedb62b2d31..8eeecfd58fc 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -17,7 +17,6 @@ #include "hw/s390x/storage-keys.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" -#include "qapi/qapi-commands-misc-target.h" #include "qobject/qdict.h" #include "qemu/error-report.h" #include "system/memory_mapping.h" diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 3ea92b066e1..3c9b6ca62f2 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -29,7 +29,6 @@ #include "monitor/hmp.h" #include "qobject/qdict.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc-target.h" #include "qapi/qapi-commands-misc.h" /* Perform linear address sign extension */ diff --git a/qapi/meson.build b/qapi/meson.build index 5e93e6b8cfd..ffe44f9e0b8 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -42,7 +42,6 @@ qapi_all_modules = [ 'machine-target', 'migration', 'misc', - 'misc-target', 'net', 'pragma', 'qom', From patchwork Thu May 22 19:05:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891710 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2805815wrm; Thu, 22 May 2025 12:07:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWaV924mLLQKu9kZdeQBtdyg3kXIiULK+9gfmUHD9F1maywBPZKf+L9S/X/FPCXZdnfsidijQ==@linaro.org X-Google-Smtp-Source: AGHT+IEGbjK3wflO+wHIvb+rfx5rKiu7dw+sRa3/Pz0tkX27QPWMK2sTftx9zCZqtKRtd31bIwAK X-Received: by 2002:a05:6e02:12ea:b0:3dc:8667:342d with SMTP id e9e14a558f8ab-3dc866736cbmr92546445ab.12.1747940843943; Thu, 22 May 2025 12:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940843; cv=none; d=google.com; s=arc-20240605; b=G3a+PaP6g7zCWPwCKDl0o8XJ2POBgciddUY1G3rYzBi6ob+ET2Nu21YPWZfby28QQQ Q7d6TmvVUxUo9SqE8aVF/IpLbbH2YhGjikk5dMTHHD7fwwbXVfsyCZHxaoIsY5vJCw6b AhhqkJNjZ3tFO+ZWVwzEB5FQh2tXLofEdmViR9zmk0B+lGEEW4lsewNMi+bm9j9h1qpp Gw98xyv8JLi549l1KCb4BZ3lQrcqSyjsch0Qe/d8u9dH0tlE00WV4mMkmdxMuDybVbW7 BkWfmEK0EXPbgGeyizBFEX9yHol0rpf4eefV2cXlxGEnJg9jy77d0G3qpWw0gVoioEZ2 XmRw== 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=XV2dpKJCVW3TNJuJ7PWcXDJO5Q/G/L9iomsm6uOsHOQ=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=WWBeSUEd96YTNno4scMqCLWpH2bK5dFGBvxJZuJOO9JXCdFLyfih4hXaC15sKPbT3i KqSz9qpl3Z2ZtaG22tDXjh5DPQ5rF4G9SMWk+B6Kj/BRILApeac7g56gQARTnAt5DaHM 8TDAywrllYyJ5lmvrZdtFs+8fyx9iPylWKDS90SNixtMS0ZDj1kE+doYzLn1FiUyJ+4A XDV/l6EphQYJy/2ovfeQpJ65gvU+FIZ6oOvKVB4kDRHN4h8OQwq5BYqxfqUbK8lAOVSs 1FXvFL+sPZuMKhg2DHQuKlb8ZwtZAPbIyvpeTk4Y14NVh4JiUUpeJAmK3xktXHrDYJs9 ULNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ASd+clK+; 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 e9e14a558f8ab-3db843c1f08si115819145ab.72.2025.05.22.12.07.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07: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=ASd+clK+; 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 1uIBFA-00012V-8d; Thu, 22 May 2025 15:06:18 -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 1uIBF1-0000x0-AA for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:07 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEz-0006TQ-AH for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:07 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-30e8f4dbb72so7053792a91.1 for ; Thu, 22 May 2025 12:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940757; x=1748545557; 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=XV2dpKJCVW3TNJuJ7PWcXDJO5Q/G/L9iomsm6uOsHOQ=; b=ASd+clK+tumlkKfjra188wYk0qpokMHK2zvML79jhPc/kvE48q57Vi1iz4VB5Ki6p+ 1kN9VKYTNHMcL1NAONgIrqkjmLQCNth6oGLNnzoPYLtn+RHTQpvrfDkG1kiELrrPIqlr stjBlHa/DsT2OZRl04LXKCmCH0sXday5Av6l9SJM6iBQ6/NTIAIk/1pBgTs2EQh2m/Qm ri3eaDBbXTAf4Lhs23xL380Ez2U86RDpKlEh7fnJvv9170aPFGDH+/sYf2FQn3bqIMhZ MyeZ6Q/cJXEl0LAY70TXFTcqkCUBr/t5BXAi22l5rMBUzO4PwrPHG8mXg2rohKqp8sk8 tn4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940757; x=1748545557; 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=XV2dpKJCVW3TNJuJ7PWcXDJO5Q/G/L9iomsm6uOsHOQ=; b=BlDfFQFe1YGeIwjoF/LIvQNNWarL05zdnXaNK8BkAXeiiuzsslayh06ckS9SafCI08 Pp3Hoellx9HkyqM19vS+nQ08htLnbDeZ/UaTRn9kK6MCuJeakwErVBuRgwyq2Doaa47q ioUEQ5ASf1x71vih5c+XmcgvPQNT3TlUMxEGdaDq38hQ548T4thoVn1TzdrIa+Mn5W7m 9t/JdhjztpXUql59Jv47qJiKGoT7Y6hUmitTKbg6usgd++D5JT/BWR9SRajohXyk/qXz Lxb1+W5neP2kk9ziMZxS8huRYAaAOCTqiwVOuLMWiQnPepFys30gPKEFW1wM5aB3MhFv Fy7Q== X-Gm-Message-State: AOJu0YwuWELPTel+6Sl3H0UDa3wXBE1T3odG9q9m0u7V/bWIPmXyun8e t7jT64newdLfME5Az9sxExs+RWuS/Hxq2BISLa/9YC0ISq4NtGxRo9SWbgZHePG8ZR6B7E5AXPE yuQmG X-Gm-Gg: ASbGncttWbhE3akQmzCNJwQ9LTAh5RbKvSzGT6sd690E7L9TA0b3QDq33GFeeEFZ/SU OBwCWmua6dttYbjD1YZuBVz13xNCtgBMPpJJj+HFuaTjtvSQBuXqzMHoLzgFsU5UZ0vXM6PFYPv ZRBLZ3p8nHLtzuf7ajvKHNDNMhjlwlHLEHuFMKACupF+9FWta9qDfIt+iSSCA9Is/h2+Ee2YcH/ v62thdaXcAqtAf8J7Z2prja6leNlAmvoxc7drXMOrbW0c9n1VQS5zGEtmpKkN6vu6vkL1Ce+f2t sQvKkSL8YKP9VV2UpZcecaRPWU+pTms2WUkf1pk3X9Vb49CYT2QP+7NWKfISvQ== X-Received: by 2002:a17:90b:54d0:b0:305:2d68:8d57 with SMTP id 98e67ed59e1d1-30e830ca02bmr31782095a91.5.1747940756942; Thu, 22 May 2025 12:05:56 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:56 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 08/15] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Date: Thu, 22 May 2025 12:05:35 -0700 Message-ID: <20250522190542.588267-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1033.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: Philippe Mathieu-Daudé We'd like to have some unified QAPI schema. Having a structure field conditional to a target being built in is not very practical. While @deprecated-props is only used by s390x target, it is generic enough and could be used by other targets (assuming we expand CpuModelExpansionType enum values). Let's always include this field, regardless of the target, but make it optional. This is not a compatibility break only because the field remains present always on S390x. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Pierrick Bouvier --- qapi/machine-target.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index 426ce4ee82d..d8dbda4b508 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -244,19 +244,18 @@ # # @model: the expanded CpuModelInfo. # -# @deprecated-props: a list of properties that are flagged as +# @deprecated-props: an optional list of properties that are flagged as # deprecated by the CPU vendor. The list depends on the # CpuModelExpansionType: "static" properties are a subset of the # enabled-properties for the expanded model; "full" properties are # a set of properties that are deprecated across all models for -# the architecture. (since: 9.1). +# the architecture. (since: 10.1 -- since 9.1 on s390x --). # # Since: 2.8 ## { 'struct': 'CpuModelExpansionInfo', 'data': { 'model': 'CpuModelInfo', - 'deprecated-props' : { 'type': ['str'], - 'if': 'TARGET_S390X' } }, + '*deprecated-props' : ['str'] }, 'if': { 'any': [ 'TARGET_S390X', 'TARGET_I386', 'TARGET_ARM', From patchwork Thu May 22 19:05:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891714 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806043wrm; Thu, 22 May 2025 12:07:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXVWbvZN5ZXbEal1DI2kVNZlGBXm9Id8c635ob9bxmdoaxRkswsxEWq3CecOK6WRvZ/e4A6uA==@linaro.org X-Google-Smtp-Source: AGHT+IEQVNFHvzNoHutr+qi49Uh2fWCpIzV3dyYdWmYoKhl6QiQwP7ZRSSLn2f4TlinvoGzyers2 X-Received: by 2002:a05:6e02:5e89:b0:3dc:746b:5455 with SMTP id e9e14a558f8ab-3dc746b568amr101920845ab.13.1747940872675; Thu, 22 May 2025 12:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940872; cv=none; d=google.com; s=arc-20240605; b=dBeb+LD2dQS+O3jR7aCUYAF/K0G8z8rhSrs4nAVIosbUMI/9CS/MZzN9uFPr2Gurnu x6979pxftqoQ1yT+mRNdeIHvuI6K7Eak2Bque4KwOUzvhZGX/5k1/rhaOH1gCpbIoLlI 3PgBNNDWDDSKY7rDjXKlg0XvP6pz8Mnnq8Rw1mAM8TH78q4hO7modT6WQVv1pU0lEg7l 9lKWIg57+9E8rniqIVRWXW7Oz/5D64T9dZRYtZQBTfffpLvGCUbORPmn26NIx1PJ9uzh vZXMqwnIigu1RpHZytmsUlYBMnSb8tYv1gE0KoNNMv40SHnU2waVHFmrxGEDSZfcYdeb kDlg== 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=Y6R30qCsDcLMF5khuyJMZe5QuT1s3sa6vKuD4tE2yEo=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=Qrav61Ste4Nv+09AZcTVHINgURBcD/NVEMoK7h11ZWeN9M4fBawm0q7NaXcW/V8ocL vzXWnpBcNqoBSHLwis6hLqg15aPdZZ/K3Z9/qTHoNwwGqjIL7J0riRFSysRslROJl1az SZopvg/g9XY21ERMy5S1Tj6120HoZ+H9yJfbUhUS2Uie/PCfuAdhbBmwn+KTro6fktB0 jL1csT3SgMcHHsNLExmJEC4MABPThdjyBtkYkZQYZPn+CTF1bflh9Wa7vrIiMGqKc52n LE5TN3rIj+7QTC0vzAsWpNFDdv6GAPNtbEelM9tYpNV32XBn+kCFOVwErmCjxMO9wD4m gaGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YuGz8IXu; 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 e9e14a558f8ab-3dc8ad89ef0si36542895ab.65.2025.05.22.12.07.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:52 -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=YuGz8IXu; 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 1uIBFU-0001Dx-ME; Thu, 22 May 2025 15:06:45 -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 1uIBF6-00011d-RC for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:13 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEz-0006Tn-O5 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:11 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-30e5430ed0bso8228409a91.3 for ; Thu, 22 May 2025 12:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940758; x=1748545558; 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=Y6R30qCsDcLMF5khuyJMZe5QuT1s3sa6vKuD4tE2yEo=; b=YuGz8IXuS77VnyneGz6aggdU7SJmDMFvF6KlAP2U15tNO5ApdFsNU40/ats7oJ3sI8 aRv2l6Q9BvzecQhSmvzNHjDEE5CsH5Ai5TUKQahDZBhohitsfrCPsUykvFP/9hzSyZ+8 eDLwgQCNYRSVnWgeYcEOTYoAGMGkUN/+A8xBwXO4jTxQ1dUncsuWWk4KWMk3pdwsYHGt aCbQhwAXAblfNC9F7O67f1TAfw9SXxwQNNLsfyBtt+JLSwTHc7Jl0PsVCmVQAX7H7AnV wwiKZILTNpgAPqnQjXJ+eS+DPG+0oPdeFvOo7Hy7KZrACb63/ercw6dEI4g6dPN7kFGl 3opw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940758; x=1748545558; 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=Y6R30qCsDcLMF5khuyJMZe5QuT1s3sa6vKuD4tE2yEo=; b=b700ORo2NBHPuk1SSngxxlrdx0/ZE4YzULPjr+sNaBtI588JWlRGXprtwcBPoGuUGz f+pxytld+f0/GHDR4HmvuMhlKGWxIlQu7/TcGu+1EScpCxMN+EPLl+jL1iyNECoe/aQT qM/2igrFC9wvtqeN8lSjzxcY9/+Iqi6/CQcOsYy/ZpVRr+AAY9/+sJxw9DAAtPuunoZ3 gqhOLvmDdnte8AHEJJO00NlNbe7Efa1KeL05mT9gOwAtbzDtWGIGgbg2V70N2dyAxo+3 EQLYcC/SaubQxlD2FrJqtQ8uGyWf2ZkFGUfuURv+dSbBYj1pbaPnfaESUtncSPtlVgbd xR6Q== X-Gm-Message-State: AOJu0YzQRS8JuHv4el8bkkSKGweoWYrb/PSlWcqxnfTq6webRpvC7qJe ULZfxAfQgTAJkLA42NQdEAQOijV38Pn9OFpv+VPPlXrh2sSMIy9X8MnkmbyOzYSRRULX7nyQsJR 2zBL7 X-Gm-Gg: ASbGncsZl8D/EvXU8T+bhCHjDDrKBhrE62UAldaiCzOCg7v+BCp5qZ4wj712oXesvXG GmK0Qyg+UaDqyWxe5JKfDSGBiNpLFnDTTen94acyEBqRKyOQMdohPWsekuufjaUsx8gCgJPHRkl SOEMUpLnqWj65vDxuHIJTj3au95HEANXpY1kBVG22dJD2MnrCBR2gZ+YOcBgGkjK7ZF/xz09n9j rLXPvQkYq7Y1trHJiZ0kZ2yNCIXRn7e9+Rzv364veKKxGlqVB1U6tF9LGpViICXEKRmwE+78pUG yZusVQIjuyLnqTawPRpzjNhHVLbnU07XRkSBE5fTk29hRg2DrxY= X-Received: by 2002:a17:90b:5603:b0:2ee:9b2c:3253 with SMTP id 98e67ed59e1d1-30e8323cd14mr35340884a91.30.1747940758003; Thu, 22 May 2025 12:05:58 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:57 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 09/15] qapi: make most CPU commands unconditionally available Date: Thu, 22 May 2025 12:05:36 -0700 Message-ID: <20250522190542.588267-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102a.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 This removes the TARGET_* conditions from all the CPU commands that are conceptually target independent. Top level stubs are provided to cope with targets which do not currently implement all of the commands. Adjust the doc comments accordingly. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- MAINTAINERS | 1 - qapi/machine-target.json | 397 -------------------------- qapi/machine.json | 363 +++++++++++++++++++++++ stubs/monitor-cpu-s390x.c | 23 ++ stubs/monitor-cpu.c | 21 ++ target/arm/arm-qmp-cmds.c | 2 +- target/i386/cpu-system.c | 2 +- target/i386/cpu.c | 2 +- target/loongarch/loongarch-qmp-cmds.c | 2 +- target/mips/system/mips-qmp-cmds.c | 12 +- target/ppc/ppc-qmp-cmds.c | 12 +- target/riscv/riscv-qmp-cmds.c | 2 +- target/s390x/cpu_models_system.c | 2 +- stubs/meson.build | 2 + 14 files changed, 437 insertions(+), 406 deletions(-) create mode 100644 stubs/monitor-cpu-s390x.c create mode 100644 stubs/monitor-cpu.c diff --git a/MAINTAINERS b/MAINTAINERS index 01684c5a3ff..9df6c818b28 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1938,7 +1938,6 @@ F: hw/core/numa.c F: hw/cpu/cluster.c F: qapi/machine.json F: qapi/machine-common.json -F: qapi/machine-target.json F: include/hw/boards.h F: include/hw/core/cpu.h F: include/hw/cpu/cluster.h diff --git a/qapi/machine-target.json b/qapi/machine-target.json index d8dbda4b508..f19e34adaf9 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -6,403 +6,6 @@ { 'include': 'machine-common.json' } -## -# @CpuModelInfo: -# -# Virtual CPU model. -# -# A CPU model consists of the name of a CPU definition, to which delta -# changes are applied (e.g. features added/removed). Most magic -# values that an architecture might require should be hidden behind -# the name. However, if required, architectures can expose relevant -# properties. -# -# @name: the name of the CPU definition the model is based on -# -# @props: a dictionary of QOM properties to be applied -# -# Since: 2.8 -## -{ 'struct': 'CpuModelInfo', - 'data': { 'name': 'str', - '*props': 'any' } } - -## -# @CpuModelExpansionType: -# -# An enumeration of CPU model expansion types. -# -# @static: Expand to a static CPU model, a combination of a static -# base model name and property delta changes. As the static base -# model will never change, the expanded CPU model will be the -# same, independent of QEMU version, machine type, machine -# options, and accelerator options. Therefore, the resulting -# model can be used by tooling without having to specify a -# compatibility machine - e.g. when displaying the "host" model. -# The @static CPU models are migration-safe. -# -# @full: Expand all properties. The produced model is not guaranteed -# to be migration-safe, but allows tooling to get an insight and -# work with model details. -# -# .. note:: When a non-migration-safe CPU model is expanded in static -# mode, some features enabled by the CPU model may be omitted, -# because they can't be implemented by a static CPU model -# definition (e.g. cache info passthrough and PMU passthrough in -# x86). If you need an accurate representation of the features -# enabled by a non-migration-safe CPU model, use @full. If you -# need a static representation that will keep ABI compatibility -# even when changing QEMU version or machine-type, use @static (but -# keep in mind that some features may be omitted). -# -# Since: 2.8 -## -{ 'enum': 'CpuModelExpansionType', - 'data': [ 'static', 'full' ] } - -## -# @CpuModelCompareResult: -# -# An enumeration of CPU model comparison results. The result is -# usually calculated using e.g. CPU features or CPU generations. -# -# @incompatible: If model A is incompatible to model B, model A is not -# guaranteed to run where model B runs and the other way around. -# -# @identical: If model A is identical to model B, model A is -# guaranteed to run where model B runs and the other way around. -# -# @superset: If model A is a superset of model B, model B is -# guaranteed to run where model A runs. There are no guarantees -# about the other way. -# -# @subset: If model A is a subset of model B, model A is guaranteed to -# run where model B runs. There are no guarantees about the other -# way. -# -# Since: 2.8 -## -{ 'enum': 'CpuModelCompareResult', - 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } - -## -# @CpuModelBaselineInfo: -# -# The result of a CPU model baseline. -# -# @model: the baselined CpuModelInfo. -# -# Since: 2.8 -## -{ 'struct': 'CpuModelBaselineInfo', - 'data': { 'model': 'CpuModelInfo' }, - 'if': 'TARGET_S390X' } - -## -# @CpuModelCompareInfo: -# -# The result of a CPU model comparison. -# -# @result: The result of the compare operation. -# -# @responsible-properties: List of properties that led to the -# comparison result not being identical. -# -# @responsible-properties is a list of QOM property names that led to -# both CPUs not being detected as identical. For identical models, -# this list is empty. If a QOM property is read-only, that means -# there's no known way to make the CPU models identical. If the -# special property name "type" is included, the models are by -# definition not identical and cannot be made identical. -# -# Since: 2.8 -## -{ 'struct': 'CpuModelCompareInfo', - 'data': { 'result': 'CpuModelCompareResult', - 'responsible-properties': ['str'] }, - 'if': 'TARGET_S390X' } - -## -# @query-cpu-model-comparison: -# -# Compares two CPU models, @modela and @modelb, returning how they -# compare in a specific configuration. The results indicates how -# both models compare regarding runnability. This result can be -# used by tooling to make decisions if a certain CPU model will -# run in a certain configuration or if a compatible CPU model has -# to be created by baselining. -# -# Usually, a CPU model is compared against the maximum possible CPU -# model of a certain configuration (e.g. the "host" model for KVM). -# If that CPU model is identical or a subset, it will run in that -# configuration. -# -# The result returned by this command may be affected by: -# -# * QEMU version: CPU models may look different depending on the QEMU -# version. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * machine-type: CPU model may look different depending on the -# machine-type. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * machine options (including accelerator): in some architectures, -# CPU models may look different depending on machine and accelerator -# options. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * "-cpu" arguments and global properties: arguments to the -cpu -# option and global properties may affect expansion of CPU models. -# Using query-cpu-model-expansion while using these is not advised. -# -# Some architectures may not support comparing CPU models. s390x -# supports comparing CPU models. -# -# @modela: description of the first CPU model to compare, referred to -# as "model A" in CpuModelCompareResult -# -# @modelb: description of the second CPU model to compare, referred to -# as "model B" in CpuModelCompareResult -# -# Returns: a CpuModelCompareInfo describing how both CPU models -# compare -# -# Errors: -# - if comparing CPU models is not supported -# - if a model cannot be used -# - if a model contains an unknown cpu definition name, unknown -# properties or properties with wrong types. -# -# .. note:: This command isn't specific to s390x, but is only -# implemented on this architecture currently. -# -# Since: 2.8 -## -{ 'command': 'query-cpu-model-comparison', - 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, - 'returns': 'CpuModelCompareInfo', - 'if': 'TARGET_S390X' } - -## -# @query-cpu-model-baseline: -# -# Baseline two CPU models, @modela and @modelb, creating a compatible -# third model. The created model will always be a static, -# migration-safe CPU model (see "static" CPU model expansion for -# details). -# -# This interface can be used by tooling to create a compatible CPU -# model out two CPU models. The created CPU model will be identical -# to or a subset of both CPU models when comparing them. Therefore, -# the created CPU model is guaranteed to run where the given CPU -# models run. -# -# The result returned by this command may be affected by: -# -# * QEMU version: CPU models may look different depending on the QEMU -# version. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * machine-type: CPU model may look different depending on the -# machine-type. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * machine options (including accelerator): in some architectures, -# CPU models may look different depending on machine and accelerator -# options. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * "-cpu" arguments and global properties: arguments to the -cpu -# option and global properties may affect expansion of CPU models. -# Using query-cpu-model-expansion while using these is not advised. -# -# Some architectures may not support baselining CPU models. s390x -# supports baselining CPU models. -# -# @modela: description of the first CPU model to baseline -# -# @modelb: description of the second CPU model to baseline -# -# Returns: a CpuModelBaselineInfo describing the baselined CPU model -# -# Errors: -# - if baselining CPU models is not supported -# - if a model cannot be used -# - if a model contains an unknown cpu definition name, unknown -# properties or properties with wrong types. -# -# .. note:: This command isn't specific to s390x, but is only -# implemented on this architecture currently. -# -# Since: 2.8 -## -{ 'command': 'query-cpu-model-baseline', - 'data': { 'modela': 'CpuModelInfo', - 'modelb': 'CpuModelInfo' }, - 'returns': 'CpuModelBaselineInfo', - 'if': 'TARGET_S390X' } - -## -# @CpuModelExpansionInfo: -# -# The result of a cpu model expansion. -# -# @model: the expanded CpuModelInfo. -# -# @deprecated-props: an optional list of properties that are flagged as -# deprecated by the CPU vendor. The list depends on the -# CpuModelExpansionType: "static" properties are a subset of the -# enabled-properties for the expanded model; "full" properties are -# a set of properties that are deprecated across all models for -# the architecture. (since: 10.1 -- since 9.1 on s390x --). -# -# Since: 2.8 -## -{ 'struct': 'CpuModelExpansionInfo', - 'data': { 'model': 'CpuModelInfo', - '*deprecated-props' : ['str'] }, - 'if': { 'any': [ 'TARGET_S390X', - 'TARGET_I386', - 'TARGET_ARM', - 'TARGET_LOONGARCH64', - 'TARGET_RISCV' ] } } - -## -# @query-cpu-model-expansion: -# -# Expands a given CPU model, @model, (or a combination of CPU model + -# additional options) to different granularities, specified by @type, -# allowing tooling to get an understanding what a specific CPU model -# looks like in QEMU under a certain configuration. -# -# This interface can be used to query the "host" CPU model. -# -# The data returned by this command may be affected by: -# -# * QEMU version: CPU models may look different depending on the QEMU -# version. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * machine-type: CPU model may look different depending on the -# machine-type. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * machine options (including accelerator): in some architectures, -# CPU models may look different depending on machine and accelerator -# options. (Except for CPU models reported as "static" in -# query-cpu-definitions.) -# * "-cpu" arguments and global properties: arguments to the -cpu -# option and global properties may affect expansion of CPU models. -# Using query-cpu-model-expansion while using these is not advised. -# -# Some architectures may not support all expansion types. s390x -# supports "full" and "static". Arm only supports "full". -# -# @model: description of the CPU model to expand -# -# @type: expansion type, specifying how to expand the CPU model -# -# Returns: a CpuModelExpansionInfo describing the expanded CPU model -# -# Errors: -# - if expanding CPU models is not supported -# - if the model cannot be expanded -# - if the model contains an unknown CPU definition name, unknown -# properties or properties with a wrong type -# - if an expansion type is not supported -# -# Since: 2.8 -## -{ 'command': 'query-cpu-model-expansion', - 'data': { 'type': 'CpuModelExpansionType', - 'model': 'CpuModelInfo' }, - 'returns': 'CpuModelExpansionInfo', - 'if': { 'any': [ 'TARGET_S390X', - 'TARGET_I386', - 'TARGET_ARM', - 'TARGET_LOONGARCH64', - 'TARGET_RISCV' ] } } - -## -# @CpuDefinitionInfo: -# -# Virtual CPU definition. -# -# @name: the name of the CPU definition -# -# @migration-safe: whether a CPU definition can be safely used for -# migration in combination with a QEMU compatibility machine when -# migrating between different QEMU versions and between hosts with -# different sets of (hardware or software) capabilities. If not -# provided, information is not available and callers should not -# assume the CPU definition to be migration-safe. (since 2.8) -# -# @static: whether a CPU definition is static and will not change -# depending on QEMU version, machine type, machine options and -# accelerator options. A static model is always migration-safe. -# (since 2.8) -# -# @unavailable-features: List of properties that prevent the CPU model -# from running in the current host. (since 2.8) -# -# @typename: Type name that can be used as argument to -# @device-list-properties, to introspect properties configurable -# using -cpu or -global. (since 2.9) -# -# @alias-of: Name of CPU model this model is an alias for. The target -# of the CPU model alias may change depending on the machine type. -# Management software is supposed to translate CPU model aliases -# in the VM configuration, because aliases may stop being -# migration-safe in the future (since 4.1) -# -# @deprecated: If true, this CPU model is deprecated and may be -# removed in some future version of QEMU according to the QEMU -# deprecation policy. (since 5.2) -# -# @unavailable-features is a list of QOM property names that represent -# CPU model attributes that prevent the CPU from running. If the QOM -# property is read-only, that means there's no known way to make the -# CPU model run in the current host. Implementations that choose not -# to provide specific information return the property name "type". If -# the property is read-write, it means that it MAY be possible to run -# the CPU model in the current host if that property is changed. -# Management software can use it as hints to suggest or choose an -# alternative for the user, or just to generate meaningful error -# messages explaining why the CPU model can't be used. If -# @unavailable-features is an empty list, the CPU model is runnable -# using the current host and machine-type. If @unavailable-features -# is not present, runnability information for the CPU is not -# available. -# -# Since: 1.2 -## -{ 'struct': 'CpuDefinitionInfo', - 'data': { 'name': 'str', - '*migration-safe': 'bool', - 'static': 'bool', - '*unavailable-features': [ 'str' ], - 'typename': 'str', - '*alias-of' : 'str', - 'deprecated' : 'bool' }, - 'if': { 'any': [ 'TARGET_PPC', - 'TARGET_ARM', - 'TARGET_I386', - 'TARGET_S390X', - 'TARGET_MIPS', - 'TARGET_LOONGARCH64', - 'TARGET_RISCV' ] } } - -## -# @query-cpu-definitions: -# -# Return a list of supported virtual CPU definitions -# -# Returns: a list of CpuDefinitionInfo -# -# Since: 1.2 -## -{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'], - 'if': { 'any': [ 'TARGET_PPC', - 'TARGET_ARM', - 'TARGET_I386', - 'TARGET_S390X', - 'TARGET_MIPS', - 'TARGET_LOONGARCH64', - 'TARGET_RISCV' ] } } - ## # @S390CpuPolarization: # diff --git a/qapi/machine.json b/qapi/machine.json index c8feb9fe17b..e6b4b2dfef8 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1916,3 +1916,366 @@ ## { 'command': 'dump-skeys', 'data': { 'filename': 'str' } } + +## +# @CpuModelInfo: +# +# Virtual CPU model. +# +# A CPU model consists of the name of a CPU definition, to which delta +# changes are applied (e.g. features added/removed). Most magic +# values that an architecture might require should be hidden behind +# the name. However, if required, architectures can expose relevant +# properties. +# +# @name: the name of the CPU definition the model is based on +# +# @props: a dictionary of QOM properties to be applied +# +# Since: 2.8 +## +{ 'struct': 'CpuModelInfo', + 'data': { 'name': 'str', + '*props': 'any' } } + +## +# @CpuModelExpansionType: +# +# An enumeration of CPU model expansion types. +# +# @static: Expand to a static CPU model, a combination of a static +# base model name and property delta changes. As the static base +# model will never change, the expanded CPU model will be the +# same, independent of QEMU version, machine type, machine +# options, and accelerator options. Therefore, the resulting +# model can be used by tooling without having to specify a +# compatibility machine - e.g. when displaying the "host" model. +# The @static CPU models are migration-safe. +# +# @full: Expand all properties. The produced model is not guaranteed +# to be migration-safe, but allows tooling to get an insight and +# work with model details. +# +# .. note:: When a non-migration-safe CPU model is expanded in static +# mode, some features enabled by the CPU model may be omitted, +# because they can't be implemented by a static CPU model +# definition (e.g. cache info passthrough and PMU passthrough in +# x86). If you need an accurate representation of the features +# enabled by a non-migration-safe CPU model, use @full. If you +# need a static representation that will keep ABI compatibility +# even when changing QEMU version or machine-type, use @static (but +# keep in mind that some features may be omitted). +# +# Since: 2.8 +## +{ 'enum': 'CpuModelExpansionType', + 'data': [ 'static', 'full' ] } + +## +# @CpuModelCompareResult: +# +# An enumeration of CPU model comparison results. The result is +# usually calculated using e.g. CPU features or CPU generations. +# +# @incompatible: If model A is incompatible to model B, model A is not +# guaranteed to run where model B runs and the other way around. +# +# @identical: If model A is identical to model B, model A is +# guaranteed to run where model B runs and the other way around. +# +# @superset: If model A is a superset of model B, model B is +# guaranteed to run where model A runs. There are no guarantees +# about the other way. +# +# @subset: If model A is a subset of model B, model A is guaranteed to +# run where model B runs. There are no guarantees about the other +# way. +# +# Since: 2.8 +## +{ 'enum': 'CpuModelCompareResult', + 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } + +## +# @CpuModelBaselineInfo: +# +# The result of a CPU model baseline. +# +# @model: the baselined CpuModelInfo. +# +# Since: 2.8 +## +{ 'struct': 'CpuModelBaselineInfo', + 'data': { 'model': 'CpuModelInfo' } } + +## +# @CpuModelCompareInfo: +# +# The result of a CPU model comparison. +# +# @result: The result of the compare operation. +# +# @responsible-properties: List of properties that led to the +# comparison result not being identical. +# +# @responsible-properties is a list of QOM property names that led to +# both CPUs not being detected as identical. For identical models, +# this list is empty. If a QOM property is read-only, that means +# there's no known way to make the CPU models identical. If the +# special property name "type" is included, the models are by +# definition not identical and cannot be made identical. +# +# Since: 2.8 +## +{ 'struct': 'CpuModelCompareInfo', + 'data': { 'result': 'CpuModelCompareResult', + 'responsible-properties': ['str'] } } + +## +# @query-cpu-model-comparison: +# +# Compares two CPU models, @modela and @modelb, returning how they +# compare in a specific configuration. The results indicates how +# both models compare regarding runnability. This result can be +# used by tooling to make decisions if a certain CPU model will +# run in a certain configuration or if a compatible CPU model has +# to be created by baselining. +# +# Usually, a CPU model is compared against the maximum possible CPU +# model of a certain configuration (e.g. the "host" model for KVM). +# If that CPU model is identical or a subset, it will run in that +# configuration. +# +# The result returned by this command may be affected by: +# +# * QEMU version: CPU models may look different depending on the QEMU +# version. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * machine-type: CPU model may look different depending on the +# machine-type. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * machine options (including accelerator): in some architectures, +# CPU models may look different depending on machine and accelerator +# options. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * "-cpu" arguments and global properties: arguments to the -cpu +# option and global properties may affect expansion of CPU models. +# Using query-cpu-model-expansion while using these is not advised. +# +# Some architectures may not support comparing CPU models. s390x +# supports comparing CPU models. +# +# @modela: description of the first CPU model to compare, referred to +# as "model A" in CpuModelCompareResult +# +# @modelb: description of the second CPU model to compare, referred to +# as "model B" in CpuModelCompareResult +# +# Returns: a CpuModelCompareInfo describing how both CPU models +# compare +# +# Errors: +# - if comparing CPU models is not supported by the target +# - if a model cannot be used +# - if a model contains an unknown cpu definition name, unknown +# properties or properties with wrong types. +# +# Since: 2.8 +## +{ 'command': 'query-cpu-model-comparison', + 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, + 'returns': 'CpuModelCompareInfo' } + +## +# @query-cpu-model-baseline: +# +# Baseline two CPU models, @modela and @modelb, creating a compatible +# third model. The created model will always be a static, +# migration-safe CPU model (see "static" CPU model expansion for +# details). +# +# This interface can be used by tooling to create a compatible CPU +# model out two CPU models. The created CPU model will be identical +# to or a subset of both CPU models when comparing them. Therefore, +# the created CPU model is guaranteed to run where the given CPU +# models run. +# +# The result returned by this command may be affected by: +# +# * QEMU version: CPU models may look different depending on the QEMU +# version. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * machine-type: CPU model may look different depending on the +# machine-type. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * machine options (including accelerator): in some architectures, +# CPU models may look different depending on machine and accelerator +# options. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * "-cpu" arguments and global properties: arguments to the -cpu +# option and global properties may affect expansion of CPU models. +# Using query-cpu-model-expansion while using these is not advised. +# +# Some architectures may not support baselining CPU models. s390x +# supports baselining CPU models. +# +# @modela: description of the first CPU model to baseline +# +# @modelb: description of the second CPU model to baseline +# +# Returns: a CpuModelBaselineInfo describing the baselined CPU model +# +# Errors: +# - if baselining CPU models is not supported by the target +# - if a model cannot be used +# - if a model contains an unknown cpu definition name, unknown +# properties or properties with wrong types. +# +# Since: 2.8 +## +{ 'command': 'query-cpu-model-baseline', + 'data': { 'modela': 'CpuModelInfo', + 'modelb': 'CpuModelInfo' }, + 'returns': 'CpuModelBaselineInfo' } + +## +# @CpuModelExpansionInfo: +# +# The result of a cpu model expansion. +# +# @model: the expanded CpuModelInfo. +# +# @deprecated-props: an optional list of properties that are flagged as +# deprecated by the CPU vendor. The list depends on the +# CpuModelExpansionType: "static" properties are a subset of the +# enabled-properties for the expanded model; "full" properties are +# a set of properties that are deprecated across all models for +# the architecture. (since: 10.1 -- since 9.1 on s390x --). +# +# Since: 2.8 +## +{ 'struct': 'CpuModelExpansionInfo', + 'data': { 'model': 'CpuModelInfo', + '*deprecated-props' : ['str'] } } + +## +# @query-cpu-model-expansion: +# +# Expands a given CPU model, @model, (or a combination of CPU model + +# additional options) to different granularities, specified by @type, +# allowing tooling to get an understanding what a specific CPU model +# looks like in QEMU under a certain configuration. +# +# This interface can be used to query the "host" CPU model. +# +# The data returned by this command may be affected by: +# +# * QEMU version: CPU models may look different depending on the QEMU +# version. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * machine-type: CPU model may look different depending on the +# machine-type. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * machine options (including accelerator): in some architectures, +# CPU models may look different depending on machine and accelerator +# options. (Except for CPU models reported as "static" in +# query-cpu-definitions.) +# * "-cpu" arguments and global properties: arguments to the -cpu +# option and global properties may affect expansion of CPU models. +# Using query-cpu-model-expansion while using these is not advised. +# +# Some architectures may not support all expansion types. s390x +# supports "full" and "static". Arm only supports "full". +# +# @model: description of the CPU model to expand +# +# @type: expansion type, specifying how to expand the CPU model +# +# Returns: a CpuModelExpansionInfo describing the expanded CPU model +# +# Errors: +# - if expanding CPU models is not supported +# - if the model cannot be expanded +# - if the model contains an unknown CPU definition name, unknown +# properties or properties with a wrong type +# - if an expansion type is not supported +# +# Since: 2.8 +## +{ 'command': 'query-cpu-model-expansion', + 'data': { 'type': 'CpuModelExpansionType', + 'model': 'CpuModelInfo' }, + 'returns': 'CpuModelExpansionInfo' } + +## +# @CpuDefinitionInfo: +# +# Virtual CPU definition. +# +# @name: the name of the CPU definition +# +# @migration-safe: whether a CPU definition can be safely used for +# migration in combination with a QEMU compatibility machine when +# migrating between different QEMU versions and between hosts with +# different sets of (hardware or software) capabilities. If not +# provided, information is not available and callers should not +# assume the CPU definition to be migration-safe. (since 2.8) +# +# @static: whether a CPU definition is static and will not change +# depending on QEMU version, machine type, machine options and +# accelerator options. A static model is always migration-safe. +# (since 2.8) +# +# @unavailable-features: List of properties that prevent the CPU model +# from running in the current host. (since 2.8) +# +# @typename: Type name that can be used as argument to +# @device-list-properties, to introspect properties configurable +# using -cpu or -global. (since 2.9) +# +# @alias-of: Name of CPU model this model is an alias for. The target +# of the CPU model alias may change depending on the machine type. +# Management software is supposed to translate CPU model aliases +# in the VM configuration, because aliases may stop being +# migration-safe in the future (since 4.1) +# +# @deprecated: If true, this CPU model is deprecated and may be +# removed in some future version of QEMU according to the QEMU +# deprecation policy. (since 5.2) +# +# @unavailable-features is a list of QOM property names that represent +# CPU model attributes that prevent the CPU from running. If the QOM +# property is read-only, that means there's no known way to make the +# CPU model run in the current host. Implementations that choose not +# to provide specific information return the property name "type". If +# the property is read-write, it means that it MAY be possible to run +# the CPU model in the current host if that property is changed. +# Management software can use it as hints to suggest or choose an +# alternative for the user, or just to generate meaningful error +# messages explaining why the CPU model can't be used. If +# @unavailable-features is an empty list, the CPU model is runnable +# using the current host and machine-type. If @unavailable-features +# is not present, runnability information for the CPU is not +# available. +# +# Since: 1.2 +## +{ 'struct': 'CpuDefinitionInfo', + 'data': { 'name': 'str', + '*migration-safe': 'bool', + 'static': 'bool', + '*unavailable-features': [ 'str' ], + 'typename': 'str', + '*alias-of' : 'str', + 'deprecated' : 'bool' } } + +## +# @query-cpu-definitions: +# +# Return a list of supported virtual CPU definitions +# +# Returns: a list of CpuDefinitionInfo +# +# Since: 1.2 +## +{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] } diff --git a/stubs/monitor-cpu-s390x.c b/stubs/monitor-cpu-s390x.c new file mode 100644 index 00000000000..71e794482b5 --- /dev/null +++ b/stubs/monitor-cpu-s390x.c @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" + +CpuModelCompareInfo * +qmp_query_cpu_model_comparison(CpuModelInfo *infoa, + CpuModelInfo *infob, + Error **errp) +{ + error_setg(errp, "CPU model comparison is not supported on this target"); + return NULL; +} + +CpuModelBaselineInfo * +qmp_query_cpu_model_baseline(CpuModelInfo *infoa, + CpuModelInfo *infob, + Error **errp) +{ + error_setg(errp, "CPU model baseline is not supported on this target"); + return NULL; +} diff --git a/stubs/monitor-cpu.c b/stubs/monitor-cpu.c new file mode 100644 index 00000000000..a8c7ee89b9d --- /dev/null +++ b/stubs/monitor-cpu.c @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" + +CpuModelExpansionInfo * +qmp_query_cpu_model_expansion(CpuModelExpansionType type, + CpuModelInfo *model, + Error **errp) +{ + error_setg(errp, "CPU model expansion is not supported on this target"); + return NULL; +} + +CpuDefinitionInfoList * +qmp_query_cpu_definitions(Error **errp) +{ + error_setg(errp, "CPU model definitions are not supported on this target"); + return NULL; +} diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index ef18c867ca4..cca6b9722b2 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -26,7 +26,7 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "qapi/qobject-input-visitor.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc-arm.h" #include "qobject/qdict.h" #include "qom/qom-qobject.h" diff --git a/target/i386/cpu-system.c b/target/i386/cpu-system.c index 55f192e8193..b1494aa6740 100644 --- a/target/i386/cpu-system.c +++ b/target/i386/cpu-system.c @@ -24,7 +24,7 @@ #include "qobject/qdict.h" #include "qapi/qobject-input-visitor.h" #include "qom/qom-qobject.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/qapi-commands-machine.h" #include "cpu-internal.h" diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9689f6374e6..33afc3ec60e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -38,7 +38,7 @@ #include "exec/watchpoint.h" #ifndef CONFIG_USER_ONLY #include "system/reset.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/qapi-commands-machine.h" #include "system/address-spaces.h" #include "hw/boards.h" #include "hw/i386/sgx-epc.h" diff --git a/target/loongarch/loongarch-qmp-cmds.c b/target/loongarch/loongarch-qmp-cmds.c index 6f732d80f3f..f5f1cd0009d 100644 --- a/target/loongarch/loongarch-qmp-cmds.c +++ b/target/loongarch/loongarch-qmp-cmds.c @@ -8,7 +8,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/qapi-commands-machine.h" #include "cpu.h" #include "qobject/qdict.h" #include "qapi/qobject-input-visitor.h" diff --git a/target/mips/system/mips-qmp-cmds.c b/target/mips/system/mips-qmp-cmds.c index 7340ac70ba0..d98d6623f2f 100644 --- a/target/mips/system/mips-qmp-cmds.c +++ b/target/mips/system/mips-qmp-cmds.c @@ -7,9 +7,19 @@ */ #include "qemu/osdep.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" #include "cpu.h" +CpuModelExpansionInfo * +qmp_query_cpu_model_expansion(CpuModelExpansionType type, + CpuModelInfo *model, + Error **errp) +{ + error_setg(errp, "CPU model expansion is not supported on this target"); + return NULL; +} + static void mips_cpu_add_definition(gpointer data, gpointer user_data) { ObjectClass *oc = data; diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index a25d86a8d19..7022564604f 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -28,7 +28,8 @@ #include "qemu/ctype.h" #include "monitor/hmp-target.h" #include "monitor/hmp.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" #include "cpu-models.h" #include "cpu-qom.h" @@ -175,6 +176,15 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval) return -EINVAL; } +CpuModelExpansionInfo * +qmp_query_cpu_model_expansion(CpuModelExpansionType type, + CpuModelInfo *model, + Error **errp) +{ + error_setg(errp, "CPU model expansion is not supported on this target"); + return NULL; +} + static void ppc_cpu_defs_entry(gpointer data, gpointer user_data) { ObjectClass *oc = data; diff --git a/target/riscv/riscv-qmp-cmds.c b/target/riscv/riscv-qmp-cmds.c index d0a324364dd..8ba8aa0d5f8 100644 --- a/target/riscv/riscv-qmp-cmds.c +++ b/target/riscv/riscv-qmp-cmds.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/qapi-commands-machine.h" #include "qobject/qbool.h" #include "qobject/qdict.h" #include "qapi/qobject-input-visitor.h" diff --git a/target/s390x/cpu_models_system.c b/target/s390x/cpu_models_system.c index 4351182f720..9d84faa3c9e 100644 --- a/target/s390x/cpu_models_system.c +++ b/target/s390x/cpu_models_system.c @@ -19,7 +19,7 @@ #include "qapi/visitor.h" #include "qapi/qobject-input-visitor.h" #include "qobject/qdict.h" -#include "qapi/qapi-commands-machine-target.h" +#include "qapi/qapi-commands-machine.h" static void list_add_feat(const char *name, void *opaque); diff --git a/stubs/meson.build b/stubs/meson.build index 0ef11976a2f..3b2fad0824f 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -82,6 +82,8 @@ if have_system stub_ss.add(files('monitor-i386-sev.c')) stub_ss.add(files('monitor-i386-sgx.c')) stub_ss.add(files('monitor-i386-xen.c')) + stub_ss.add(files('monitor-cpu.c')) + stub_ss.add(files('monitor-cpu-s390x.c')) endif if have_system or have_user From patchwork Thu May 22 19:05:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891716 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806131wrm; Thu, 22 May 2025 12:08:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/PiHHEVLSyGCUjxFJL3Ar+C1ErZzZ2v1YgKFF0vReZ1FJVn5VBf/oeYf0R2DBH94Ez09EoA==@linaro.org X-Google-Smtp-Source: AGHT+IHib2VyboN4l+sknwaaHz46qN/DBk+THuJnQJEkxP5DPIQj+io10T1zRYAry/j8DsWBsMM9 X-Received: by 2002:a05:6e02:3b89:b0:3d9:6cb6:fa52 with SMTP id e9e14a558f8ab-3db8431398fmr317082575ab.12.1747940881688; Thu, 22 May 2025 12:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940881; cv=none; d=google.com; s=arc-20240605; b=jl9OxG++RdAoHd1SSUzY4AIaMZAKTAeYhQlh3kzAHuG1DhXjLmXG4BGveSpt0+qCTA O5yWcszIo/qeI/62NnEKDrFakg8Z0safodOjqpkw+2GzDy5c1UPz12J8AqjX6jk4796x eNBxv/j+GW6T29hW+CeXlTQjMCixTmQzIOtUIlWSw/2M/vm8QPjjhxaRDhIvXqVwosNo DZJxbXxQ+rXX+3Zvkd5Qe4JT1pg3VsSlhKTbaptTWpjarvsYh1bgJ/RX/TueMzWg2nV4 aFpbWvE3TVHjgvfS5PArPLIs7Z4bJSv3FGR9HdxSHJzrm0PSNXKS8n3HPUAIxLC1r0UO TweA== 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=WbuE30bzkvC7HXdLQ6ZO7n7D2r6LctI3gV9TqL6oovs=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=FwXyBMt2zDJYITyIpRkW4NjbtLsvvhsIPmqN3aAQZTdFrqWQkG0NWPb01rF9PK0btg ND9R1fUNz3rke6FjKdQ+q5wFv8mhxp+FHk4mNIccTLQR/b72EvisafaWzZg8CgExSz1x EoUJEox8gABsrWyUXkXXB05y6+vHqbw9y3DEqgO+3rPaN8S0YzvlaFEqcC2jJrVba8hY rAzMC6pdNUtozhJblJ4YGPRN+xPvMRdmDo+REHNxeaQM8broTcAiCdodx/23iYgiZ3PU O/UF7ie9WtZ8XbYbNoctdwIagilTe0vSTCBW0P33YQoKYN0B5XRyp+d3JodvU/aDVaEv QrYA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CUOlS6ZT; 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 e9e14a558f8ab-3dc723b40cesi101122175ab.98.2025.05.22.12.08.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:01 -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=CUOlS6ZT; 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 1uIBFy-0001wY-DL; Thu, 22 May 2025 15:07:07 -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 1uIBF8-00012W-L5 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:15 -0400 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBF6-0006Wu-Gf for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:14 -0400 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6fa8eca392dso8328646d6.0 for ; Thu, 22 May 2025 12:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940770; x=1748545570; 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=WbuE30bzkvC7HXdLQ6ZO7n7D2r6LctI3gV9TqL6oovs=; b=CUOlS6ZTFjNViJJsCSTBKDmfyj6P8O41x5cW0/3yLUN/TKGHrJVYnPdQz94ownVdY/ eVzOyaU8wl253L9nOYRNDz3p5U2lnrELr3gB9mjpeHvguZXTmN+GaSgDTG/xRHO4orBI 7/3pDbe/4+MZz+k8CVK3IiSme+hG18nLcMlOHPi/NlB4wJMeu12e6XYr1cd9dzFls2+k yIKDKBV2P6lrivX8GfX9E15hz4PhxbuqOJpKzgC43I3zjPC+RU+mVQU2CF0FVRuMnobM U1Ep78L6eaN1VSE5fhnji82QZwcLBl9uUb0an4kCJaFQmNe+/tgdplCVUk1HUc6f0VVX 82SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940770; x=1748545570; 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=WbuE30bzkvC7HXdLQ6ZO7n7D2r6LctI3gV9TqL6oovs=; b=fzDpInaPsAiC0vbyOGsPok6Uviz5p0MZk/kp9e1H3oMlvZtA/k3cWU2bZFYeyVc8Uw 8qAMY2/EuHg9xVw1izwLUp+zxmqueZfKAfKcGFJmiWD2wWVrEkXLoT4IZtEfKSZHElnQ YMKKDKv3OjTlAAvselTpY67+GKj06S1AdXV2sy05+cwjuP3NqNv/XVBIs4I05UpuzMn3 OgR65x3p4WQw+3G1mh6X8cnpWoGaDUFS9ptFJOGTJUWYFs0GC7CIxtfrylGy50a6K7Oo RlOyz1FbgaBtQI1NrEiZVD9JF1KirqS+Us7b6fTSA+Y/hDj6i+vCG5TkG8Rt37qLmmvu lM0g== X-Gm-Message-State: AOJu0YxjNcTqYiZByylGe9SL2SgUignja3TTpQzId+imf21WKHJdBDAU GnJZ/x7ylgKKoJHWJKxZrQO7NOhA450tq1ugAsF6JZ7z+Cjwqi1Bxn1n2UxcnV/5DWpUDIW78Vm lzJTa X-Gm-Gg: ASbGncv7P6AXTqozBdYBcv/lC6xQghktPGHAzMog7Th0XY2ZVF3ZHIMrtjQuVX76egi OQa0v/HVrXVqRhE2t52X7jMxKt6Q/W7Nc3FN/8MEe8zzfdyzLbRVUqgYqn/Bgmdb2mdzldjvQJl 5A/B7p/mCCFn+XagTNGb4UZ1G9gjBunoWeF8ckqcKPeqoKXzAcvkGaFo8w2v62qagwD955sPnvM 8M2YX7WyXWIw/xbq517HwC1AVghnmDynnMIXOCaHxff8x9wPwcr/nNOAStVvxGQiySt7IXc1g0b j2pfAZFFQYcKzUjsIi+VTfbEx7+FcuIsLPJfbsW8UQJlGYGAbng= X-Received: by 2002:a17:90b:4b0f:b0:308:65d4:9dda with SMTP id 98e67ed59e1d1-30e7d55654cmr42856893a91.16.1747940759284; Thu, 22 May 2025 12:05:59 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:58 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 10/15] qapi: make s390x specific CPU commands unconditionally available Date: Thu, 22 May 2025 12:05:37 -0700 Message-ID: <20250522190542.588267-11-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=pierrick.bouvier@linaro.org; helo=mail-qv1-xf32.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_S390X and CONFIG_KVM conditions from the CPU commands that are conceptually specific to s390x. Top level stubs are provided to cope with non-s390x targets, or builds without KVM. The removal of CONFIG_KVM is justified by the fact there is no conceptual difference between running 'qemu-system-s390x -accel tcg' on a build with and without KVM built-in, so apps only using TCG can't rely on the CONFIG_KVM in the schema. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- ...machine-target.json => machine-s390x.json} | 16 +++++--------- qapi/qapi-schema.json | 2 +- include/hw/s390x/cpu-topology.h | 2 +- hw/s390x/cpu-topology.c | 4 ++-- stubs/monitor-cpu-s390x-kvm.c | 22 +++++++++++++++++++ tests/qtest/qmp-cmd-test.c | 1 + qapi/meson.build | 2 +- stubs/meson.build | 1 + 8 files changed, 35 insertions(+), 15 deletions(-) rename qapi/{machine-target.json => machine-s390x.json} (85%) create mode 100644 stubs/monitor-cpu-s390x-kvm.c diff --git a/qapi/machine-target.json b/qapi/machine-s390x.json similarity index 85% rename from qapi/machine-target.json rename to qapi/machine-s390x.json index f19e34adaf9..966dbd61d2e 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-s390x.json @@ -1,6 +1,7 @@ # -*- Mode: Python -*- # vim: filetype=python # +# SPDX-License-Identifier: GPL-2.0-or-later # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. @@ -15,8 +16,7 @@ # Since: 8.2 ## { 'enum': 'S390CpuPolarization', - 'data': [ 'horizontal', 'vertical' ], - 'if': 'TARGET_S390X' + 'data': [ 'horizontal', 'vertical' ] } ## @@ -54,8 +54,7 @@ '*entitlement': 'S390CpuEntitlement', '*dedicated': 'bool' }, - 'features': [ 'unstable' ], - 'if': { 'all': [ 'TARGET_S390X' , 'CONFIG_KVM' ] } + 'features': [ 'unstable' ] } ## @@ -90,8 +89,7 @@ ## { 'event': 'CPU_POLARIZATION_CHANGE', 'data': { 'polarization': 'S390CpuPolarization' }, - 'features': [ 'unstable' ], - 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] } + 'features': [ 'unstable' ] } ## @@ -104,8 +102,7 @@ # Since: 8.2 ## { 'struct': 'CpuPolarizationInfo', - 'data': { 'polarization': 'S390CpuPolarization' }, - 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] } + 'data': { 'polarization': 'S390CpuPolarization' } } ## @@ -120,6 +117,5 @@ # Since: 8.2 ## { 'command': 'query-s390x-cpu-polarization', 'returns': 'CpuPolarizationInfo', - 'features': [ 'unstable' ], - 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] } + 'features': [ 'unstable' ] } diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index d8eb79cfda6..a8f66163cb7 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -57,7 +57,7 @@ { 'include': 'qdev.json' } { 'include': 'machine-common.json' } { 'include': 'machine.json' } -{ 'include': 'machine-target.json' } +{ 'include': 'machine-s390x.json' } { 'include': 'replay.json' } { 'include': 'yank.json' } { 'include': 'misc.json' } diff --git a/include/hw/s390x/cpu-topology.h b/include/hw/s390x/cpu-topology.h index 9283c948e3a..d5e9aa43f8f 100644 --- a/include/hw/s390x/cpu-topology.h +++ b/include/hw/s390x/cpu-topology.h @@ -13,7 +13,7 @@ #include "qemu/queue.h" #include "hw/boards.h" -#include "qapi/qapi-types-machine-target.h" +#include "qapi/qapi-types-machine-s390x.h" #define S390_TOPOLOGY_CPU_IFL 0x03 diff --git a/hw/s390x/cpu-topology.c b/hw/s390x/cpu-topology.c index 7d4e1f54727..b513f8936e4 100644 --- a/hw/s390x/cpu-topology.c +++ b/hw/s390x/cpu-topology.c @@ -23,8 +23,8 @@ #include "target/s390x/cpu.h" #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/cpu-topology.h" -#include "qapi/qapi-commands-machine-target.h" -#include "qapi/qapi-events-machine-target.h" +#include "qapi/qapi-commands-machine-s390x.h" +#include "qapi/qapi-events-machine-s390x.h" /* * s390_topology is used to keep the topology information. diff --git a/stubs/monitor-cpu-s390x-kvm.c b/stubs/monitor-cpu-s390x-kvm.c new file mode 100644 index 00000000000..8683dd2d4c6 --- /dev/null +++ b/stubs/monitor-cpu-s390x-kvm.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine-s390x.h" + +void qmp_set_cpu_topology(uint16_t core, + bool has_socket, uint16_t socket, + bool has_book, uint16_t book, + bool has_drawer, uint16_t drawer, + bool has_entitlement, S390CpuEntitlement entitlement, + bool has_dedicated, bool dedicated, + Error **errp) +{ + error_setg(errp, "CPU topology change is not supported on this target"); +} + +CpuPolarizationInfo *qmp_query_s390x_cpu_polarization(Error **errp) +{ + error_setg(errp, "CPU polarization is not supported on this target"); + return NULL; +} diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 15c88248b79..040d042810b 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -100,6 +100,7 @@ static bool query_is_ignored(const char *cmd) /* Success depends on target arch: */ "query-cpu-definitions", /* arm, i386, ppc, s390x */ "query-gic-capabilities", /* arm */ + "query-s390x-cpu-polarization", /* s390x */ /* Success depends on target-specific build configuration: */ "query-pci", /* CONFIG_PCI */ "x-query-virtio", /* CONFIG_VIRTIO */ diff --git a/qapi/meson.build b/qapi/meson.build index ffe44f9e0b8..e038b636c9d 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -39,7 +39,7 @@ qapi_all_modules = [ 'job', 'machine-common', 'machine', - 'machine-target', + 'machine-s390x', 'migration', 'misc', 'net', diff --git a/stubs/meson.build b/stubs/meson.build index 3b2fad0824f..cef046e6854 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -84,6 +84,7 @@ if have_system stub_ss.add(files('monitor-i386-xen.c')) stub_ss.add(files('monitor-cpu.c')) stub_ss.add(files('monitor-cpu-s390x.c')) + stub_ss.add(files('monitor-cpu-s390x-kvm.c')) endif if have_system or have_user From patchwork Thu May 22 19:05:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891719 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806348wrm; Thu, 22 May 2025 12:08:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU7hSWyhxtEpkkFj1VBitCIprcBydn5t8O0HqGuQo0y2ryz6rDoXYutoiM9AkV5VnW8FRxf3w==@linaro.org X-Google-Smtp-Source: AGHT+IGN/qx/e4AHGsynXYOZLJtlSMAzKjCdDUuf14RDe4rS5ctXsqA9Df80fgJ29wlBtDGpxzhc X-Received: by 2002:a05:6e02:154d:b0:3dc:787f:2bb7 with SMTP id e9e14a558f8ab-3dc932db8c7mr3266445ab.17.1747940910657; Thu, 22 May 2025 12:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940910; cv=none; d=google.com; s=arc-20240605; b=FzVZ3DZ8W5AQ9rdmT6JqyBkcrpo292qQ9Rp05Je2prHDjQP/fDaT+7SUG7e2rgDU3w ztudQdF8dzeYu+3UbAeAa38A58VZotlF0jVzKkT0jLIEuAyqbPJ+vcm828RgkV2HvXwI blgwDCfhFdmjhSGfEIqgJyIktW+mB6wy+f1vR1dGVfTDRGzIAISII2TfPvz/xbYS6RVT 1IIEEt9JZWwIsjW3e9riHHUGwWqr3bsuoYtxAEQWm0HuOc/9tt5CXCnPzwrxIT20FGmK GaqgOzfC89h0jQmdFZcUKzZX8ZG1EoWs2osLiQbi5vTLaSvpeKkFM7PlnYrvl9sr5WAc C0WQ== 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=eI0EvUmIkbWrjMKnBfnwOSekuZrl/EU3iIxo3aepxTQ=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=BXHtPEDFxu0Jj5nvsnK/55gf3lKK0QfRskkCvh+b0vYH6VC4rbobbRWeqiCJa8//6p UXJZXCVro3YSMyPbjmzLT6TLwmEqkaeNPGGdQw9OgP1lDHs9CigPrbxZJ/QnMMNXk0x7 Fv6jzjfXxbVHssGdpyV1hWYHHu6zppxO1q1X9Np+3sSvOTRYidaWA2Hs4LzQWLtUe1cI PzQfEA+8Iw43lNk4GfPiy2W3X8P1s8bc8IOiKjgb4awWIlnV/bTAmrdScRxKwqKIy4Cc DMFeofWdHARrUnDvoPlRXlj8W7C5TENpBfj6wu9rgSJxXv73f/00bGzQWWmgbFFljzOa GA+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yN7jISKN; 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 8926c6da1cb9f-4fbcc4b4ad6si16839497173.121.2025.05.22.12.08.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:30 -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=yN7jISKN; 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 1uIBFv-0001h1-F1; Thu, 22 May 2025 15:07:03 -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 1uIBF2-0000xm-KY for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:10 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEz-0006U6-Og for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:08 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-74019695377so6161262b3a.3 for ; Thu, 22 May 2025 12:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940760; x=1748545560; 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=eI0EvUmIkbWrjMKnBfnwOSekuZrl/EU3iIxo3aepxTQ=; b=yN7jISKNttC6ki5CzMzcTEmiTW7y4aEEvtJo/cEFYxRYhhVd6c+ZEzpD2OJbBE70BH psudSXnaxXZqfV3rAv3N/YHRyL8G0VZXMZv/xvbqi0zYAjb+0EBZIZXvKPUl+cemg3J9 eFEbUMxLCJluv7ZJk1+oUA/FdUOgG37ly5IGvjeAZVtA9SqdAbAn6urkN9fSqNKW31Y4 7gvMk0aYPL1AG7gngF7Gf9e2tp9LJfN+HrACNfdSYUZOCIgM4uOD9fz21K37DimHaT8H P2hzcF4TNlhJTuftQ9xdqJLvTD5yWOAD1LEL09J5f251To3CJct6846ApB2vt2qgJPEB BTnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940760; x=1748545560; 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=eI0EvUmIkbWrjMKnBfnwOSekuZrl/EU3iIxo3aepxTQ=; b=RqEIieEOgrjSuDC2SFB6Mtnr0yjsCS0W9zGMWfwTwRoAy2enwC8nix8YLR4IqWI9qt VWttLBPm4AHHc1zyahZ7Z/lBnNXLiOSZ7TuoEh7WKIBMQlrpnJdDFlNE+FWMWsvnkZs3 aomkMgXLbARhDsDvdXfZt2IaJqiQsFYpm+trzQVaI8OILQoNd4jDowhz5E6/dCmq16A6 fSfKg4jXRFIzxNxi7KT+SeDKnsr03X84t/d5ildxgtABY1miUNtXrA9J+xbOMRdZKoF8 vgWkNp+wd0FZCIC7KTMSMGZ9uMUBPOgjG9Uk2PvU9sKeeW0maEiRWta068q9xgw6sLJ4 tB9Q== X-Gm-Message-State: AOJu0Yy+rj4BjiEvu0gwmXHkw1EGOPkh4diNG/G/8PQw3PV/xPj+kify AcJHPCwiabVbZovjtdKv5D7KLEriELFKMWrgryUWz4WIteZnpNTyWDokgiTcGCiyEozgLL5bWxn XyGBj X-Gm-Gg: ASbGnctPBWk8MsklRQOezVxk/4fwp7AwHtxzRJsmxW8Ty62vGumlrFmNbFR3Xlu3ek0 mE8KOscIjJAZ4ib6fIeimrlv9iCSDwFHAEtb4aOi+QmWrAJHIZkcz4VgyXfPoqIiyWkOoE3Nvpl BInfqmqh6+4bpLhGN1rQWTMu5y/iFytEOKMXX0uJVwgX5II4vV9lycj5BzZ9yg/MaUYU93swaId n8l2+NQi1zrYX8K4N9JltITg0XQdbUjqFDCEo/0LFy4zM9APC1bcwTl0UrXaDESHDTMbu0x0gq9 6VdX/OKS0rHGQBsRgCunY7h+b65t7BvGDsihaU0Jz/btdjb050c= X-Received: by 2002:a05:6a21:9012:b0:216:19c1:1f54 with SMTP id adf61e73a8af0-2162188b866mr36919548637.4.1747940760545; Thu, 22 May 2025 12:06:00 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:59 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 11/15] qapi: remove qapi_specific_outputs from meson.build Date: Thu, 22 May 2025 12:05:38 -0700 Message-ID: <20250522190542.588267-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42a.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 There is no more QAPI files that need to be compiled per target, so we can remove this. qapi_specific_outputs is now empty, so we can remove the associated logic in meson. Reviewed-by: Daniel P. Berrangé Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster Signed-off-by: Pierrick Bouvier --- qapi/meson.build | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/qapi/meson.build b/qapi/meson.build index e038b636c9d..7582c2b5bcf 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -92,7 +92,6 @@ qapi_util_outputs = [ ] qapi_inputs = [] -qapi_specific_outputs = [] foreach module : qapi_all_modules qapi_inputs += [ files(module + '.json') ] qapi_module_outputs = [ @@ -110,15 +109,11 @@ foreach module : qapi_all_modules 'qapi-commands-@0@.trace-events'.format(module), ] endif - if module.endswith('-target') - qapi_specific_outputs += qapi_module_outputs - else - qapi_util_outputs += qapi_module_outputs - endif + qapi_util_outputs += qapi_module_outputs endforeach qapi_files = custom_target('shared QAPI source files', - output: qapi_util_outputs + qapi_specific_outputs + qapi_nonmodule_outputs, + output: qapi_util_outputs + qapi_nonmodule_outputs, input: [ files('qapi-schema.json') ], command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], depend_files: [ qapi_inputs, qapi_gen_depends ]) @@ -138,7 +133,7 @@ foreach output : qapi_util_outputs i = i + 1 endforeach -foreach output : qapi_specific_outputs + qapi_nonmodule_outputs +foreach output : qapi_nonmodule_outputs if output.endswith('.h') genh += qapi_files[i] endif From patchwork Thu May 22 19:05:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891720 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806460wrm; Thu, 22 May 2025 12:08:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWuIpyzz1Rd7Vng2DXXS7L3GBcf+EmBAtpjyALbGFtvw9YoXtBW9py8N+//g18cDdGHTSS0QA==@linaro.org X-Google-Smtp-Source: AGHT+IEwZSnrIQjuimh903CHnaB6I2x2m3141J9hAcS5rxGCPp/SKfV3N3Q7h6Sh3h6u3O0cIIGP X-Received: by 2002:a05:6602:3785:b0:85b:4afc:11d1 with SMTP id ca18e2360f4ac-86caf0d440fmr27795239f.5.1747940924819; Thu, 22 May 2025 12:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940924; cv=none; d=google.com; s=arc-20240605; b=G5UiaWEW9byCzObDTtWNw1KMDlAK+ys5CJ72dr44/JCnsa74/O5Jarn50lqga7uvNj pyF7jw8uDNr7ZG3NlP5/xVBqjKvfpYEgwB9cQ1Q81wbXWCzmfYabthPu5zy+LepWvlgT 3RANzaIDMneMsBrEweVA54T/cAntGXcJWDvLFunJjxfLMxQfthCdp8/zHQcN2ETavHND HhAGkZ2yguL7fmqM2WYZmYsauAjoBsFRbkhF3TK4U9vYDr2ynGQ/eYIL2ncoW0o+gjzu 7vmsQh2bFy6ZlYiY7kZvD6QMIlX1cnZ1xYfZcMrEe9a/vSuoTkpk5OBiP7VSxQ5AowCt MDgg== 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=xKpDcwMErvQxgyaL+Q2tctV5ddB+KbCBa/wlI68stYM=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=W+JFvkA6gVUVX+1rye7yfGL9f4dk6i8bDXZD/IgRtdsoKB7XeG0egfH87NpBMKAKZB AzNkrfQ7MYS71QqTHHLrD+cIT9pLWAGrnhb6jkB1tzdrXjWnrQaUWVHVaS0Fe2HaZlp1 6Q+T6kehL75DNlGrm8jWhSSLpAXUXvatz2LMfQlVlKj6YqX4lArkjWIQPBALGSs4mowF F9IH2YfzIS08MgjBrh+qVx4VC/+zH5A3tvqKBbeADd92avg19DvpBVbUo4n/n6gbnjQ4 HBwu/uedPC6ocVpAZAuB5ZZq6InJfjt2T+I+TK2TD9+p3qbVcqKVVcip9ETyTqTKInKl 6Afw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NISuLF01; 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 ca18e2360f4ac-86a2376ddd7si694708539f.122.2025.05.22.12.08.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:44 -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=NISuLF01; 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 1uIBFK-0001Af-VL; Thu, 22 May 2025 15:06:27 -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 1uIBF2-0000xl-Hv for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:10 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEz-0006UG-O5 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:08 -0400 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-310ce23a660so550173a91.1 for ; Thu, 22 May 2025 12:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940762; x=1748545562; 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=xKpDcwMErvQxgyaL+Q2tctV5ddB+KbCBa/wlI68stYM=; b=NISuLF01GpztabWUlR67hZXKEt3eGD+MXTBAheHDsNDT55HiYetp5Nt3DBjhF71eod sxc/8FiynKiqQxg2ETayl4IpYvudncxlIVoV9mAkaG3GkKHv+FfcDEgrIoXHynjoWEVL XhPn8erZJd8y5H1gA8PvjKG4DtlbaP5t8GnkuhXhH5RblCuyb1izuPMS5njeT7Q7k8Ru JpieevWP0lZ4EsuOFhlGGlo7hQ6Wt9yeH93J3XFzQ8h59hgolfO+r6xBZv8Uxa0putrX j022Bievj4Le7Xe0WK5Ngm394+FUEfTmfdnmR+NS9XOl6kudd5El6LOF+CQVlAv1gcQJ VavA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940762; x=1748545562; 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=xKpDcwMErvQxgyaL+Q2tctV5ddB+KbCBa/wlI68stYM=; b=KEGcKnjNI8vRK9OWOqga9hmdTpjAywRrbjvwNBsKz954FpH6GYVoViBJ12WyMsq08c C97+JAaSnHLYZo/Iu6hWZ2K6Wm5cz9TZ8uZvNJeH3frFSSEUg5rtM8L1wxY9X5CcjoRi HDnkMyISTl51zFwBT0ruoVsXP1dF2LUkjKu5g8GVBs8V/NzWgqYDKISoGHydiNSxwbKb Pfs96RFtvHkIcAhmBvg/b/heTDiyVCu3ydU/fTwuc8jhKoFFTU5pC0MWiDJmrQkhVjof trNly1S6Sn+OQ26OcEg54H2Q2nkMwnJTf2jo3wGqHQff7aDocGQq9b61sHi50V5iC013 6MCw== X-Gm-Message-State: AOJu0Ywx46fEoaxIONjtTSaDdihLrc2ReAEk1YBkuHR/WdPlhBt9YCK7 a/tYnErBpyq4BIVAzSFjTJ3rQ6/eeoRhkRW+e4wYbiNEwTCx7g8tSqOHSWYsfkMST7O02SZHM4K SYpVn X-Gm-Gg: ASbGncteOTpw+1WM/HP/PvBxZNoF/SCDZ1CTdMPjXX6DAN9DmWiLFdm/34RLULJmKY5 IIEjZRkeNODYQ3oVDf77TnXuSDsv3ce/qfmUZ6MkNCzgKwHCol/Q9+Rzdl1lg72v4eL+hzEfcSh DZbkz5si+U/8QryPc3FoyFMN6HvYzxN8U7iaaJlgeYPVY0NqsD07o1tZPT0TZjOuXvMGbcCTumz wd+nB4j3u/gVN8cg/98IOw7k8wUtKy5k4+cQ1rqqUCrZzaIKoK2Bu/kzLol9ANqwrDSH1AeHYS1 fx2hdP2HyQKOHTvhbrCD42IQefJPGR/RtmDOj0ISC/FiXsRS3kM= X-Received: by 2002:a17:90b:3c03:b0:308:6d7a:5d30 with SMTP id 98e67ed59e1d1-310e96e6cb5mr613322a91.18.1747940761656; Thu, 22 May 2025 12:06:01 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:06:01 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 12/15] qapi: make all generated files common Date: Thu, 22 May 2025 12:05:39 -0700 Message-ID: <20250522190542.588267-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1030.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 Monolithic files (qapi_nonmodule_outputs) can now be compiled just once, so we can remove qapi_util_outputs logic. This removes the need for any specific_ss file. Signed-off-by: Pierrick Bouvier --- qapi/meson.build | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/qapi/meson.build b/qapi/meson.build index 7582c2b5bcf..3b035aea339 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -85,8 +85,7 @@ qapi_nonmodule_outputs = [ 'qapi-emit-events.c', 'qapi-emit-events.h', ] -# First build all sources -qapi_util_outputs = [ +qapi_outputs = qapi_nonmodule_outputs + [ 'qapi-builtin-types.c', 'qapi-builtin-visit.c', 'qapi-builtin-types.h', 'qapi-builtin-visit.h', ] @@ -109,20 +108,17 @@ foreach module : qapi_all_modules 'qapi-commands-@0@.trace-events'.format(module), ] endif - qapi_util_outputs += qapi_module_outputs + qapi_outputs += qapi_module_outputs endforeach qapi_files = custom_target('shared QAPI source files', - output: qapi_util_outputs + qapi_nonmodule_outputs, + output: qapi_outputs, input: [ files('qapi-schema.json') ], command: [ qapi_gen, '-o', 'qapi', '-b', '@INPUT0@' ], depend_files: [ qapi_inputs, qapi_gen_depends ]) -# Now go through all the outputs and add them to the right sourceset. -# These loops must be synchronized with the output of the above custom target. - i = 0 -foreach output : qapi_util_outputs +foreach output : qapi_outputs if output.endswith('.h') genh += qapi_files[i] endif @@ -132,14 +128,3 @@ foreach output : qapi_util_outputs util_ss.add(qapi_files[i]) i = i + 1 endforeach - -foreach output : qapi_nonmodule_outputs - if output.endswith('.h') - genh += qapi_files[i] - endif - if output.endswith('.trace-events') - qapi_trace_events += qapi_files[i] - endif - specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: qapi_files[i]) - i = i + 1 -endforeach From patchwork Thu May 22 19:05:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891712 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2805955wrm; Thu, 22 May 2025 12:07:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU4at8O2sR6+l2YisGgVNKqHNvrxEN2wuS+kZntiOC0+HGOaGL8kyXEnuc/TbVra31u+mUu0g==@linaro.org X-Google-Smtp-Source: AGHT+IHeQlzOa5ry6T3/+5SM5BbggH+2lbwCmmERNs6xU3eRxhShPXbMtL3CPU/kOWmPYRyXosFe X-Received: by 2002:a05:6e02:1a04:b0:3dc:857c:c61a with SMTP id e9e14a558f8ab-3dc857cc821mr82553445ab.17.1747940862234; Thu, 22 May 2025 12:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940862; cv=none; d=google.com; s=arc-20240605; b=Fy1V6JZcZg+bQsWnMowfElEFuB2z76BAqRyv26AAHYt75mx1AKzmSIimYWyHKoX7U8 yRUqTY066E498J9MtcEIjSR3VciULruX9s6oi3Iah6RFsTcc8y/jU9cLPEY90IC/BZr/ Wbo9cARWTp+lU7xfSAyhM+X+jRFPWucCFWafFw3ulmSODs+Po23+Yt3y2kiFRxamcbr3 muAu70qD6ufRoXdzLryfTh1bkJtH4WUG0y4qQB1TABgXiSXd/xw0PfINrsFNNPFstx9S 5bCd7rS0cU9YRZlFJVM8QL/eLjscOCyYu6R2pykrWm4b4JJ4EoGeMpb9ZbrupoprGxLC nneQ== 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=xFNyLq61X9oj5XcqX9ULx+NmBqVjk0YKZDfCa6aorIU=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=gC/yi3vgBZn2Fy+437NFJ+ATtJXAgsyUkRUKGULCud6bESmRW3TGfo8Pj7MbSNYaI7 0aQFr1CXUVFg3riK05h36YVQqX1mp/G2nvnxf1J5V/jL4sCfypGnY8vkmwCGkVuE9C4E bZZhG78UPkyeDtRSrR2MvmSKHgp/u77jFohDDBRzI2HlyAzwjrkjwusFVZ9yb/r0r8mg 5jj9AmtgC/9xmoHVYg5TGDyVW3RFnT7XtEeWYOhGbGDtYqsDSenZEtUFUHrF1ce9rn3C 4ZxkhkNiELyVx8pML8zI41esj5vzt0JNsop3mP8FUaYV9fVtZtF2XCJ+iyK9EvF7ShHP hj+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXqI4uIQ; 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 e9e14a558f8ab-3dc888fa665si44790425ab.8.2025.05.22.12.07.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:42 -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=RXqI4uIQ; 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 1uIBFy-0001sm-5Y; Thu, 22 May 2025 15:07:06 -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 1uIBF3-0000xz-0B for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:10 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEz-0006US-Os for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:08 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-742c46611b6so6930427b3a.1 for ; Thu, 22 May 2025 12:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940762; x=1748545562; 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=xFNyLq61X9oj5XcqX9ULx+NmBqVjk0YKZDfCa6aorIU=; b=RXqI4uIQ3yCkjnDoeg8Nsx+8nHFtDPChPqFuBulcwPG9ZeG8pYSbzwp/1wXHPaGnYm HajfknDF+kLKlFD42Us7StPntEHnRLfc9xe1v7GpG6+1YiwvAyKmZVf9Z9g9arzZilza nrum/dYKVCCOOoR1LHO2KPFht/wl32NX7IUcg5b6r9d7b9/eKYRjVsP3gLNdZ/TvQxzK 2GSljnyFdbNPMjQYlaZ1oAi1JgiTlMTU3XrrKcbuhJkeZ2CRwFFc72koHyi1qNbeeTY3 EKr9zCOmIhaGY9LUjFYFw3tRVx0eYgnFbPjYAKNpDoCZ8F6ntzRJHPEHq2LvQXSy73a8 mAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940762; x=1748545562; 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=xFNyLq61X9oj5XcqX9ULx+NmBqVjk0YKZDfCa6aorIU=; b=ZOGse1gWUjxXxGRE1cgWKebe9puVR4JUDoBSWgdj1HzYb1zOmczsqpPg6dj4K7+iZI WFBm71gp/oO8V5c440jILvznQvlwaUVrIapCgV2g9fKzVJvQRbVTpdek4YaNW7yivXdV J7U7iHOE6mYpf6h3awDnhn4EF3QQ/AyA9cjqpvEROOj/q9RwxDCtm7aR/q95AvOSBhw5 gDm+1L6/1kDmf0DUhUbjqcZ9VQKsBTeRpm6MTQWQop8RNbXMh3cCnndBQ5+IBnP0L/Ic CGW3bxUdD4s+/zcJNYw4lXdFOT4QANbVFOQeRZR2Cd2Pb2PxZb8Qb4nqUkyAwVY203Qw USjw== X-Gm-Message-State: AOJu0Yyq+EV1VhBdZJZQFYZ+yt8x9w9mGRbGE3/ghbquX7k2d6Z0KWpE 6/+P84ypM16YKOEY3yiqDdFtXNMK5UWm0z4Mx/BCbYO8NIfxI97shiA+POsp8jfgNFeNRUbgWHf qQcNK X-Gm-Gg: ASbGnctaStAHXq40s894tQKcT/N8MC/r7kCRK3JoUz/MBgS4zStZFV/6xZT9uPXlW97 +k4DOGxIkjftTjRYdJ4Qd6aIAZ4C7bq2bcZdk89eUEkohZ5IEwo5yBSTJVdzG1rkvkUsLkc/Q0G gowMuStKozyEW8OenPC0DruO8CW4ZrsRrO2RIKEaWLvzk1KGRSW9ZLyChoSfpWvQ4VzeKt3+nDp Z8auPM0IhMYXf6YQlTZB8R6zBi66e/bTil7R+bO/+caR7oxwys/xTzZIze8PhOhiJThHYv9ev1w 4hHSMET8ULt7NyawUNhPIxqHbLpeLMDcHy6gREgaCdq+SeabMnw= X-Received: by 2002:a05:6a20:6a2b:b0:215:dfee:bb70 with SMTP id adf61e73a8af0-2170cde519dmr40055087637.29.1747940762585; Thu, 22 May 2025 12:06:02 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:06:02 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 13/15] qapi: use imperative style in documentation Date: Thu, 22 May 2025 12:05:40 -0700 Message-ID: <20250522190542.588267-14-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x433.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 As requested by Markus: > We prefer imperative mood "Return" over "Returns". Signed-off-by: Pierrick Bouvier --- qapi/audio.json | 2 +- qapi/char.json | 4 ++-- qapi/cryptodev.json | 2 +- qapi/machine.json | 4 ++-- qapi/migration.json | 8 ++++---- qapi/misc-i386.json | 6 +++--- qapi/ui.json | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/qapi/audio.json b/qapi/audio.json index dd5a58d13e6..826477c3072 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -533,7 +533,7 @@ ## # @query-audiodevs: # -# Returns information about audiodev configuration +# Return information about audiodev configuration # # Returns: array of @Audiodev # diff --git a/qapi/char.json b/qapi/char.json index dde2f9538f8..447c10b91a5 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -34,7 +34,7 @@ ## # @query-chardev: # -# Returns information about current character devices. +# Return information about current character devices. # # Returns: a list of @ChardevInfo # @@ -80,7 +80,7 @@ ## # @query-chardev-backends: # -# Returns information about character device backends. +# Return information about character device backends. # # Returns: a list of @ChardevBackendInfo # diff --git a/qapi/cryptodev.json b/qapi/cryptodev.json index 04d0e21d209..28b97eb3da6 100644 --- a/qapi/cryptodev.json +++ b/qapi/cryptodev.json @@ -94,7 +94,7 @@ ## # @query-cryptodev: # -# Returns information about current crypto devices. +# Return information about current crypto devices. # # Returns: a list of @QCryptodevInfo # diff --git a/qapi/machine.json b/qapi/machine.json index e6b4b2dfef8..7f3af355b36 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -99,7 +99,7 @@ ## # @query-cpus-fast: # -# Returns information about all virtual CPUs. +# Return information about all virtual CPUs. # # Returns: list of @CpuInfoFast # @@ -467,7 +467,7 @@ ## # @query-kvm: # -# Returns information about KVM acceleration +# Return information about KVM acceleration # # Returns: @KvmInfo # diff --git a/qapi/migration.json b/qapi/migration.json index 8b9c53595c4..1278450e09d 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -282,7 +282,7 @@ ## # @query-migrate: # -# Returns information about current migration process. If migration +# Return information about current migration process. If migration # is active there will be another json-object with RAM migration # status. # @@ -535,7 +535,7 @@ ## # @query-migrate-capabilities: # -# Returns information about the current migration capabilities status +# Return information about the current migration capabilities status # # Returns: @MigrationCapabilityStatus # @@ -1320,7 +1320,7 @@ ## # @query-migrate-parameters: # -# Returns information about the current migration parameters +# Return information about the current migration parameters # # Returns: @MigrationParameters # @@ -2294,7 +2294,7 @@ ## # @query-vcpu-dirty-limit: # -# Returns information about virtual CPU dirty page rate limits, if +# Return information about virtual CPU dirty page rate limits, if # any. # # Since: 7.1 diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json index cbf85233eba..3fda7a20bdd 100644 --- a/qapi/misc-i386.json +++ b/qapi/misc-i386.json @@ -126,7 +126,7 @@ ## # @query-sev: # -# Returns information about SEV/SEV-ES/SEV-SNP. +# Return information about SEV/SEV-ES/SEV-SNP. # # If unavailable due to an incompatible configuration the # returned @enabled field will be set to 'false' and the @@ -336,7 +336,7 @@ ## # @query-sgx: # -# Returns information about configured SGX capabilities of guest +# Return information about configured SGX capabilities of guest # # Returns: @SgxInfo # @@ -355,7 +355,7 @@ ## # @query-sgx-capabilities: # -# Returns information about SGX capabilities of host +# Return information about SGX capabilities of host # # Returns: @SgxInfo # diff --git a/qapi/ui.json b/qapi/ui.json index c536d4e5241..59897fcb9f0 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -323,7 +323,7 @@ ## # @query-spice: # -# Returns information about the current SPICE server +# Return information about the current SPICE server # # Returns: @SpiceInfo # @@ -654,7 +654,7 @@ ## # @query-vnc: # -# Returns information about the current VNC server +# Return information about the current VNC server # # Returns: @VncInfo # @@ -820,7 +820,7 @@ ## # @query-mice: # -# Returns information about each active mouse device +# Return information about each active mouse device # # Returns: a list of @MouseInfo for each device # @@ -1562,7 +1562,7 @@ ## # @query-display-options: # -# Returns information about display configuration +# Return information about display configuration # # Returns: @DisplayOptions # From patchwork Thu May 22 19:05:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891709 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2805695wrm; Thu, 22 May 2025 12:07:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWfqccX9LTNwfR/mUYiTUivXAJscEbeTsctkuW37uqYEJ+JMf/JI1cB1QRHhfbBMDCCy7UwZQ==@linaro.org X-Google-Smtp-Source: AGHT+IEkS/sEhRvqrrki+RHoATMTq8//JsjB+NG162BmxADzFkGb9pa+Comco/pkj5CU3xDeHIDP X-Received: by 2002:a05:6602:4186:b0:85c:c7f9:9a1c with SMTP id ca18e2360f4ac-86a23283c78mr3553245239f.13.1747940826150; Thu, 22 May 2025 12:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940826; cv=none; d=google.com; s=arc-20240605; b=leWhqLZqaYyJ08K9oGAMhoFEjWM4rIhuEt9IHzbJ1TMow5c4Pc0j4jBshjO0wofjAq XTymcMLX1S5iKYgaX6QVRWSOGWL/pXw5IuOSEnqmD6/+wTV2UyF41zR79F/WadBDik7o GtazHljDBrPHICBi7yVXCXQrBoE6IrDHnZmCcTEQDgNzbfgJOc0QKcmtYbf/BVZQ0B1K EwOjrTGw5GHUOeyBS9u+xbJa4lNWEPwETTcpc/oaoJaQVpxgnUI2u0tsqM9RdkpZXSif C/m1admO60LFPuSw01trBo6kuDJu4InpMhF9rc+Ah+4lEIjMCPQzf5slZ1gshY/01b24 PNeg== 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=SGfL+RzDQIDa37K5e41+zNPdkMKsax67ftvf0bDSf/s=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=Me05b2U8wS6QoRXn8AkxPS/grIu4G5/ygNhvUvz19p4qInTmtBKNVLEPVyqUtwI14Q DqnKyL6VDlgeKZibCZuHtfkFSKZ6apCjHR5MXoBY9wLBkQM+pE2Aj/AaZmkWk+vcp0+U W26BvEwfFpE36l+iXlaSyKMF6Jz3Wle0Z7tAoUj/kT0qHrxW1UqmxoaLoHJwiaFbDOJ+ lmlosILPvFOMy25J+aDKuBSE3E1N9FPMbI98ipKdeI5hK4V5601JYRDALH93jyQ0FW2i y4RaejVNV2D2fgwrijVKSGFSkf5GyFYlWPmFoGKEWsmn77iBnoRgY3EnZJxIIR0e8iCI 0vKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIjxZbve; 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 ca18e2360f4ac-86a23736837si711569739f.102.2025.05.22.12.07.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:06 -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=vIjxZbve; 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 1uIBFG-00016s-TM; Thu, 22 May 2025 15:06:24 -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 1uIBF2-0000xk-IC for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:10 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEz-0006UZ-On for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:08 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-742c035f2afso3759397b3a.2 for ; Thu, 22 May 2025 12:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940763; x=1748545563; 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=SGfL+RzDQIDa37K5e41+zNPdkMKsax67ftvf0bDSf/s=; b=vIjxZbveqNRQ96bu0Q3RB/F73yjr08kyrSrkEUvfREhTjLEkD8OYS2KoPE6a9BNb3F Cxl0CV/HnV/w9fV1QqIkQE3VE45/HfKUzTQEenwwIvlwNJdccNs53qFvTcDuOvsrY7Aj +V8ZzktzIY4l87pOW2JVddKD1Rtskbk1403T0uW0CURR0dDmGUcClLW0Uxx4cT3DTnoc cDU++ql+HalvbgKQFJDqp0WX1AMyhapySXxsXsVwAbCBM5fPH6eHW3dkdM9wl0r9krt3 LZf+ShiQqeNlZg3Ny8qH2jyQdrFLIyMuBxXFCXb04A+o2Wg2YCYWLWM2mDE+uVYWje97 9aEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940763; x=1748545563; 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=SGfL+RzDQIDa37K5e41+zNPdkMKsax67ftvf0bDSf/s=; b=iGlQZxR7NrSPJxwtQTCrMimrmoMd+lvb9DgH4/0icI5dwWAqBKWvBvwgbHJyGDDTPB sDgRGHYpg4Z/quwnktNe167hv8NYxANe0AQFoA47DkEEcsyaWRMG8xSAN1JLPdtzC+1n ZWNEFV/pfs4zpgB+wDZSVOVJCIVzytJrCXl9wbQnfLQTaGCQgKS/MXkGFIB5R9aJuNmV diR6jPizdAv5Guw16Cgpbq6cY0bbx3hmxJLFjIifAQVz58ldTdiqrk4g/GSbdcZH32qm 4HNqK6BU7v4wEVKbnWQjDktosOWDafvkuyYCt4ElnF4tig4FNvC/dCtfn8r9I6T25E3+ 4Guw== X-Gm-Message-State: AOJu0YzXeaqFTusSFTFolDJVYhpbMIXPevU12mNG4A9LDlu4E9gWPFAR E1/MNMwSY3tRirTYLS1VjA3u4TBAkUC/8YFsVJbTdNtrxOz5gLa93cand66/mrPm3HPowWyCiyP c/9zd X-Gm-Gg: ASbGncvCNtSx2Mr3vZmfmGSjDlN2NnCY5WxL247CI5plVJwDEKMlRi9TTiLLnnnZbUk pwHSGPqpOFzA9ZE5hNctP7OaJ+v3W1yIHV2i2Flico2IVC18dnP5bkUMYF/itgAU5xu6WlEMLxd 6XapPeajLrgoYaSDJfTaK+OjCU106pBgNTTgsh9yL5A+I/DOOCDI76eG1ITk/328EYsVuDA7ww1 /16zMT0/tPDmyDOXDLkwG5pcgVCFNLdSAcV5leKifko6gNCo0I8BEL84bcXRlhmkaF0WaRyGWm9 U1GqXM8rR/m3xSuCa0lMrMr47lnUnW5T0+jjmUMKmAm6ME9LD3s= X-Received: by 2002:a05:6a21:7991:b0:218:59b:b2f6 with SMTP id adf61e73a8af0-218059bb4abmr31951480637.15.1747940763602; Thu, 22 May 2025 12:06:03 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:06:03 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 14/15] qapi/misc-i386: s/field will be set/field is set/ Date: Thu, 22 May 2025 12:05:41 -0700 Message-ID: <20250522190542.588267-15-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42e.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 As requested by Markus: > I'd prefer "field is set". Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json index 3fda7a20bdd..6f79817e382 100644 --- a/qapi/misc-i386.json +++ b/qapi/misc-i386.json @@ -129,7 +129,7 @@ # Return information about SEV/SEV-ES/SEV-SNP. # # If unavailable due to an incompatible configuration the -# returned @enabled field will be set to 'false' and the +# returned @enabled field is set to 'false' and the # state of all other fields is undefined. # # Returns: @SevInfo From patchwork Thu May 22 19:05:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891713 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806038wrm; Thu, 22 May 2025 12:07:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXsJD+udnJdEjm3IQPQPh6lrHTfX2Ssemg7QT8u7g6LdXt21twppExlS1f1WkSyGUINc80xZQ==@linaro.org X-Google-Smtp-Source: AGHT+IF7DmxZO+cvJvHXT0auVLvTs8WyoOYJU4QhiwQWH2Fq/5YI6VeTFC2yUKunazBRcolOAHTG X-Received: by 2002:a05:6e02:2383:b0:3dc:7fa4:804 with SMTP id e9e14a558f8ab-3dc932edcb0mr3496375ab.16.1747940872379; Thu, 22 May 2025 12:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940872; cv=none; d=google.com; s=arc-20240605; b=PPjUgcotSL52yyvtbln9xpUBAiRmnlCPEdLoMCiTr7ji44h9vOL3YHTzwRtrX2sAQt EF7qeMi+s2XAjNTm6DSYNDDRU5hiSZCnohYG12qvlnlzQulnAy6kS4Nh2EcPOtg1Ejcb FWBnLWS9KOR3eJty750FsQoStCmpzQ8y37I/1nljM7afr5srx8pT4Xm0IBBKnfyz+/Oa mG5XD+f0/6LCdehbhASp8tlZFe14DkBz9LUm74w1aACTOSTDkPxtKzFWc3Qj6aQf1xUB WpFHjiWnYWwPCg9E3RYsmkeqQPw+ljKd3mZKxjnc83Q33JkbZZ23FmUIK4+Dk70axcVL fMtg== 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=2aCXupjQf+KpZBVxWkFiZBckC01w8HvIqJ4QFv6HBfc=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=fmAlVtnFvaFAczgksfTUc2isjnEU8Kb2ZGvY4UDX2cQN2yTtrvNkbGLMqSYs6H+Fmr jXTCSBe1M8ogMxuvg2sG7zoQDd5hKvySLlfOOyRHAEDLCdHE+iixHom6HDszS68KcT8i BwkqmmtWqHMaklht0E2GWzUfc2a2lzKSGtPaUfcxwefFJ8avc3XGPx02Mo1z6XrbzGgm cbVqqOaXRImoei5TusMnaw8Jr/h9ia4K50SSziHW87AZkiCqmKsHuS+1kEFUkOnz6ZyB AYMj9PQox5qx5GtJOsnNszn3tgu3pe9B1AOsF3Hgh0AiD6PHkXZpqHsLLZ8ZrAc+Gya5 Mjuw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oCLSyFAL; 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 e9e14a558f8ab-3dc6814a78dsi139389385ab.64.2025.05.22.12.07.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:07:52 -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=oCLSyFAL; 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 1uIBGB-00028p-3f; Thu, 22 May 2025 15:07:19 -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 1uIBFE-00016t-HX for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:22 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBFA-0006Y1-Nm for qemu-devel@nongnu.org; Thu, 22 May 2025 15:06:19 -0400 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3dc87649822so19121865ab.3 for ; Thu, 22 May 2025 12:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940775; x=1748545575; 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=2aCXupjQf+KpZBVxWkFiZBckC01w8HvIqJ4QFv6HBfc=; b=oCLSyFALdZpwNw22TIIJ9f/oaHnfmJSQYBnkm5BXEzrR2E80LLluX43dO74FLApxv8 wcyVZLeMEM/drTA8CA7MjtrZMzld1S7MbTH4+/g2bcSSZjlO5mQ2PRX3IAKKpxOMik78 nZE4uLH2g1zv+p12L2bv+mI9Jb+Zx3tArnWpLKrScbcX9paJDRSVwFUiBr7T0BGMFmGb Ycidmj9nMrZAu8Rew9s/LTCihDiaqqS4oHUZE9p3Yh9eDYvRPvK549XCKWF95493eF8t J4otfosOhSen/4KYAlimCGs/UMT7jg7ml27O5crxLf2ur7tzwfvR34NoCr12k425vUot 93YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940775; x=1748545575; 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=2aCXupjQf+KpZBVxWkFiZBckC01w8HvIqJ4QFv6HBfc=; b=DzRDbdb37yAnl+Nla/MtkQj5runBXXzIujKfarXSwIhs23UCRJOOBNoUVieOqQ2Gwj TyHz+TFqTC+BqC+5I+WRezA3EqF4sVnT13f7aoZerM4ui16kkUc7yw3RDsXnnORC/JjD 2MNCPXVPwdKDFP9NfDNQirp2juMFF0nRHB1uxYJ7DLz6M9S5E3uE83RgTZDp28/baHgD MUN7GqGzJjS8FKQoCSAjYyJ19V1cRLjp7yjX1V1UU1UDrySmsAJoN+NQoJAr2/EaGI/b KbR8hXEqd3IquoQHxHjmaL/YB55Ja/E6VDxsuqPB7Rxlr2mt66v3MiUx7qW4V2khB/Oj tCSQ== X-Gm-Message-State: AOJu0YwKrUyYNDHxmI5iTp8L2GVo1tMcU+IyCZ5gsvakiZdSor854g/i qYR3iJ0JB8HeWnzpBW3qE9nW/tbb6dKSULsg/3w+oE74Ix/R3trRLIXlwYDQZrp/fyMtHIvMKeP p8ly7 X-Gm-Gg: ASbGncuMmjrzzbIUv4qNvUZ2o0hOYdpsG0P51dUDmHvAVOL7IEQsRIwff5VaD3EgxSV ld5p4RYps3nAp707rSn7b7aGWlF1GHovcyEPhD4NKENQ4w7FOK6wrWF/jVuv6UCqnfSvVq99pRe PrJ5b8S+DyEMQLD1jd6wvNithp6v5Sa1WliWojZ8s4HpRDYFTb+dkALASnyNvBO1Trx8WhHpAqA CV3VdCwIyNK08gYNRd8cO/afLuKdycqN5amxkLYGllrMLPDdDbnpXJLOTk/NsozBgazSkhzOR3u /4dlPueBf7YXh0PVamcnnPPlGwLFqwYIKLzF+SIN55qJJ81rOQI= X-Received: by 2002:a17:902:e5c3:b0:224:376:7a21 with SMTP id d9443c01a7336-233f23c9f98mr1715205ad.42.1747940764790; Thu, 22 May 2025 12:06:04 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:06:04 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 15/15] qapi/misc-i386: move errors to their own documentation section Date: Thu, 22 May 2025 12:05:42 -0700 Message-ID: <20250522190542.588267-16-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::130; envelope-from=pierrick.bouvier@linaro.org; helo=mail-il1-x130.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 Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json index 6f79817e382..796eaa5f406 100644 --- a/qapi/misc-i386.json +++ b/qapi/misc-i386.json @@ -166,12 +166,13 @@ # measurement for SEV-SNP guests is only available within # the guest. # -# This will return an error if the launch measurement is -# unavailable, either due to an invalid guest configuration -# or if the guest has not reached the required SEV state. -# # Returns: The @SevLaunchMeasureInfo for the guest # +# Errors: +# - If the launch measurement is unavailable, either due to an +# invalid guest configuration or if the guest has not reached +# the required SEV state, GenericError +# # Since: 2.12 # # .. qmp-example:: @@ -210,12 +211,15 @@ ## # @query-sev-capabilities: # -# This command is used to get the SEV capabilities, and is only -# supported on AMD X86 platforms with KVM enabled. If SEV is not -# available on the platform an error will be returned. +# Get SEV capabilities. +# +# This is only supported on AMD X86 platforms with KVM enabled. # # Returns: SevCapability objects. # +# Errors: +# - If # SEV is not available on the platform, GenericError +# # Since: 2.12 # # .. qmp-example:: @@ -234,11 +238,7 @@ # # This is only valid on x86 machines configured with KVM and the # 'sev-guest' confidential virtualization object. SEV-SNP guests -# do not support launch secret injection -# -# This will return an error if launch secret injection is not possible, -# either due to an invalid guest configuration, or if the guest has not -# reached the required SEV state. +# do not support launch secret injection. # # @packet-header: the launch secret packet header encoded in base64 # @@ -246,6 +246,11 @@ # # @gpa: the guest physical address where secret will be injected. # +# Errors: +# - If launch secret injection is not possible, either due to +# an invalid guest configuration, or if the guest has not +# reached the required SEV state, GenericError +# # Since: 6.0 ## { 'command': 'sev-inject-launch-secret', @@ -273,15 +278,17 @@ # 'sev-guest' confidential virtualization object. The attestation # report for SEV-SNP guests is only available within the guest. # -# This will return an error if the attestation report is -# unavailable, either due to an invalid guest configuration -# or if the guest has not reached the required SEV state. -# # @mnonce: a random 16 bytes value encoded in base64 (it will be # included in report) # # Returns: SevAttestationReport objects. # +# Errors: +# - This will return an error if the attestation report is +# unavailable, either due to an invalid guest configuration +# or if the guest has not reached the required SEV state, +# GenericError +# # Since: 6.1 # # .. qmp-example::