From patchwork Wed May 21 22:37:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891568 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355976wrm; Wed, 21 May 2025 15:39:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXakwPoHlqy+MrwEkKPbLfPITC6u+xSBk318iOrg/LQPAIprRFyJril+KCz/YTR0i/V3JCEyg==@linaro.org X-Google-Smtp-Source: AGHT+IEcrcf+PV7OqEDtT6kQThDvvlQoMMlSWSRvgGyobJPJsqJbefZvfgfdfDz4hK9o350AO9PZ X-Received: by 2002:a05:622a:590b:b0:490:8ce2:b79c with SMTP id d75a77b69052e-494b00e321bmr351873841cf.0.1747867195730; Wed, 21 May 2025 15:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867195; cv=none; d=google.com; s=arc-20240605; b=VKR3tlB74AGY3sHaiRQSBH2hB7mJrI/CyPOI/QV/g+mdwqv+kvvtF5AqDwmp3WqZ1m IjzBworIV24rrnekbteGxRmpQw/KP1qCvxQjrpBWDUmYPB7ZjMr5u3+zLPTkmR2m4S62 CH0VRlNHqZFDi78vdzPtrh0jSQIQADBuyFK+C/FPNmcctSsMZBEycSMlsaNxG0ZgWf7X mux/GzcoSDGXpih8Q4XLeJJzFe/TaGe1NR9O15E5+iCBQYMghJGQgCU+B3UvVQ7v5sli sEjxBI7tADm53ihJ/XBnOpRUiaZGrWroPqTwT+frULqMfIIg34b1uV+4GnGkwRkPin+A jJwg== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=DGDqmKde/WXnkgNpaX2x8xcL8Ab5goecAOF6y48YN/KNmLWmy6YIcGqTEFaWkIpDWC 6njmhqWMkEZ+pc6S9j8bFLxCznuQ2C+xLAyhX2nhjF9ybN8r2MWSOCozDWXSGu5QYhak XzeWsUTYxY+0WJ9KDvn5gRV8ggtqJVUdQmLvTn67knt7Esmq680kPC8re/RY0mKNcFfP oWULC3C+Q2LAiwXTkUQ8+aKwQ00lGW6wN8+WrQivKYYPf0a46nXYwaVlg+zl6y7UvXaZ vuYuclU6MRXsxVcuDhlMjZLliWBppckiFu94QJnR3STSehG3uUZFDUl2hWmIyYV1XpGu 1EUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRvrlvHi; 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 d75a77b69052e-494ae438c08si135747411cf.144.2025.05.21.15.39.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39: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=WRvrlvHi; 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 1uHs4T-000686-99; Wed, 21 May 2025 18:37:58 -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 1uHs4Q-00067g-U9 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:54 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4N-0005YD-D9 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:54 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2321c38a948so49244645ad.2 for ; Wed, 21 May 2025 15:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867066; x=1748471866; 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=WRvrlvHiYR7GGyvZJ2178TgaUvL4jPeHuF6VKRidhDOacr1FSGL67GE8w/sQFqZsaD xAJgaT0+7drAm5s6zyqwLFIrmkaFk0STFu2jcfSAYIFjolG4PiBbCknEna60xSj54XTe HN+isXia/9JPg1qHtqDPV/MtqxexuEaj3nPMymY7fEeI2iMaLbVW5RGt8WMREhmp00l2 4YqLD/0S2Y+0gchjy3gTjWe9d2j6lOniHwx6OBt+YupRRwQOI3R+nbrdcl/PIjpECk6o skwZ82lyrvG3XfBMDU8Y9dphS9VuSar+PmF8+jYDET5QQXPxDgLZxURN5WzGT3zWKixC zUGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867066; x=1748471866; 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=G7xaoL1qvj5zCjAx58zqNyw2Pz8zYMdjcy6/2IyysEQzjTaST6L0PMEbCrrR6mPLOu kWOd+29P9in29y1A56Lm3w8jV7x6+W6LCe9lF73kKpXQ6yX1zO87ZLDaTTgSQnzm5jti /qpm4b1RAj2JgZe/HrGPX0oEU7b+tpbBcFplp6VXE/ttvZu8mPbvJsPPSDf53/1NIu+f s1DnYLWKWzNqa5xaE45OrdnwSNSY46yLss49ER+kMZPFvj6awAVsPLOVw+T/l61wREUj bs+FpSEOz3oZbU/PSe+lBNV+YBHu3g69LZLutO5yPKNQiad12emJG0ocHDKI3bPDFeBN y45A== X-Gm-Message-State: AOJu0YxFfY3T16N3gxF2rRyibQ4gEG2gScwwkBjt1Bar5LqyJbAkgA59 WA/ZBu2nDSo4XqRsqwOxGwMWR71/vPVkOsqG4e/e4wMgOBmaE+LyzSU9oSeTe7hlR4CI0+AAIRh Gc4RJ X-Gm-Gg: ASbGncvgQZzaHZ0QrqTBHa1u7Qc2i4kaF4BVKSH+MKlkToUz87zjzDyxVaQPOD3scth 5tCgvkRMvuM+dpUhahOvZ0Foo7IMjX5eDv5eSi7hlPNRiPlDezpWqtifoa+huL2TPn2n8S4REnb 8/zmbUo92aGjf+6kX37ja/BztFXmRpMWv34hi07btshUVkKczgPxyq9untItfqHJkpSYLBhBa8i nbJ/8XCcp9uClA7s5/Lj3U6qpFvA1ijOvogq7kwRbQRY5AnlHbwT5kWx2feRt+E35/pw/H/rAp+ eq7pu93mn9IewyqCRCFbh1tsuE6f8YkEI8URbmtlx2q0OmGjBrg= X-Received: by 2002:a17:902:e846:b0:22e:4586:e33f with SMTP id d9443c01a7336-231de3bb190mr305305035ad.45.1747867065993; Wed, 21 May 2025 15:37:45 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:45 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 01/14] qapi: expose rtc-reset-reinjection command unconditionally Date: Wed, 21 May 2025 15:37:27 -0700 Message-ID: <20250521223740.249720-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x636.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 Wed May 21 22:37: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: 891557 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355592wrm; Wed, 21 May 2025 15:38:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVecaRBfhDJAl+acilcMaFKK42vlBLr0nN8OisIxxl6rNR31ZYg938Svsf/paHBdgi2to+VuQ==@linaro.org X-Google-Smtp-Source: AGHT+IH2UP9JM9SwQecKKA16glCyBsFmC7H3jJiAkOuvubWB+HEteYLm0+pFv6t6lOci8aeqcR1C X-Received: by 2002:a92:ca49:0:b0:3d9:6c9a:f35d with SMTP id e9e14a558f8ab-3db843022b0mr206273385ab.10.1747867109087; Wed, 21 May 2025 15:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867109; cv=none; d=google.com; s=arc-20240605; b=Gv70BWeABFvKTnEHWdyjesaQd7o76Lpnb9xvapYgfiIh20fofblT2ybVQ3j7/HXezL a2uwtiyYSCq34AczAJTkQDYaMl/1fbWo8jg2avmgjVviHcAk1MhReKD55PhaOtOF7pwZ BffUYPUwhhY7eNeTjBcF7BOf1okVXE8/mBs7EbAux+m+7V3u5e0LkojVYlisbaH6Zbbn TNYtI6si0U7QPnxZDhCzoNb09wyxZ6FfopuMSAv/1QHTql9AS2qile7fgSSQd+zH/qfj NKGP4ueFEiSNlD15I+5NEWikmF8VTF0JIkMI5vkbh9aUWtiP2oNdoH6ISBd/o+OijTJp K3VQ== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=SJy0vqfbm+qvs3u13MjqQSdiQMelAe+alSEcaRWNhVd2Xpd/5xtukpEFI5uon93Ebi NkDpaTJkhAIFDAgO6MQBAyVFm71C/4cSbfbfVNL7XDDwD4cdjeauXCMpNkAv7wl8MoWr r8DzBAwSRwkdI0Y3j0nk8MAXbxsLEbLfq9wzMfO45Eap0Ix2NampFiAeBLmo35lFyGxo /KCJNeH86CcmLkvlTvl2xckStIB6PIDBw5hUCNF2Uu4UZP6imfccyHrWXaai39vMRlLY Rx2m9IhwE5XvBQ8nU+vpP2JaysqiySsdFDBy9SSq02KcDzT6JRc8qSVG1nq8b5LcgBYY 0IkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5kPIwwT; 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-4fbcc4bce17si14482624173.142.2025.05.21.15.38.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:38:29 -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=J5kPIwwT; 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 1uHs4R-00067p-TX; Wed, 21 May 2025 18:37:56 -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 1uHs4Q-00067V-9B for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:54 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4K-0005YL-O7 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:53 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-231e331baceso57169295ad.0 for ; Wed, 21 May 2025 15:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867067; x=1748471867; 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=J5kPIwwTbm6fPN2VQ5GO8OR+eoRFt6h/pvrLFuwCV5YXYlrJfDb7v6PeyjDcn86Ibw evajKwgXGGgi9L+crXvXCJYcaJ2byyt4J0OK6PsC43iD+qdtwL6FH9rK4G+Co8OllLYU 2GGqWjOWn4uUarkxs2Lt1aR3/V6ksvMTkR4SC2hAV9cACBC9u0bWG9hrxuONi6PriRBi v2c4s63YzTpaSsNaGLpJ7/DRqIxgRrt00LxG+97Mxsgo62mjotZjiYbj3Gf4bAacw3Bo 3s0Tbql+/NENZBqp2fYr3Z77Qb+4kinyKtGbi3fqEhwPZmpb0dqxmh5pY6CbYM4gplq/ c5zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867067; x=1748471867; 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=e7/BxX5cu5OTKd73DQ22tPnF4e6EfdQtwGPPqGYjTsaeM4RCsgqpMdi70AffnRXecO oGq3ZXNlpQneg4qYCmTpqeDMUc0k9Tftqc+WOl2FnLzCWcUc7wr9a9tk4osOVCh74fOM MM619snfMGlUdIBBmNCRe8CjpXJBDTtE7t9jQziuiiRqs/Jt5L6Tw4zKNgYdI7FCcGaj 8N93fJ9mUgTLSlbLtIbYcS+b3qx1Bk3mlM06Ozl7jfW457YGub8lsvR9+d9m4BNS2K3N Od8+ytCwYIIJXHac9L5iO9Rf/x8Idyybbasnd3+auESC7I5xGGbyh3mN8fbK8Xqmrsay P5AQ== X-Gm-Message-State: AOJu0YzJn0UbN024hgAhukkQjr/kPnZ5zhA53gIsGDgWx4c9nQmp0Vet N51lHtXqILgmn5JGLQHSEtT9BbMZe6/XZxLq+fzkettIleVSvF0P3gVa3P19rJut0rGV9Fis4JH YITZc X-Gm-Gg: ASbGnctmpmJFH0wI6HviUK1GaL/Gprj4BP/9uTvo5hoqldeAS4F60U7tfQy/OFimKau 5T+GV7NSF3HZ56I+5vOhloVfJNrmmcL1qTc5qNgCQ7wtfNAhrlKt600U4pChSJUYTpzvCLuSY7Z j3tYsyWlPXNxLYG85LqFvROpXglLrv7CITO/6+dCrD+IbSUHmcO93Y8JV4WBugvPXtzrGdEKrE+ pXFGtwVDScia9HzgWB7mGMTX0TwlBX3j6NjOYBRgVsa0IyK5+JSheFw4wzAzDTYvYkvPgSNAHcj RvA/HOrqH/h6muI2s3Bf0slLoYnkbDtkThK4E9yAzipReDBWZeY= X-Received: by 2002:a17:903:1b6d:b0:22e:4d50:4f58 with SMTP id d9443c01a7336-231d454d2f7mr333454485ad.31.1747867066889; Wed, 21 May 2025 15:37:46 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:46 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 02/14] qapi: expand docs for SEV commands Date: Wed, 21 May 2025 15:37:28 -0700 Message-ID: <20250521223740.249720-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x630.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 Wed May 21 22:37: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: 891560 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355802wrm; Wed, 21 May 2025 15:39:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW92gpieq9hp1QAKQ6PxCaeVwHY/DvDp25MyzT0p8+0uXqNgfulO3ZKNYaV1y/KEOqAVSrRCQ==@linaro.org X-Google-Smtp-Source: AGHT+IH66mn5lKc5TwClzx9TwMDsr9i6HzHfC473Uzb9rIhGa1ZUB2ySXKOAv9/SFMP37ljXA86/ X-Received: by 2002:a05:6e02:5e81:b0:3dc:8a54:c244 with SMTP id e9e14a558f8ab-3dc8a54c31cmr24639135ab.12.1747867163952; Wed, 21 May 2025 15:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867163; cv=none; d=google.com; s=arc-20240605; b=O6IKzxmXur8wFIx8oinLNNQLPaSQLvqoJ4BSmbbrudhmS78iHsr9LJxiarFDt2QeiB e47qX9qebmbZM4JqwdCjdia7/QeT/e8XAn+NJYDWcshS3/Iuht4vjpOlIsfcDgl+j26Z 4Ts6dm/G1xhVDVPDgdO/i02Phh1TUkPUTMmQvJD9kl6f72DW5RD4OTSN9GVkOietOE+K culy+BSATHWlLvuWSQkxv3S69kmPqweDIlfXGkSIUoHLog+r1UsEJL5Kh8YxIoJrYzLa H+1mFiguY0xCWlpLpY3EtDKZTvhRG2K4s8rAgAnsnPuepUNNl/ZJ5hhYe+6K02xTWwTl XGxw== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=DGWzIg3FAbbxJ8HWvYsKKSKp5XnWYVcYbVNGhAhLXdd0xrHFjjgH9f6oOqWyMz/NTJ j2j43FbpTMEkzvnf5mQ4aeVZ7FZH2U+XzylrvuAAG79gbPYXOfMRIFFOZps81U2lpPE3 E+P3TwAtdCHY60iOMT3bZti2u8gif26h/kD3qnayQ1Oh38wxjfDS/m3rk0ZDg/OLHJPY t4EURV4ZsM+1K/2XeXljbeRSFti9F9S/WIjyRQC5D18OQTfbHM0wwbeMdYQK9M0GMh1B AyKjNpY+qxmIMMXrpMewlhlw3sbgvcWvmdi1yDhBsfMOS/nb9IFQ9qnQRo4dF/9Eiwi7 VADg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WY/7dFVf"; 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-3dc8ad89f6bsi13413055ab.163.2025.05.21.15.39.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39: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="WY/7dFVf"; 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 1uHs4d-0006Ct-PQ; Wed, 21 May 2025 18:38: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 1uHs4X-0006Ac-Ih for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:01 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4O-0005YU-F1 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:01 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-23274dbcbc2so24989425ad.1 for ; Wed, 21 May 2025 15:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867068; x=1748471868; 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=WY/7dFVfW0T63NYi+6cfblR2ZFWNqCd6rClqV5SC/ceBYAlJRE6P5/TuM6ao774S0L PVTE7HcaK6NqriGYMdAA4Tm96ISSI7w9I3xWiJ354OfZT6LbHqHv9kSRILkb5pu7anLn aLGBMew/BuuUM+HotH7ioBKgYnNhEWGUbXY0XkrdhLIG1jIa3bsabJHeHmFSkhIDi4L+ A9oKXv6hLcclt33LvgGFMA5riDX2d3yRGr9EmkxWNTa47kMmjgyLdN3wfVUieZFf49Qk /8rxpyfWt6pDapBN/7lm9VBAagJn4DfglLqiJ2LjyTXNcflez8t5NQXqozpRu/y4+SSC 8srw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867068; x=1748471868; 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=JPMVnNsWRI6nWFGevCTIwDpcO5cEPtfngY7fwmGrSxaw3Kaz/jTNuz5cgVPGK6juOQ cdXdcmqrDlaJHKBiLG63Kt/H1+mmQRO3QdwTCFUY2FBpihkIwFPYGLPz+7T4TYtwcNi4 gU8RFKdcceXpVZdKiUuwLqOn6W6xG7CYDDbEqZWGX3SGYAQuVX8E8e9JedFGMTfG1361 3YgYEeRquxaV88mh0V5P1M/EPqxS9Al/qT9XcACMNHel4Q5PrehsIQxY5kzChgq/VCy7 uwGG84Yuv0spUJLaUs2ZuBh8A1Fkc4MZe4WJIOA0lbn6MqnS/uR2Dw2IwxSYjpwkUew1 wyxQ== X-Gm-Message-State: AOJu0YyUP2E9wMasjaAC4SQRmLfrCSDUgAQQPiKJ7MpIASE3CKEOTXwx fKpdV5R6X/xBCFE7NufwEN3HPhBp+8C9iEe1riQT25f7/pIttzLKhQSukXkNXtkI8qHccjPWAZZ cv3RO X-Gm-Gg: ASbGncsqq4qmQ3L7n4q5u7hg4eKqg0yr77fEcTOWu0+aIHtBTw3bH2PqDkCIefwSqmq SsY+D1yB+wz6yrtdEWglOgfz/2SFGPMbLPg00deCdkTNi8BPY2FFnWxabXC7juJwkMPwvV6r9op UavcSMSYzT0bsxF91dQ4N5dV5xbsERorZq9aQVpHYLyU0UT9TwU7G08gGH6d+2gLA3JzkKYpy5C bHLP9MUjXLPxjEuZReHThGgckkjzK1WtFu1JIi4TGd4vFIh+b8cuhdBYIANa2ETVcE9UofqyDWk TRDXtAurTJ+mwzIt/kNnCz5CCSFDaS0Knmp6R0UcRXqXrvuC+X0= X-Received: by 2002:a17:902:fc46:b0:231:cb8e:472e with SMTP id d9443c01a7336-231de3b9eedmr323389595ad.46.1747867067789; Wed, 21 May 2025 15:37:47 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:47 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 03/14] qapi: make SEV commands unconditionally available Date: Wed, 21 May 2025 15:37:29 -0700 Message-ID: <20250521223740.249720-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62d.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 Wed May 21 22:37: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: 891569 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2356071wrm; Wed, 21 May 2025 15:40:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWj/NUX1fnvMcyAxGTqDkqT+GLVNIMgMhgo+a+p8Z+b+knGN8BtIT7BE82hxEeuHFY2hF8S3w==@linaro.org X-Google-Smtp-Source: AGHT+IGH7CdyxLc+K3pAvCDs0rSoTVGlF+fdp40jZqO36vx5imNt5ObsfClHoIrM00UXJfd/FwIM X-Received: by 2002:a05:620a:4508:b0:7c5:48af:7f99 with SMTP id af79cd13be357-7cd46779e37mr3291924485a.35.1747867215032; Wed, 21 May 2025 15:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867215; cv=none; d=google.com; s=arc-20240605; b=T5ADahqtWMLBfKDUf874hH2I/En2lORp0WsVVY7cZR6GOdWKy0N6rjFBJ6iW2X4THq AgELJfiWgmzlfIqIP3HbHGPFOXrThnILe4bVjvrSGofm5S1NHyE2uB1QY9c0DChlG0XM bVZacrso/Yr3nxQppIRamkFOJm/CzXy3VBQ2m12Xb4zH7lZfNxjfejknj8NxnC+hLu5n TzCyzshWcKEBIPMETz3+QqRB279f6f+LHumTF/tkhwBg/6fzb3T/DRXyC90vk2UdV8aL E5mVUKWwU4V5gprJY2JEmikLBXMPHaB5medgmMbYi20ditVQ9JxgbfURx2qM8SBk7Y3p lCJw== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=OHl+CP/bmpnW5q6RH+mWOyeSKLbleXzDS+th7Em9xRnFpNFDOH/xfmlzx2Hfx1Ld6M 2YyMi+pUrBzdeb+Sn9h535+zXRgAiknwABAnMSq19T9OnnP4jeEZqVQEAIWjeXrVfYhe Prg9GqgOdd9FJvlXVaqc9LeKu4qJaGpMDv3qL+ahJ3LJIX/T2o9cVkh6ryFCleZuwSHt dj/9Sx/ZmL6iY99LgHC5xDXCYUuvCCTUHAdLOTm2obVN92ysf4GmRiX78vxdwNkSx2jw PtAwS9h2DyygN4o7jT39UimJrAm54+2ezlwpJNPfWLM5BLYEoNyV7D3jADvNRgpDBox3 xbvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tlPKnQu+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cd4688c53esi1393283185a.258.2025.05.21.15.40.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:40:15 -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=tlPKnQu+; 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 1uHs4X-0006AO-By; Wed, 21 May 2025 18:38: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 1uHs4U-00068x-79 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:58 -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 1uHs4N-0005Yd-MX for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:57 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-739b3fe7ce8so6094809b3a.0 for ; Wed, 21 May 2025 15:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867069; x=1748471869; 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=tlPKnQu+Ou/gwTvW0G6YdW0A1aXIg0TIZle5VA67zGsFpUy9vpKTs45ruZBN0wt5c0 Zzi/QzJG1sX9vrCm6sw26JgKUHUUYKCBpyaePEgKq88KpK5LK1gBp3lqzD3toEWbJxRi FoPZg4ycPx+5s/O0lz5sjy28QReTFlWPYWYQo7+nlIO9s6F7wEhzqOoJMJxhHc40g9FC cfiVNsSei01As/nfCL4Ho6bQW1t3LvgzYAtSjt52rIVZDbOWh1KMc4yAMYceVwpNkF8m 0ifXpranKHKs+kwIFvsYsugbZBGzkdawW7ZQJ16R6ITYc9pDXCJrC5+5IWQiZ/4E4l7z ZLqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867069; x=1748471869; 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=Lnb10jpuU+Rb0KP1ZRWMhne/yErq1mqJ7n9wIUbfEEOztGyGcEWGTITSPJLCHnwZOu R53av10O8P5UI4Tab31RLzonnD38iGFPQ8IkxmSMxH7FcpO7B99l+BzDlg6vgoVop3ix A6RHSBNAYL3DuijQaUdCMiVhDojlMAREcXoINJkVay5GTTiouJsItN/uOYK18CzHgjXJ N6k8pGXWyVR0cf2WGoKxR8Ca2A7HBJcfO0H2z7yJGsoldGDEBnuKhrM1hRByZyB/kei1 85xFWDB1Fi5D82M4cO9G+AEk1RelJL1s9bK+ZUgvlVk4hHePvkuzyK/eekR9A522c5wQ aQIg== X-Gm-Message-State: AOJu0Ywt5F/pzZZRm6WfUWT+7bxQOBYrACeYmGr6CB98TAp+DzFcdk6v jQ+HbUtWZyNBqnfV+DfhZMrl6FQdu7iLnU7MQhdxRZqQzsoI9o/4l0A3L4G/o9/WsbumfSLu3eQ uTxTh X-Gm-Gg: ASbGncuv3G8cKpeSJjP7YAYzwFQB7TGSFDmKIiZuQSO6ZzcK6vL8O5RI+0XLlkpqnne LPqq2htQ32iaRkKVIWTagjw1s2gZ+jKvY1GTwgc46e8F3uXrjal2j/AMCnrvFGi+AuJMRuuKPnI t4sTlYls9nMFhZfxsInOqSg+zQ11z0VSe8+z/W51Mr1FZXwG6BHOWeAM6Wrzg+19Np91QrjK7JB qN3yzy2QulIUeeV8/keRXiC5+a+mkpAK+sMTuD3Eshdo/d09hzy+QffCEC7xxrJisbDyRB9Up4S lZQGqUXG/1qoOPHj8EHH60wpEx5dluG7n65JmzgByUJqG2+tpKs= X-Received: by 2002:a05:6a20:3d88:b0:1fd:e9c8:cf3b with SMTP id adf61e73a8af0-216219b24cdmr36276934637.30.1747867068699; Wed, 21 May 2025 15:37:48 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:48 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 04/14] qapi: expose query-gic-capability command unconditionally Date: Wed, 21 May 2025 15:37:30 -0700 Message-ID: <20250521223740.249720-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-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 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 Wed May 21 22:37: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: 891563 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355869wrm; Wed, 21 May 2025 15:39:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXX7uozWzHZXqjYoWaP8Z+7Q9B2YzgruDr4C47Smf2tMbzdwHxdDxwnodNizcUt4Nk56FXkfw==@linaro.org X-Google-Smtp-Source: AGHT+IHqO0jpKp2W3yfqtIIAt4EJ6ofmSVZYN6h5IpbTpsqDeucRSa7oPxYjTTJ1Xr8jq87CgW44 X-Received: by 2002:a05:622a:1e90:b0:476:add4:d2b7 with SMTP id d75a77b69052e-494ae4ca76fmr333809331cf.51.1747867174701; Wed, 21 May 2025 15:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867174; cv=none; d=google.com; s=arc-20240605; b=YvjCWjAdxOw19Dl9F2YqnKRiRMFBohh1sFKp0bEO7oa9OfJyHIiIwGd7DoZ4hGWneh hm+hj1lAoC1gIaaZr1SagtxfasqEXK7Sknwht6nJU/vUw2NKEwwSb1vXmri64O+GfYaU wu2QobQ+7P5jTXkUjESfLv4nHfmm8vVRwyzxZ5uhKOoVanwnLt821irg1OsozZDOY8jT dVu0vD7AFFuBTz/6D1hamvIHSUfDKINTEx6VNRW1a9vhZKyVxX8W+s7EFX0u9uRINF49 8YwmeOKM2E/yOx9Pw/Ato87bBtcL3uISNtV/8HLZEVyVxEDgnVaXVANnT9y6Io2Sm6nn kRUg== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=CO7NdQolZ8kTqm+DyremACEM8aE8wQvbii9b/65L1Uy1uhG0sKW/is2H/Cf+ey9yox jkM3bzFPN+G9Pg5vE8zLuGBsKGV7NfQOrvPqsbhL7NQC1A0J0JJx8IanRiZQGg8zjFRA RQojuUHVpFeEqJIT79edG60RoOb6L7OhYaSUEG7yRbiVMTaPzdSfQGXwG7nGEvbAmxbo v2bNXTppyvrBFo3lcQ6GdfkFG656UFgUwudTAUvel1pUA2IlNawgbizARIdoOk7rRe/8 Q5poYNgndq04/3luR6ToWPf7D6bP8mmDGWEJCckr1mC75e2gQ2CNhPxqC6zteEevMv8P d0/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P0SxX6z0; 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 d75a77b69052e-494ae40bcf6si138648671cf.122.2025.05.21.15.39.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39:34 -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=P0SxX6z0; 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 1uHs4b-0006C7-Aj; Wed, 21 May 2025 18:38: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 1uHs4W-00069l-EX for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:00 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4Q-0005Yu-4m for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:00 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-af51596da56so5561033a12.0 for ; Wed, 21 May 2025 15:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867070; x=1748471870; 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=P0SxX6z0VkwNGuG783h9C0UPpbXP3T5Wb7CSW7WQkoNb6tGlUULVYtTp4yDlBUsmjI 0ChN0+G0P7onKUhYxLwqRRO1ARUIob+NmGkkU5dRUFAgbIEETaTgCJnti1aDNH128s2g Nn1b1M9RTTfor+wzSZ6t0/oY/OwuGNJKxK11ce9nL6QEa6mLVhPTplGByEn7BqxbJ7/7 ikEJQ5/IJGOWJlosV8tm+WaVuJV+UM3bTGGkoVIrsr6bYa/O5l6XRiXDA81MzvsmSlZA OnOt9EN4ZDlgRrlFWoXd2sTYvk8v/zdT3ub0mEmFZwzY1wjBh25tlmopnxnVbfFAlM/Q ULcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867070; x=1748471870; 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=YXJC+I7/8zQfXWR1Ek7u++9cc/nrUQTw00iN7TkFvs4U9Qrc1Y099PNSPWNDeaubiL /xuu5fyAH+MLkzICHRlJSXuJWoP4FF2F3r17DKsohySCr1ClYRsSBt1OzgS6w8Ga3R2j JjulYeKnCj2wxV8Cvd+DHOgB9aj7tplUL9dXPsS/lbOABvOmjB6f391+QRXTMTmFKYwC LDOzlQxSrd9DGwXkkrqFiEg0JYzCeIRDhZxjAXZyzUW7WNlIO876IbAVqIna95LaLD9T /s2nxb+kmm/ySB3gtpF8U1FbGH9y2YTAsJTrr3s2DNXONVbp1o1glAgi8iRoe5y87WDv FNOQ== X-Gm-Message-State: AOJu0YyGMU+P5KehSM33OH5Uvxm551hoRRgWM+5zcrjSmqCIzpYwu0xl QO607gJLcdMCT0iHh/FdgrJ7j7DV99afKXEMmQmpWOPYh90lOWNymEp7+Um4TTZaprcuMboBixz y0wqN X-Gm-Gg: ASbGncuWNjbcWBZQnf/tll9YCy5S+0RSZVsZyPdJil9NKNEv9TEbk6pUiEQmRInknFZ r5J0EtrS40G6ss9sUWMvie6F32VFWsKf/zuFIzKbSaH5x+/MmdDNvvg+yYjMHgfBaJRIJAP4G5G xwMLP0w531CggE0DApBamh94rHKdHxk1HhFFL1MMOmKnLE/bdUv5zuJUHM5juIh6vEzk+sEqFmC M8832RyEJI4opSBIQuWylg2Grw1kZCmra6qrCys8bxGV2LqYZnwxP7b9cqkjY3dR8DBL5Zbe8mf Svenh85mT61RW7QKQ/Fgq73W1NfeRkz0vQEzEfIMf/FBuNvZ0Zj51/YSmlOsVw== X-Received: by 2002:a17:903:1a27:b0:21f:4649:fd49 with SMTP id d9443c01a7336-231d45acaa2mr314751775ad.49.1747867069580; Wed, 21 May 2025 15:37:49 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:49 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 05/14] qapi: make SGX commands unconditionally available Date: Wed, 21 May 2025 15:37:31 -0700 Message-ID: <20250521223740.249720-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x530.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 Wed May 21 22:37: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: 891562 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355850wrm; Wed, 21 May 2025 15:39:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWHVF/IqOU3nTSXxseYAWC2LY/osdXNQYaVXQAbre76jZTRNNeSfpvOucwL6rYKnz4OpyHTJA==@linaro.org X-Google-Smtp-Source: AGHT+IEper3ag5f5jV67nCqjFrnxhKzdMyEbDjobyDVvSWtkRiJQ3MGBr/9927KimmhPVpgRf7Fr X-Received: by 2002:a05:6214:406:b0:6ed:1da2:afac with SMTP id 6a1803df08f44-6f8b2d85f19mr385642316d6.32.1747867172346; Wed, 21 May 2025 15:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867172; cv=none; d=google.com; s=arc-20240605; b=AF7lrQNwYfiAuA7unC3qInOUMxI2Id0u0NnuxWY6bQmpkpA5Q+vl3r5qKo2TUCSBwz g+Ag9u0WVOBzBH71I4CLprBEAdtAwD8uDLYSY7pZpsuAOsSX4g1Vo9rwZaVWQ8G/R1zZ k3VdDllgQ7o3R/ZCePwAC5TKxHbyDhNNH/7tzYzJYCyBoAbeD8g/jELZKjDC6dPRYWLU ITNao8DL0YKt1dLb+jiA6AYSd9rntkHs5TrqHoaLdAPYdCzwBPWAnU3jI4DHXXWv8Jdz E66hJKcd1PilhSZhIA033XyocpODFzWr7Jik/70NXwiZdXcgrv6Z1wyf5bnWj3G1BUld i7+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=gMEOAZnlEJm4Cel43J2TXjtD8bt/qKeMwnzVffeoXSU=; fh=Edg7419XxkAjXFXvquM/bQZgzX6zrUunCjN3+I85QUg=; b=hFQkawNaauVlBx2Ywvcyjsvi+2zwEO7uN6P9MM4jCQrURHtqlRY/fI+bl88/7Eu/rJ IZA7Ml7UL1modo3aRR13HGKbUv+85pDRX0s8qpdjNiu/fygGQR8IBj9OcK31Ic2MyhJ4 dj0IvJofvIRGS+AWVKPtiCQ59XSnqHwaYARnvNopL2MWoJFop8PkpQwuhXM+N/5iGyUO tbswMwILQr220fuj1J80LuEu0pmk818+bpgGl6vfeatzhNslsdyu8k4cGrmBRPVCmSGL OFbnbHaBbUE5xW1CM0M3o9prSqKVUID+v1mZqE32xvCqIXhB15I9UHflrhZMhIUyRABC 5OFA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wZwqBU6a; 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 6a1803df08f44-6f8b09cefd2si134924346d6.458.2025.05.21.15.39.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39:32 -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=wZwqBU6a; 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 1uHs4Y-0006BB-Sv; Wed, 21 May 2025 18:38:02 -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 1uHs4W-0006AJ-UQ for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:01 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4R-0005Z1-3P for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:00 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-232059c0b50so43787035ad.2 for ; Wed, 21 May 2025 15:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867071; x=1748471871; 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=wZwqBU6aFTRcSrovoLdYrpt/35ECSRutK+1FT2w7UcgxeACb0cITeejY6wHwasXYsG OflPxRzwGIg+sgzZHch/rmWH3Elf0JSWUIfA3WFxms/vi5jttkqJTZdgOjQndB2eY+Pa Sxd2H9ui06nWULA2vqqAFGidlV4vE2didSO1zB7Lo1Lr7pECzdRqcp6zWyGG2y+4M5Ym a3sQDHO4lnxgaor/DhQw+N1fm9WIUlP0daD8CN8o4R7p0sMlR2GvLYsafuKxDRcuu56m czfMhQniqnkadKNkRTH5tD7AguEubSOF4PgNcj+g5BiznwS+h3oq6ZE62R8QOgZ1PqeL JVyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867071; x=1748471871; 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=mZgTlhbK52hnDkUXPEKhSpcMy9RAeHqR6S/3Us/+dvXNPjKjBgpejocTU7va0M6DPk n+j9BaxV/wv1YPlfbR+59uObPofLd0nOIdAy6I3ODRbjwda/qdgknKyVW7fSIrYT/gio 44t3XmbguMymA7MQbJckcj1U/XJcibGwFwhLh3vPPDgEvUEjR0j+FmJsgA6gCtSllg2g yrJO+v3QNQWWj9ekRtgtIpp5+lRdus6+rxVGAryaC7YIUJ20q+PbEt2iUdYXnviJ4stY 8aKu8/jEqZc4qtSkTEUSeLmZymR7Jk3IDaM78M6iL6KVzClMf7DSJUpbdrdN601RTaC/ OlOQ== X-Gm-Message-State: AOJu0YxTYRr6O69RQz0mAd8c4+Efgmy4z02MuvJcN1EQcTngQEkHhI76 IeM5cyIxDz0cdJLZLSp5BQnQlLrWf8SxBrVczNNDZkzS8DEXJkuk+laRIVaDeZ9BkwJyG+nEGHZ +Vt3C X-Gm-Gg: ASbGncsB/qu0j9Z7/HxQNjOzOYKpxTPBaX3k7mKwBR+TMRQkF2If1lJI7XaAb36m3rQ Hr7e/+HBAk4itsVwCiD2MRmBvjROoPh8DnLTy5kdpyUL7Zpu01SRgoMumu5Ni+5DBB4bhLhGliS M9qtcMo3j0xaoZYVwsXiot62W0KgvLeEBMNXG5vZB6IMLSKfGLp9ttoc6l11UcKA2IuUlZ/EEEz E4Nympqa4yOVJyAh1up/NZnXqa8LpamDhyJWJtg4tbkqv1RY6NbK563d9H1OfvjwNoUXinTtlBg lUxyEldga61gnBw9H7/y9lz3U9y4RLU6q8fccb2uVnjHc0lHBQA= X-Received: by 2002:a17:902:d4ce:b0:229:1619:ab58 with SMTP id d9443c01a7336-231de37e895mr305066835ad.43.1747867070892; Wed, 21 May 2025 15:37:50 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:50 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com, David Woodhouse Subject: [PATCH v3 06/14] qapi: make Xen event commands unconditionally available Date: Wed, 21 May 2025 15:37:32 -0700 Message-ID: <20250521223740.249720-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62e.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 Wed May 21 22:37: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: 891565 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355937wrm; Wed, 21 May 2025 15:39:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVFZHzRAytYPJsbIdcGR1lANev7niRHUY6UgprKSxnWbfL20FAiMlkc2IFWqWQ3XdyI3rXchA==@linaro.org X-Google-Smtp-Source: AGHT+IFZ2/i+GUtGR9cWlDLpPISgb8sgsoB5CBCUc1eEL4UPQCqpquYcL+pyY+E5TXuZ6qQboqex X-Received: by 2002:a05:622a:8c9:b0:494:f1e7:65ef with SMTP id d75a77b69052e-494f1e81bf0mr343785631cf.44.1747867189882; Wed, 21 May 2025 15:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867189; cv=none; d=google.com; s=arc-20240605; b=W+NChxJeBVNLUVI1sWuEYRUhUE4EHvlIjtVT1flUydZd+RXu5wBSEgzLlniHKQk+00 nh7OKQPcdk7keGaHP0N3X9Qf0uL9/QIoBxaXLOUIjVo7N1SeddvLBOeA2a2hc4O6wTQu gZgeU9wtrzDlunLKvu7GnEBa/fyeQsjxvRIbELqeDBSkaeUwH+wYCWyvK4mGKzyIYXOo QYEYZNu7YkD39GiKTL97vDegwTSvZar6wnTasUHzDsEs+JJpTrcKApVzg82PKyRkjI4b HwXdUhJXu1WfUhsIb+o22LMA0JuKkWx+voQZdF2jb/m3dePuAPgbz/VFVd92YlIsSq/Z ROrg== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=IsWylpI4CrljLOSp9965cq+AJwo4R9E6RDr75UfBs8HyJ5/Mq+J8pCLbAiHlfyec8l 9fb6+ath2FCCVrbyFmslxTRYW6XBDlbxWx6CDC6hYQpI6hMD6SPudtQDU0/Mfr/sUTij 8OJJn+jBfOFO3ztG5WtGB/8Ff4Ax7NPEptOCaWXi3BoxCn3gIqs5moU4HYlAIPy9H7Tx EeRwPzFXTZhg4qKvNRzx6BxQv8PQBW6Mtb1QBfeIe0nOMtXw9ZP60Eqiyc1ThdXo57tx MK9F33qgy92UY24cs1t1VmDQpi9hMFA4XKEDEbZgkg+Pw4Ztfe80IHfza5/UQ5o1PamC QFPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v7aNJh8q; 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 d75a77b69052e-494b5f190a3si123992231cf.655.2025.05.21.15.39.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39:49 -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=v7aNJh8q; 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 1uHs4V-00069N-68; Wed, 21 May 2025 18:37:59 -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 1uHs4T-00068X-PK for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:57 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4Q-0005ZF-SJ for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:57 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-231f325366eso54220415ad.1 for ; Wed, 21 May 2025 15:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867072; x=1748471872; 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=v7aNJh8qe/ADLuGHtUs+g1GUWtDz3OjlZb7te0zH43f6efcS6QVGyVMVvpvza0cMlH gcffvWOkV1VFth86BlXm/Iwmhf8pvIggCi6U73bJ0U34xGKjXPt0mUS9s7HO9QsfJGkC t6zWtdyXYovuoaYUI8EX1ZZLMiRtaW2CbuCjex4gokJpDxSSWdubimf/qEZ0YDZJ6zvN N6FU0/pn5nwcwjgmmXqAmiHJ5TVDEBFbunHqvdGwQe8SDCJOWl2scJGIxlKVJTckqq0x I7bEiHG3SP+NZ4himnRUUJqCQitX1/1a1kIFEErB1xdUMKRN9fdODVN8NzaZjLjgxTKR 14ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867072; x=1748471872; 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=adIWXmzReNFA2UJX0G5bZpDD4sdJKzE0XB6hWWDOkb0xphyzV8S8+7SWuV5dhjBwfO i0MQYREkJWSZNB/DQTz3WGfG9jTrawPBb/edW8W4riO2AtCOTzcrE8zh/dLd6lAQAPwm 1KVeL6qFh0Dvw4/orH0MgioXGKxT5OXiGzcpTDxWw2tu0BEc2fLsecE4f5K/j34c4DV+ HgnxfqMejJUYXjk3cyNUjtW8o3WlhWPUQeZxOqFWi+2e8dTK+Tt5W9RuHGGv2u/mbxFG W1yDl0AP3UtfZ/Ne02bFGS1+weoFc4GWBMhCUluQvGSui0opTjSCRaCtxwTkPNMPYD/a NDTg== X-Gm-Message-State: AOJu0YyEz4TQgpvSmCEeaMjvzRdRJxuEGq8wK++qZLIGoz/FeOCNSM+0 XiAO1I3KrBKUYdYkI31QKqj+8SnJRWpkf5Coo/l2/XDXMG0llabVgk5k/pmrkekQ9gKwa29XH2s Diy27 X-Gm-Gg: ASbGncvVea/Fmf5B0bwRKhfqOPboi+ESZOo9fky1nz72t1scDcEaO3df9SF/qDuiXwc YeNegPk88uoaXlNErIMlTapWlyBlKre7d1Zd+LCM/ImipawSHdR30EJIUDGH+oBMZidQoOqM/jO HcjL+6jyGsevSENd/cwI0W0N4Uv4lRdWLsoUGEIrglZhu6NF86JWPjuy4Wh3XJrRLmzW1ATfI+8 f7BemWLjVk15lWSZLJfOMHSXKVu5sMbO8Q9qswOgR+PzwOUyUMpxYUqZigRL77646zoThgQaSDS l7JbS92VuYkKIA4LuSMQhLok9cJRJCv6ahb3wpQFzDbuNv+LBu8= X-Received: by 2002:a17:903:174c:b0:232:2f8a:fbd7 with SMTP id d9443c01a7336-2322f8afee0mr211615985ad.11.1747867071748; Wed, 21 May 2025 15:37:51 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:51 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 07/14] qapi: remove the misc-target.json file Date: Wed, 21 May 2025 15:37:33 -0700 Message-ID: <20250521223740.249720-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62c.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 Wed May 21 22:37: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: 891571 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2356154wrm; Wed, 21 May 2025 15:40:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXuTU0JC5OyWa860EIlYC04j4IObTO9BwBAmoIB3AAGLvB2rMc7jR6Sd1J8qiNLEw5VRw5ncw==@linaro.org X-Google-Smtp-Source: AGHT+IE1JIK6ZDBD+9vSaqybu4kQesd77t1KtxWcJOsvsWfChrfe5nrAfl28sxlT5BQIDAKoiq9p X-Received: by 2002:a05:622a:1b26:b0:476:964a:e335 with SMTP id d75a77b69052e-494b07e5026mr277497661cf.24.1747867233511; Wed, 21 May 2025 15:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867233; cv=none; d=google.com; s=arc-20240605; b=HF7hmcFLhhoeen5QIKmJGKSCum/Xfg9DnVmUegpuNVuuxOzFIlxXwNx8XWlzO6YNry Ne0Xg4GoIZC/46M/sx/A3koqChhQZrLlGkACoTbaRAvoWXWsRtj+bEL62oChM2efXw3g Iffs5G107dLkLl85KJzUKwcNoeGcF27TR7eqLBOdSjzKKz9T7CK2M55g+URolU+38xJ1 33+13atEoEqKiOn6pE2xyrDLSKqe5uqdEfANAQPWGspLEcSkuJbi+/Jff7ncZtg4c7QU 3kbLNuPZ2nG/j8wWjzpzoSgNNUR/BMAVH4HWqaWMkn/s95Vbi5P4fJAMlaIfqx8QX+3V /jrA== 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=l5FVawulJkGhwmOnxZj6GXuiD8fQI4l3pN4ylJah/Gw=; fh=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=cWGssBMA3miyg/Adgv9DJ1xdaZ3/JVUtN2IVDLgEM82qqEzNVjkX6uhphLmdoUSzue IVCCTF02rr7kQ/0WRbqLOLfhgDeI35WSr6Xr/sIJqdbKiHnR2llXRz6ZT/qlsFF6bFa2 Sm+vVM/rmED3JrZ+IryIaWafUOmktLF7QHzScML8at7rbXs1j3VLbKHndMfne9ix+Hsu jI7p6XH7vaR5/UKddvpHGpOI7S8bQXQB5o84tDsA3EO6RdDI4Bu7bPwqWYYnpL+uDuxi RzXSFeDZL5xV4dT/5VrG6P1hsSpnKKqQbaZzP/H1g8mWYIychs7f25AEX41C9tjeBPpe l25g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TumvUy1y; 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 d75a77b69052e-494ba0990cesi121000211cf.133.2025.05.21.15.40.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:40:33 -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=TumvUy1y; 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 1uHs4g-0006Do-Na; Wed, 21 May 2025 18:38:10 -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 1uHs4c-0006CZ-Nx for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:06 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4S-0005Zc-IK for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:06 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-23274dbcbc2so24989845ad.1 for ; Wed, 21 May 2025 15:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867073; x=1748471873; 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=l5FVawulJkGhwmOnxZj6GXuiD8fQI4l3pN4ylJah/Gw=; b=TumvUy1y5zr8Jps0JqS6zuRv3RunFA+vlADFf0w8v7hWC2UOF+JseTCKwyWStYi6lc jZHcyvvRbOgL4NB04nFGUdHjrODuURAZqfsL29LqG3ii0+oT+lfLmBPBL537m9V8tg4W iQlTZVRtCd0/rQaEE7Ut3wmKYE6wSF7umNHqiWbRGBdxoeSoiGeO4WEq+eDmL287stuw ey6IqEm5IhZ0mpkPF7S2TyeUrdnjkYz2DhBs0MOy3OCXQCB6i2pjKYFKhZTOea8fAJTP d+TANzFbkqmu/c9MnUFaQx+yGWtWYzgzF5JeasZpsaE7isJBKMVey/XYgqUCumc2hdCK qQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867073; x=1748471873; 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=l5FVawulJkGhwmOnxZj6GXuiD8fQI4l3pN4ylJah/Gw=; b=qTn/g4aCZ5x2nn0z/GNFJOPk5XMHrq8BICdb5GF1o2b3hTlP4dRKWsiCwQ4ljDu87O GUcRcvszJZ6QIuKM8rtRVIiK0yZrXRuXetOknHFplql0LhNtzj3wmbbii94/iuDsBONS el9VCYnIcmo0RPGi+Pa+jKitKw+wknvcCvqAm3omT/yPaeJkdtmYbHabPjxEZD/8kmoR mev6MbYalHZ6L/3uynqrf+lqn8PWHVtDTQDJZWgCNV/r4cRKHdkZRw4CENrKLh/ARv4v gj2Pd0wHjZiR1fl1gVK8AZMYD/UzJH1L6v11SHFieOFhE5vLgsKSZ8Sc7yyaSUXUCeO8 xXNQ== X-Gm-Message-State: AOJu0YwEcZu1eWsn3SLLHu0E5P/WET4rAOrt36VidJhWsdMIv03FBAN2 Uug1GhZZJCn8mfdY59eyxeY0uIAGTk1hEQ222DO92oLlHGZ0ixGz24aiXUBXetSX+5R4wVRfckb awcUN X-Gm-Gg: ASbGnctUFtAdOND/T2lYZMOygqu8RENYicM3zkLEzuZUjjTaSOBBujyxtB49UUDXjcu KLAGTKy+HSzDXMBtRTtkh2aKBUlS8A2LQXutj+hXCZpoNAOdMs3pTaww0zbjatpsAESDhlvYCo1 r8+/9iXQa2ENOalgJ3oUKA9S3u7nAXvgKHiAcK78Gx/GUS5LyNkRTGT/mH5leF8tX4G5iMqjuDg CQUec/c7L9EB15ov6FKFAztbPjW3vHPFYxlvXR8TNuGi7Sf/BMuYXw1aSC3HmUCmPmSPaotq/zv lwj+Lurynp7bECHawAAHzcuI+jHAWoa02SKbwR1rGUDO0VFpdco= X-Received: by 2002:a17:903:32ce:b0:21f:6fb9:9299 with SMTP id d9443c01a7336-231de375e8cmr261178925ad.27.1747867072711; Wed, 21 May 2025 15:37:52 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:52 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 08/14] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Date: Wed, 21 May 2025 15:37:34 -0700 Message-ID: <20250521223740.249720-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62a.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 --- MAINTAINERS | 1 - qapi/machine-target.json | 398 -------------------------- 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(+), 407 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 426ce4ee82d..f19e34adaf9 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -6,404 +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: a 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). -# -# Since: 2.8 -## -{ 'struct': 'CpuModelExpansionInfo', - 'data': { 'model': 'CpuModelInfo', - 'deprecated-props' : { 'type': ['str'], - 'if': 'TARGET_S390X' } }, - '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 Wed May 21 22:37: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: 891564 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355912wrm; Wed, 21 May 2025 15:39:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWrVBbBv3jNk7GqBHB2d+BrSku2nVQ/859mjlaQI9z2xBn2xGANfxyw6GYQZ86bqnrhkjdLOQ==@linaro.org X-Google-Smtp-Source: AGHT+IGUXbTSrYgsrSk1/ZlQ3Ki6rRNx7uw73w54hPCTL5B7el00OL+Vg8Ghh8PTpfrTh8iKOosK X-Received: by 2002:a05:622a:5081:b0:494:a31b:c3ac with SMTP id d75a77b69052e-494ae33623bmr316351751cf.1.1747867182568; Wed, 21 May 2025 15:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867182; cv=none; d=google.com; s=arc-20240605; b=dWx9EkVCMoAfeZY4WWwRWIloYkMCo41GI5YEV6Hg+0n3RbG87mluO7b9HfybgqVUfz uP+H8bY/gY37qGfXMEHhVU7jqfsbNhK5qijVPHlFsz5Zj/IWFzbe0TG+dtxWYy6wT3J1 eFmSjqaeAKPO7n8/TsFhq0tJyD1oQ1OFMFJ8YUAzZoXLxAdCSTTBjmislr0eBzyUtaBd e0fAKPMnMXwj+GwYeZSsnac3nIqJnBC1fjZQKVYmVH9upHpkdSsHn72Q0yNZHZgDLwKZ /060HGvYc9orvi66YJUfzRJqbAOO8PrT3elPmIeRMOFn4DhqXhlqqdLNqJ9BwhLD63Za wEUA== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=eLxyyYydokSOS5iSIfG6T9mt/u+Kf/K3Z35qPLn1mG5hIZZjFEIrCC262jxpJoFGLW yQDIbQYK1a3j1UgZlnSwIENX462OBkB9MktYPPiVZtKEK7zTyvDu0k6sU/qwl3ZyFdus AtOYNuvJT18Rd7MIlCyk/NpObxrWXddiSQ49nSrKebrsptiQE6XbghxS0fwpcFU3G0BG LqeLED0V6NPdXecc1eVgGaFkQFQ5arXkuCxowyLyPzaAcnmrtEUjkgDWGYoM+DYoQhSn vSF6XdBSvEMDCqD9fQ/VP8ngGkVE/67irq6XnwJnYQd+QeofimhRthMnALJKoLBycGMm xhqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="c/TrN5HS"; 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 d75a77b69052e-494ae58fd9dsi141211291cf.502.2025.05.21.15.39.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39: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="c/TrN5HS"; 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 1uHs4Y-0006Am-FT; Wed, 21 May 2025 18:38:02 -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 1uHs4W-00069i-8h for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:00 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4R-0005aB-Ku for qemu-devel@nongnu.org; Wed, 21 May 2025 18:37:59 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2320e53167dso51045665ad.3 for ; Wed, 21 May 2025 15:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867073; x=1748471873; 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=c/TrN5HSVRdSUetqgljHJ6cJiy7gEyDEFMugUuk2q54j9yEwHIMrPi2UDv5ioMVadd K0+jLn0zQdQDrSzXxs0sw2UBRb0N3lg8383BWgdtZ/VJGCPzBVPbYY5Vm5Wej2VM8TqQ SzSy9Tqray0DOKQCq+lE3bPnrpX/U5naGm+v2HDB4qe/pJDySair8MYl32ZTmDN9kfb5 W0JDcllnLuljm8/mNC2bzqsNyDSaP+kqlcuro2bmoRTlCtiV0DJFyAnFS2GSN52awPCk 3MgtGOlFewOXKiFMxNNQLTsjSjF8cvfNDmfcQFLnpj96buuJcM0lU8fgEL9qQ+h+FL8d 9KAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867073; x=1748471873; 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=ois8u8le1tV9WZY1PrSzFGqcL8KeU+lUvG79QrKRHXgTEaY4LKUKlSHRSOhr048suz 3naDCGt+CRgT/9Vy1jEainam/87DLlURNoJdfJ4BS7Z7552hVuCl3pTje+Q9yLIU4Dlg O8gIH8IMQLbbOMsg4eobeAbGjNAfsMwsYR5OGhAFBdU5Q5UzFQi5LYCF1PqBzPmMFapk XYt0fGLPHNn+YO08rFquhE4NsLe4reloTCEj9ae/G27+m+9NATNCRiJ1oBplGKgBoBxB XhTAqBhKKp3VHWzJR0YVc0Loaxm2/WXjG+6Gf2WbHfH9WVMXNvLrZJ6fp8zUQXRFLhdm LlwQ== X-Gm-Message-State: AOJu0YzI54UI/9VfG8OapQXh/GfZ5v4iiF99o1xr6rOQwTaDgsClB685 3y1Zew4pudyFhJbTmldDYqr9GNQ9Nvn9uxzJ2SHNowyhP2OKsmmcTIGjxGUNyKXm8e1x/zimjQW A/xvg X-Gm-Gg: ASbGncsQHOBpa1wbsKCIiSwJ6dY4L7Qp1PTYQu9QkB3fXjOvn7GG2RXptmIPd1nByGv NRTiTEdmV+3bjcj9ha9dYCBCI+4+loGcndznrQfgQKU6OoIOOZARHBqF9hqwl2EV+PQm5yrrqGJ MS9hnaG0EEy1mkA6CE8DHXobBhuV4ZDtaPJVX0zvgSKpJBLc0veYhnm3SqMTZIALURPb7Hxx15S xcDfAvApXCbR1LSlhHzFImSCZmSuZyDZArQFwaO+ARzJxtBIwjSwfskzgWr5WFx+ivIrlPIjA+d Vc2J/g4cB/qFtE7SHVJR3ovhV7B0KR0Q7sQE0/tZB/P87ZXw3Ec= X-Received: by 2002:a17:903:1983:b0:22e:62c3:6990 with SMTP id d9443c01a7336-231d44e7182mr324414615ad.16.1747867073650; Wed, 21 May 2025 15:37:53 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:53 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 09/14] qapi: make s390x specific CPU commands unconditionally available Date: Wed, 21 May 2025 15:37:35 -0700 Message-ID: <20250521223740.249720-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x634.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 Wed May 21 22:37: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: 891559 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355727wrm; Wed, 21 May 2025 15:39:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhcEZNTcYIODwURruOriXGMtHzGgdXhgDx2rHzNtBKGAeTbcpVXwAjdUlvWysUVeTW+Jz2yA==@linaro.org X-Google-Smtp-Source: AGHT+IEPjolvE6K/7woReC9IV+1wztW5A6GmfIgT0qgSTtE45tS0vPXVWj922qbvu9MmyXz9W9nE X-Received: by 2002:a05:6214:d6f:b0:6e8:ff46:b33e with SMTP id 6a1803df08f44-6f8b094a1b0mr392039646d6.37.1747867146800; Wed, 21 May 2025 15:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867146; cv=none; d=google.com; s=arc-20240605; b=eQaW8uvG2fZmfE3M3JpMPbILReZ8FwxHD/EYe0iwbADiMrH8RK93x6yhKHDgMtEEB2 M/QJaaClqXv51TLOLd75Vip7zvDLSPaBQ1QVQIzp2pfcsaSMiU8T8CjaZ3BCwLD7U8mB WfRFSf6GJGsCqL3qFzO4x0pUbBfnt6YGR0KflhyixmIZF48Ir+7Bn9W/Z6890u5/BgXS lD+u2WdlsT54Dlq2yaNuTc19PeRepg3Xofvtx11sqlJYOuXp4Fw019dmYQuuacZFDAKN qbly5JvbICxY8hKil+sIyr3omUKDQE2+K3WfbpaW+xO25+Lqjlfwtlydsqrqcfpnudwy H0/w== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=C4ULVzftPQ3A1dSidgkn8euHXVDXHq/YxgMw3WlIPzE9TIFcqlKKdQe/rlAcPAFDnF 1V/whdtavJ1mr2rR9XLJNpfQFTVUSXqOrne6Cl/TPfAgG/5ooVT60m4rLoEB+xFPG6or CEYdsSKdTrBUsgtwqVjqPFvvDsw/SW3qPcLwlDw35EWFC89wqXmASIZAX9i/NEkCwfJE DCubiFB516qUk2Q+FZYGIkbm3rzqhKK+y2F0ENqgLEWeYy4nUZlibtiIh/T9furCGOix 2iBWMQVuh8kwvnB2e14kOm1SIyg9j5d39ctqW0ggWSfxcZ6pMqCr0rb7rBGjg2zSAbA2 o23Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CruQuO7V; 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 6a1803df08f44-6f8b099724csi139151266d6.210.2025.05.21.15.39.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39: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=CruQuO7V; 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 1uHs4k-0006Es-HC; Wed, 21 May 2025 18:38:14 -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 1uHs4h-0006EK-Vd for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:12 -0400 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4f-0005dZ-Sh for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:11 -0400 Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-3dc87649822so9568585ab.3 for ; Wed, 21 May 2025 15:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867084; x=1748471884; 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=CruQuO7VBDX7NXXccl1jKKHprt0KM9xBOOREl5MtCXsA46tfAYDQHVCz0W/nZvcL2j yC/6S75Id0CNEPUc2AQOYNxQPbBbP8EEzBsFjOxRO0rjFBwkG6ms2+CUPBVZhyTblDQd XKKaKAZGs3M2LvWlkjFbcc99b+2Qj/YolhrMDHXXvR1yY25bt1LqRSxtaLAVekLziOLv +0M0ESR9OchnIxRTHm4pWnD8t4audgYZ/OMZZ3hiP/bqb9OkazWQTnASNmnMrXz2SOGZ zIlHBZaFGk5MmvMC/CEy1JvcZiU6qWGgTWz2VYJmizVS2fvGKjVD5twmJEkI2DiH92Qq gPlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867084; x=1748471884; 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=sD9rL05H9YopW9KBCfdi68PtXbWrm/t5P/BXXpCipZbS2iA7TdvJPIx8CSQf7UiHOl eyXy2Eyco9o2iHoVxqBiyUMtQPpb8SziQmVIAj4SN7Nz7I74IiabVxTsJfvpYwmE1UuM Tc6vdy4Ka0NttVlXomJr4A+t6Iiqr1Qm7euXigZjDSlp8ggIPSs9tgUTenHWhAf7MCxA Ef6xA9k408CRV0Z2UkNiMPNJGnonnONh71eLpNYC+DNosUlz+1zFHVs4XQhYk6EKFt6y 01FXtbhJtwPnfaYmBrmmGPzU5UT7tT9a+gI4ajnHynaAAbOjGChjaqGtMXiQn+9fkbgb DYQw== X-Gm-Message-State: AOJu0Yyyoiyi4KFAxKA09+EgU/U+ZtCO/pPCbKxpXF8o+FGhpqOe5yH1 BdligdPbO8m3nw51+/4BvHH1yYo+gfyNLpPSogYxyOfbh+baYgtIrLAAWvVm/G07o5VMhgWtGHO oRRGe X-Gm-Gg: ASbGncuP5YBTR84j10MuB9zKV0rFCrZNTVh55fgAs+ItdfITPOheYSSXaUfunMEC+8/ IjNoMMQeSNpOAphaEjhmmwIyllNbwn8arBj/MM26XXO2n2drY7kyZ1cuJZFZvcroFkoXsrFA6hT 5lBfjOw/QS72rCNAKjHxYG4s1+X2RvsDLNIcZOjLZZdk0OTnhzDYLcntmmYrw6QQU+tnzQrI5p+ w1pAs8f7vkU4g9HI177pXehVDLpugtmLKH7xG+/2hYaSKYl4/7nbh5Vo6vDb9ctWm5W4AbnpbUP +tj96sZArwEoz2NFeUdDpufzKNzgzrVIpdSQTvpwIzyfzDSp890= X-Received: by 2002:a17:902:c951:b0:22e:421b:49ad with SMTP id d9443c01a7336-231d454e4bamr343299675ad.46.1747867074513; Wed, 21 May 2025 15:37:54 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:54 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 10/14] qapi: remove qapi_specific_outputs from meson.build Date: Wed, 21 May 2025 15:37:36 -0700 Message-ID: <20250521223740.249720-11-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::129; envelope-from=pierrick.bouvier@linaro.org; helo=mail-il1-x129.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 Wed May 21 22:37:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891570 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2356115wrm; Wed, 21 May 2025 15:40:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX+yf5pSYj5WI+lKKnianeluLeeDHP3MW869P/7qEd8AZGDNVawpCJyQXeK6hBlmifkmVmFjg==@linaro.org X-Google-Smtp-Source: AGHT+IHo6iKN0uKJRYZ6+WfnTjdaStYP3smN/q0M+/81NjC+KokWBcp9cQhmuQFWG84fyv+dMigU X-Received: by 2002:a05:6214:252c:b0:6f8:ae32:39a5 with SMTP id 6a1803df08f44-6f8b2c57bd1mr379442056d6.10.1747867224522; Wed, 21 May 2025 15:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867224; cv=none; d=google.com; s=arc-20240605; b=FTxpapcs7bX583EHAlG/Tvg7/Xt+ssrG60bmohyuAxLI2BXfXHX5Kn5RFxoHpO+Bjj sxqHqb3gBNT/6yGg+A+hZOsyRtZ0m2Q6URinm+npd2ushpLMeVuenrFJjahq0iRRUOQv eS6n9RvvhHhOBFl8slpv7ZEM33Siszvr9xYm8vj5wKSwfRh3zbgWzhMZhnvMECTWrV8O yGADeZj6lmAwSTpN0EwcpAa0hMv9UGbNG3WrGGaW/eZYpBfnR35gpqbGEPedrGk3MnnF mS6JNIk6bcq9ICJUw5Hi+EvpwlNzpccQAmNuBznOgmTLwAGUypfsFInMaGiPy+t9Yshu VvVA== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=c+u1YPZWiI06q5+zolyYe6bN+dpGq+yBhYxxu9qhLBpazMVwPsroGTdLLcB7udWZKq usDBwfR0SJhDLppAENcOiyz3Z0pcCMBEOVH84bihMsE6qSIdYt+MAz1O2cdoy62GABYL 9Ni236pv1XNpTI6NQNDCwRgeQs28Ykskbs71P4p5u60vTshkeKDWvTZ4ZZ8lfm36dODT 4fhbzZ5R9sgO55zP6CHKcPL0OKKB1QMZXkuN0cxbMm7qi2cSLbFsB8SpyeVgR9XObpQ1 Z0vF+MKF5uTGi8fx/HOTma76LH4Z/7n83FpI6Kq4SMZQswAemkoWDe2UsxyCwQVU1+f2 vNLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kIJ+bRDU; 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 6a1803df08f44-6f8b09d4227si142357526d6.488.2025.05.21.15.40.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:40:24 -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=kIJ+bRDU; 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 1uHs4f-0006De-Sv; Wed, 21 May 2025 18:38:09 -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 1uHs4b-0006C8-Ip for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:06 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4U-0005an-66 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:05 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-231fc83a33aso45174255ad.0 for ; Wed, 21 May 2025 15:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867075; x=1748471875; 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=kIJ+bRDU1R4UhJKjqPzMIUec98SalVSV/HVgN7JDubf68onnlSlSG4apxVotLq0uaF T49t6tx3kMZh+NCCHvcG5ysQbwwaUh1ID8bITfwqzbXbVosT9zL79u5kFfqlyFQNyU1f 1gIZL2gKHoPk9oeoM17ZWgXwbaIJGcNwsRPrS4uk1hBbFl1g/BJzvXlZ1gqoqH4egmMN grWnYgx3fX973+oNHwxNir3RsQmNjKXmkgYEIHs+PlSj+LG6xa/DJNuu6yA8gOSUOi1V LCuKrMmMX1G9KQDp2cxcDfaComJCqkLAFozfM5aU5RT+kFJ0+SzSTgD7RPSGLJ2R91oJ N8Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867075; x=1748471875; 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=B9mQAfG6M8IQDmVCoG0WcCtN9amNXp9lMQZG/Ja+YBxPVCrPnEA7uHQV1vXez20AfG ZznHiJR0aI7BlA+mM8VfPP+bm4Yx4IVwSD0WQf05Rwu0tpqN/VAxniv4MxSTNTeUFOJF 5omBn+/RB5Aigg4tGXky93vtNp2xrIcYYT28yt3FMFM2ONDEzF6Ah56eXIs5ZcfoYw46 Fg8Io0Xz5AFEb3d4DbJIwqDSueAuMIMOJW9J21DVVL65TMAwLlP9SecDnOUptHoyEv0E WZUf0wnSl+v2CeGArMbQQOseylm6C+zrxDv3Bta6b5KpxH7eI+LRrLedepX85s7R68zL 5vjQ== X-Gm-Message-State: AOJu0Yx1xawdeS/rLm4Am3GXyYztm0lc67GS1mnao1lO5DhnfnX6sIth Qmtbd+/4mKTiZ81UqZkXmrD5108BTZ2GrZHaMcW/EL8lULwGhYAXDguFpUyOLDbZ2F2hAAFG1Ln uYtbc X-Gm-Gg: ASbGncsl6TfBc/tEQy0KK73RbvAgbyBXKVJT1aGo5rfTp/afJOEy1WtWpkC0K1951UD VxGludLK3gw2MHIyqRcudEXNza+A9yctBYQw7g6DDzY5yMQTtBcgYj8GQfa1qS9mw39BBRi5v44 jW5RepK9kE/exD3QCdI7JTPRV41jAakeN4fNGIe8TR1ogBPaTr/vMSPMiEvWH8CTob2z4hnpGd3 DNOxCpRBCbiI3VDrGpxLaY8+vKGpwh5BRO44uTZbaS3Kz3IE3GLEfLfY6BwcknI0MhydVU90TCW sZcDHmC2Lu2cXmSLvlN8kYqcs1uPX2VkS4HvneVgrnFuQdIbPd8= X-Received: by 2002:a17:902:f54a:b0:231:b7a6:df1a with SMTP id d9443c01a7336-231de3ba25fmr271002475ad.50.1747867075331; Wed, 21 May 2025 15:37:55 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:54 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 11/14] qapi: make all generated files common Date: Wed, 21 May 2025 15:37:37 -0700 Message-ID: <20250521223740.249720-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x629.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, 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 Wed May 21 22:37:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891561 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355832wrm; Wed, 21 May 2025 15:39:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVUNRveTfxLbjXWw3j3GTwGvCgx6xKq7XdTtiehhDphV6IHuOiR66KBkrRt99WzBBQmTZKmTg==@linaro.org X-Google-Smtp-Source: AGHT+IFwo9Ub39FCYDi+EA5bPvDBWvRiTlNh7My6V6jjBY4negTIW5n2LE9kioA66ywefd1FEbqe X-Received: by 2002:a05:620a:1707:b0:7c7:af68:b6f3 with SMTP id af79cd13be357-7cd47f4efd2mr2777561985a.33.1747867168100; Wed, 21 May 2025 15:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867168; cv=none; d=google.com; s=arc-20240605; b=LUu/GcKPX4hq5kHvP3qJcfEJw47CycXQIYzjmDeAnfgjEzbVmOM+C9pGHwkAHNRmzE WM7c6gZ8tvvuovF3rZIgMLkITdUp0SSYCgZqFqH03hJ9enogsC5vKYaf85yZ5w1DOqym /DCvjw3L824ioN7vmKAC0/Soio6fjGu92TVYaXwgLkPS7ocyZBa8QqQVdCTirnvoXCMb BAesDkKKsSI1sWFeFCudygGg75dwTp61c+McF45hazG6IImX5SG4OYucdgCtmO6ItT63 UzYjX3d0q71feM1r4PNEGJmCpe6kPhzceR3UhFV+FZkKgSaBKl5xuGHctQpYbxcZutXI Oy8A== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=OxtAe6vrxnn+H7Rv0ird1vdK0HM6DbDjRKvz+NXuDVP3LP//0Hj4/wcE5LpYaZwqgp Yz5BBMM9z9UAqgIPwY9XmsAmR7JQGwhqcVv6PKqY3+GO6RPp54KRZd+SFGD3Pl0uqC2Q +Z+liaQxpiAcGtX817XHppO6XjwN8R1J4NmvgvnD3MgRLD/43wkiQckvknhbd284wTPb V5krSL87JYzNMvkcLTWJiUq3A7igAj9lFeNpe+K3w0wzPNcsjbFONwPvuyLrYGtMe37p fp7wl3iwCLlYeqvZUms2BLph/kTX4yQycAsi0oMlbrTngSMPrROyRp4AC3nFGllbK06J +F/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WizQGAlm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cd468881e0si1409854785a.279.2025.05.21.15.39.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39:28 -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=WizQGAlm; 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 1uHs4j-0006Ec-ND; Wed, 21 May 2025 18:38:13 -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 1uHs4f-0006DD-Rp for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:10 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4W-0005az-7u for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:08 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-b26ee6be1ecso4084306a12.0 for ; Wed, 21 May 2025 15:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867076; x=1748471876; 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=WizQGAlm872BRDcdElbnExnsWviWxghyZhyyLVI13n2qbu8zKKSbjuZm9AgMeVPNG4 4Gu6Vx12TOsJhRciqAd6yJUE/HY8inzSaFaJFxABQaeot1HMz9iOew0stUo2ovnrNQcZ IMx6oi+MJdkUIlhhJcol9JG/cXfKJ/H3CQOoOWsQbe2+ja0o3bajewB/6+0O3wY8eAlW HTJdOR82PWvNdwPbWmFaCxcUhFeFsVMH+WnSziTjxKgAKgurgp1/rshNTMah5u/fG3Z8 hNq6HFbVY5uKI3waRurIyqdfmRy2YkLGtDBSdbmKU2/BnZGYSvBVkErxFXc16oqVXU73 Eozg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867076; x=1748471876; 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=iZN/NGQ47lUUsaJJ0xGoquWMHQNVoxB3qgUY1dS5mxDGqWs9HFP+PbczM14A3rS54M i3yrhcSo/aHl4vy0+A/2XdZhFin857amMiYi84OY6D9FPlk7kAVz8rhTKznC4ENN/fQn AMC1yNjZ+MHQ0gZQokhztbS+SUVFNuY0tD/DeBPN1bKVzNisUqMeS+Vfo5ipO297P4Nw Reun2+bCJaYYFheRzEpgicvFV6L4ppw8PJwmz2XiA4LnBTUelbT3anQCU6w5AhLS6lJM yY9yVmkmWpUtYrWJ4TwWK7QCvou4QxuV76CBrwSVKOr3z+xdtRn09Z9mQ66wTLmmjk4k TTug== X-Gm-Message-State: AOJu0YwWWCyQBpuJ3aeSm9F/BFS/c4q0ZfGJHvd7jogSq7wrn9ssYSVC 4pMdZhtmhpNWZCen8w/28D1VgGVFevVjuqAAup1yha6qPip0T/bkxpVdF5rAd2HGWQxU3B35jSs tH+NI X-Gm-Gg: ASbGncvbX3qWy3gSa5bIvEbmlw4GoPliFxVvWt2D4RRkWA81nXW/a8pXvmgAt/paDow /IEAnL3I+cR6n3pViYFvQUga2j9HgLi6QcGWpatzFqI/S2V29Y/Sl/6mk+fvKl6VgXzG3hP+Et7 ldESX0ETkpxR664I5wVGTUpsDySr2Z4zLigJLwzFXWwigNDF5Dcd09SCYtP4W8uPe2wjyX8oY/D 8q3DmV6n7e1s7WCxEq99uRlguACYjPXEQYeIPe21z98fzJLUYmavVLjBcwW3UfFl/fJ00MpsOqA 4AunQ/4B1avNvJS5PICV4CxnwKlp1UbFkBRjoJm8xkS6zdGs7wU= X-Received: by 2002:a17:902:e786:b0:231:d143:746c with SMTP id d9443c01a7336-231de3ada00mr275968595ad.39.1747867076160; Wed, 21 May 2025 15:37:56 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:55 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 12/14] qapi: use imperative style in documentation Date: Wed, 21 May 2025 15:37:38 -0700 Message-ID: <20250521223740.249720-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x534.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 Wed May 21 22:37: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: 891558 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355631wrm; Wed, 21 May 2025 15:38:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU32W1lYJFKNFG64d9cn92Y+HECrQzFsKmsrPTdfxUXmf0et1ZhYInk4j2RuA1HU3MIuuBXeg==@linaro.org X-Google-Smtp-Source: AGHT+IEG9tuf6rAqsgZ8E6NY3h5wPxq5oj9Qq7B8ifxZFon1+q3qcXQTmLcrg9RU8jOY/ZSkPFI2 X-Received: by 2002:a05:6602:358b:b0:864:740a:e81f with SMTP id ca18e2360f4ac-86a24c8b69dmr2708711639f.11.1747867116162; Wed, 21 May 2025 15:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867116; cv=none; d=google.com; s=arc-20240605; b=KrzvFkv4SEBVUOKZKL/nX/L5QS4usGCwsXsXmwLuk/78OAI+j7TUnMPOjP4M1UZfAL 9w5gVlaDIghS4M1crB+qBBKu9iYZ9GLNT0nsiGiz0qOKy4VRiNHo7KS75W01cO6y3JxG QgIV8T8Wz0++CAUXGUMavgQXYCuwtHvC6lyPgKq7t7KR80VxUVojiZPoh6N8ZPr0jR2b VbAXJZ6ZrUX/nD3NFnOiD4t4P200ctGwbXH96o+ctW8qLDla7j6Guf1v6vgnrCYAEEZ5 c78hct5wLEhvgI3AHfTQkrvGMoxGGmm+dOdaTKQFIXy37aVgEO6lsRgT3PkJvVz3eYNi UKbw== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=jyF9vLH3U0s6k6odeb7CnulBnTjqYi/pWze1ZqzgssLNUnfyrqblSZc0bSEVrB5ehL CCdy8ormMa7ZEsmNsEX1VDzRMGxt415nOe5Xl24wbjVeoxELxpt1dHVUxKwunGDbkvCF eDrVXDy9tXBVfPU1+vu0/BPrWb+QuS8jX6SIOz2mqtVxXzuf2SGyUKt87/e+j6wmVG3h IiHvlCbAZ3CSNtzRK1MihHdZemO+kya0b4QV8m8u0m3FVgp6SmUL8BR1s0XptOwJVlHu tgnPtFnLPPle4C8ZA9gO9GmC0zkAt3znB57Nf3Y9eA6VKYPpvkkYPZtu4O0N2DEcfRkY 6Xsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oc34g3CF; 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-4fbd0c0c2d8si15380491173.149.2025.05.21.15.38.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:38:36 -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=Oc34g3CF; 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 1uHs4c-0006CV-C4; Wed, 21 May 2025 18:38: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 1uHs4a-0006BG-R6 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:04 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4V-0005bG-MQ for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:02 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2321c38a948so49245875ad.2 for ; Wed, 21 May 2025 15:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867077; x=1748471877; 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=Oc34g3CFDvCQelWrlYLP1eshp4wrnnKdatghqQCJgqPYEilQqEf8flT5R44ebHf6Vc MhZhijcNoDca0z3nvvr1wBDi3qbFA0gtzlAXB41gKQn+z9BZ+MQTHO2T9W5Z3fdjryA3 CVR7L6z7JTAefVisHT0QOfi+EwghvxhLf03j5863+xrbtnJ9Ui3lYOJTVu2puHUNy6wX P4zCfU+xidtDpjFJXIh3LypVKVX3NZqBtwLNdrpxVTiAcC450Vc6tFaA49+BQSbzoV9O X0+UE0rZFrmEajlKj1k5KFlbDH12bNgFxF41f8zaO3qda4Mb+d9gz8EtTFzmV5Bm5mOh POUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867077; x=1748471877; 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=ZTfG7kxVbC9WtjCmx8c9LQ91ivMu9vk2wYGpP7+ce2lMydKpLa1sOREb87QbhDGJ/W UaXtSdlAWW64wcFyCBaUdA0b4dzUm8iZ+ypMuZEbxmnxLv7HPRD1WM5ww6Q2yKVb3TVj shXIupCAyHIxpq5fAq9kBUA0b84n8leIVsDyu6LyKzrV9GipivSGhO0oJ0fuWDHFotbr J//C1wHPOC9wAvu+tL+rNnegzxH8TnSBc6zV+Bt3BrrdYNfDwHVai2HPjW5cko1fao7m L3jYsLpxx97MrsT0R05wXs/CcG2xxGpu87IDaj8CmBbmrcYSCy2HBvFxI9QuCYQQcv9U cAMQ== X-Gm-Message-State: AOJu0YzBm8ALV4KNHTyyewZA+3F4NAgYVYQuahD5y1MW7GXmSfnuraqt pF2yUmPQ1dNUNvenOckGFB0ypQ2rF/67jQb+HwTERhDve7NHXxjepk0xiTlTtEusA6d2tLzerdZ NTPTs X-Gm-Gg: ASbGncsvWlJWsphxxMd6k+8cuvujqBAPzo1b/0uO8+vWVSmW8YNJjWfZ4EpqNXJ1qCM JTLRAPVvAybXRQWXfQixgka89lbAoeXUBn5hhEaFlZTFgoWwOBiXkk4ofvkGgkvWr3Xm36xQU13 Ur/qem7paVEefGCCDlzLrQHsJFnHAEdhiY0HdtU8L8kZb2+cc7KmNC7SCFELgnrV2iPSOZuy/8K vp8/PpPb6Sk6wSkAK3JksTErX6fvYs8SWO/ZdAucVi08ib1xGDJmly3hAsUzlaoRtOW6zYkVpQ5 NmMZZsHmDBylqyLYaxuEBpdzOAk4PhhdBnw25MMl9sR1L3Hogwo= X-Received: by 2002:a17:902:ef4e:b0:231:cec7:465a with SMTP id d9443c01a7336-231de36b432mr264912415ad.20.1747867076989; Wed, 21 May 2025 15:37:56 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:56 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 13/14] qapi/misc-i386: s/field will be set/field is set/ Date: Wed, 21 May 2025 15:37:39 -0700 Message-ID: <20250521223740.249720-14-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x631.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 Wed May 21 22:37: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: 891566 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2355943wrm; Wed, 21 May 2025 15:39:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqwvSXWHrspbdihE8c1QnBYgSFzfEvxMASUK+jg47QSpDSKp1OJf9S1lNt+NQ++X69vcHA+w==@linaro.org X-Google-Smtp-Source: AGHT+IE5wuCV8tlxbQGfg6iXzjeN9ykY8WeQXe/6gp5z48MQKzKsM0Cy2JyLjsxFjC8tDHPI3V+X X-Received: by 2002:a05:620a:9520:b0:7ce:bda1:b7b1 with SMTP id af79cd13be357-7cebda1b7d0mr1746609685a.4.1747867190772; Wed, 21 May 2025 15:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747867190; cv=none; d=google.com; s=arc-20240605; b=kjzyordA3JLlTvr9fc7+lIP75Uyu2E1P3fvOLglpRwNPRaO+vqVOYymMrfPI58cMn7 MPHfZiqbVSWjxYkyHoUUOdHrbFgEpwWNYOKZDvruJA1M5yzblhv54nogmLrHCWdDJxL5 mnUBxV2JTDq5YN+qkNRTR2vYSfbDGf7KhzqA86aQV91w2U6FAyNdXM8sja4dKzqb2GAS 1wXwbqUatFCICpp7OmkhPJZ6u+m6tpbH4dLDzhmnl98MN0F+7BEkxK3pW35PZbbw2Zq8 CthCj8/ww/vvgRjS2vmTOhHfL8dKt3+idtdY3ayPmW45fXCjpou61FtfzhdWIm4NwnLX u3pA== 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=LhSqqQWZO3+G6N3MwmuBki2bwvRqsTDzvJqbgdDCcqY=; b=VXwkBleBjHv2jRE71J5DnqoSWA0UdktVUZeiWnD/eCgnnETJl0KSZWn3mckJnjhp4l hvcgKYY46x5zJKRqTfpJ24BehXhE4T7jUIN1Su259rZdgtOlc9VhyLHXEIbT5tz0TW26 9qsY8lHPBZ/MprwP9TEAmgqjZG/GwIyY3n+9bPkce6/kGBR1ZufKrXxqcKjGfW/IIBLE 2cLhnkWE39Ix9ZEAEmFf2xo/fArl6OhABDPbPZey+xB83KTXpnz+O2FG5epRymwUWIIU ADgUHg0CIIrquVDsfJBcGGj0kQN2a82kHHzETpstev0EPxwKDbO2OM1gU9fZArXvxBVV ThHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Okwq030Z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cd467cf6f0si1401560985a.25.2025.05.21.15.39.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 May 2025 15:39:50 -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=Okwq030Z; 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 1uHs4f-0006DG-0E; Wed, 21 May 2025 18:38:09 -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 1uHs4a-0006BM-12 for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:04 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHs4Y-0005bp-1t for qemu-devel@nongnu.org; Wed, 21 May 2025 18:38:03 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-231e98e46c0so46383575ad.3 for ; Wed, 21 May 2025 15:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747867078; x=1748471878; 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=Okwq030Z6AGdtvUPTkYwW9HB/jrhEheqT5jvqp+acl+PaqYCkhwwd2zjVNMeTvKkQl oeU8cjpQ5voUahFFCZCyt/ZrJ2Gn7ho1nK4Z0uk4xoqlXzTDZwJZXaIWHAsXXU2aYC8g QC7Z0YwPvKgLzjQ7xrQESH9A3FhHW4TsolRsTlw6FmhPDsQVZFgOH1biOCw8bKddGCdN ilUX1yB6mmBoSCSZCLFTSIvuu4EzDj2T6CePJdK9aXz/BfGUc996DhMgbkBog/AzDmMB xRX0qjeggaVd5q0NMV64j+3wzh2DnWSYbu9k2avp/Pu90f9sMxEk6OQHdPt1EGzoyfwU 3QMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747867078; x=1748471878; 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=ilIICcb/hJrsPX+nmY+XDiiWzJUmL3BNzDAhNEY3tgGR7lAesMxYnCbZapu47Q3xIN Fk6jLmCCLpi9Ruq/bMREmaVGxVUCsNQhbeXHAX9zdh4SJ2E0B2dXHT0iUlgj3os/LoTQ IP0ckK7qIiDIRNkLo+ecJIofF7KDRyjHxx6C9P4i5stqEHbUn4IPNxOWlxhuipD6eZLB mI0VAM8ICqHFJkHv9bplg3yJgXmS4Ap1MiyemcAVq4EFhQgcN5r67i4ddaFFLyJwdGQA dW/Cjl6gtVSbzANluhYDZtFinJqXyvnryEMTdffqlTe+uDIvox8Oec4oma0vZUuUY3gI SUeA== X-Gm-Message-State: AOJu0Yz+UqZg0t1ElBMLhPRaNQntdxLrBBgNupDcxLGiFO0gwVC8lS+F glySAUIc3GSoLdValYoyroK2dChc2TneAjYqPdygEpvV9KlDcG6NR1eD9AMudBqWjn0AVy0+dsP YokFH X-Gm-Gg: ASbGncudEaO+yb41iL3rs5RPkbxdoqUHcvln/ClFnLVQS3pcSsVKhK+zk58rhaU2EEo +stu8IZdWU4EERBVMqiTmRNKiOVZXeoFgm+8voPW8Da9Mpa0US7sRdp+5shEyfchoj4PZ1dm44P SlOrFvK6ADmIU3LMnVRzyi0Aghwcm+d3//tkaIlcbz/sS6+CCIRGjNVd+R5cYr1nWWkCmpABCms qp0Rnh711U18jYsovTI4GD1W50c/u2MpKbYAhUpEx56uTMU3V1Mji2weFKruVbkwidr8u00YKFd E8Ho3mDtogCh6QlqdVS0rrrV/BxPQ+XX/cMU+IMJo4Wll66Lyfk= X-Received: by 2002:a17:903:324c:b0:231:e331:b7c9 with SMTP id d9443c01a7336-231e331bc2emr275792475ad.10.1747867077894; Wed, 21 May 2025 15:37:57 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4e97dcesm97711105ad.121.2025.05.21.15.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 15:37:57 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, armbru@redhat.com, michael.roth@amd.com, philmd@linaro.org, richard.henderson@linaro.org, berrange@redhat.com, thuth@redhat.com Subject: [PATCH v3 14/14] qapi/misc-i386: move errors to their own documentation section Date: Wed, 21 May 2025 15:37:40 -0700 Message-ID: <20250521223740.249720-15-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250521223740.249720-1-pierrick.bouvier@linaro.org> References: <20250521223740.249720-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x635.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::