From patchwork Thu May 22 19:05:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 891717 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2806237wrm; Thu, 22 May 2025 12:08:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVo9CiPCOA/7CLW5V5A++l1mbmZNGVHWypgAK2+yc0LwSU4/AsTiLPPxzRE9bdwdCb7wKe7IQ==@linaro.org X-Google-Smtp-Source: AGHT+IHnLLhTs9InVw8Q4PaUdYTxtJ/7Nd4hb4fW2gpDQTPxHO3cir46DwZ6Wj9OiauqJRc3URsZ X-Received: by 2002:a05:6e02:198d:b0:3dc:90fc:2837 with SMTP id e9e14a558f8ab-3dc92bf67e5mr7035265ab.8.1747940896021; Thu, 22 May 2025 12:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747940896; cv=none; d=google.com; s=arc-20240605; b=kNK/psJg889WJhQo3CRdXO1R7dxhgGYXymY8OV8cTfgQXwm73z2D6RQSIrvTxhbkUQ SDmaLxrlPeLQSjJitV1H5ROHsKn7l97RawnSaNCyrujwSrRZ8X/rObxWRfxDayzkAZY4 uDKnW+rTFarfecokoCoINVPzs133jx5goXz6QR08s/5s6ISftZMChUI4fF++FACrVyOk Ssyc8jQAYPNz57y8dAV/nblcYxzMZIkzsS7LxRLng3CrXPwxrCHromEU2VrbbVSA9+Q/ GasFe6yc+Xn5KG84a2oQPPashbjjRkBITFWrLbD8MhdLbiW9e6LM1Dic4gZKlsDJCxFq ZtgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0N4C9DptqevA9wK4usU3+DxvuKBaI+3ZGbXSlc09sfk=; fh=KLm/AGbE26h6jaAcc1KwvWPtLJHi7FVLmArvpM27l0Q=; b=de2R9dXMHELN5Bp31RUAjQ0D6f6k5H9oCcxSVyUs3rwzSybf28+ApK4Z7ZzXweYq8N +omcHYazp9SodFaYMV4kkfjmBqm/a8BYkO4t5xoOLBBpFESFDC2g0laAV7bCKdnGI8pP SXk5DgEiDM0e+y1eHkCSUVQBmEWjd3H2v36cAFIp6sSr/TLAsAlemlj+4lTshjxP/9qV X8piiS3MN9qgXNtZfX058AFwh+C/hre+gLRc5EVBfzZw4NGicTyE7vlyZlOvVPsj/prD laKYi/VQeUWCKeemwM7tFvUXLOhj4zfYaKrXjRn+9FfC7EuZEgXJ6rLORXo26yfdNsPb jiXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvMtgx0r; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e9e14a558f8ab-3dc875f44c6si53449105ab.1.2025.05.22.12.08.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 May 2025 12:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvMtgx0r; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uIBEp-0000uy-NB; Thu, 22 May 2025 15:05:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIBEm-0000uF-W5 for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:53 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uIBEk-0006Rg-Nm for qemu-devel@nongnu.org; Thu, 22 May 2025 15:05:52 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7398d65476eso163539b3a.1 for ; Thu, 22 May 2025 12:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747940749; x=1748545549; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0N4C9DptqevA9wK4usU3+DxvuKBaI+3ZGbXSlc09sfk=; b=fvMtgx0rHhSJPe7Jicc2QMVNTB54yhnZj7Ncz3EZgTdP/IAXwNvS5b3HNALTkzv6vv Z5RAo1cBmWq+41y6ATIlV5CxKYEaq9oJH8s9ERcRJtds5JdkQyZ9PtEHaN6f6U55V2T4 4WE5R7KClIU5iIchgmt4nzv2au7P/9Ner41Al7IMPe83xyKr9xSmqoOLNU9JoOiAcmwm HcnTV+kZQ6Bklbz/UJX9OIkgasIa5cRNuZAT3tULMmte3ixzpWRV6i0MGOL1PCJbdLao v4kO/63gP2A+w9cLxKCbsZZuU2pcgcczp6E3pzTn1xN99h605TbslQEKATMT99macJKG mUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747940749; x=1748545549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0N4C9DptqevA9wK4usU3+DxvuKBaI+3ZGbXSlc09sfk=; b=UczxtQTXhUhCgmDtIqqgvKVSGVIo2sHZhcZoNgKI1g9wFlVj3obfI4dHYN7gtS6dM4 LZ3VQcxw7g94XslTAs2CmH4jXCQdddVvJyvZezjxhRDZSXsmZzTWdhWqG46ysgHkFUSJ ZR3PVOrDfx0BKaSYC83DPuQbL5CGNM4zqfHFbBP7B5yFa6dAuzcbyNRKkMVnYCKF6HAs oESgDLSZ58hj9Hb0T+WXZvFyO6pN35H4HF2xg/nJn9vk3pu5tAuE6FCuu2PmaLOW0RIm PNQtTb4oyCVexOVcyS6nbRIKS1JBDjKWeJBlMP+5t7g9N/6a1yyWcS3M+8AsAVyHbc1a p4yQ== X-Gm-Message-State: AOJu0YzyvDqpGWrIC+QrCwws2CPNweyHL3d7QNLKo981nO4ciWon5ieU EAPTUbLM4vaZnEm8O62T6+C9825YLwe6WCji53gIQuVcf1E9GRfisznUHi9we/atx8Gw3Kt0dU7 wEhmJ X-Gm-Gg: ASbGncvLnKucg1l8bQFX1MFXcUFFcv8KXm4IcMn95UK8GNk8QbUZA4eV7/QAU7cqwJD LmvRwvFrNUvvTNEyKFkCDLkKnVUOcdEnFaHBnt8vUexxa/8fmUpjmR/Svv8mGuIDDCUYk9I/1Ny CXS9KW6Z2KcvjE5ogTaerJrag6SyrPsSwBRmEs80gm8jFJosf9+aNZMSSgRlxNM8uvS7S/CWjgH xlkl8C/k/YVnQgElp0p0zi7zarx5EIdZ9oI/i19VARvKKBBXDOoTdWsY0syOEvF3rwu5LB1+tdP 7aYLJRZ8dpe5RPTgOmakYZr1MM+uXgrw3LCBkAAZnnhTHxroJfI= X-Received: by 2002:a05:6a00:e06:b0:742:b31e:e9c1 with SMTP id d2e1a72fcca58-745ece8e3c9mr778740b3a.11.1747940749349; Thu, 22 May 2025 12:05:49 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eb082c66sm11625565a12.60.2025.05.22.12.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:05:48 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, thuth@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, armbru@redhat.com, pierrick.bouvier@linaro.org, peter.maydell@linaro.org, berrange@redhat.com, philmd@linaro.org Subject: [PATCH v4 01/15] qapi: expose rtc-reset-reinjection command unconditionally Date: Thu, 22 May 2025 12:05:28 -0700 Message-ID: <20250522190542.588267-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250522190542.588267-1-pierrick.bouvier@linaro.org> References: <20250522190542.588267-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé This removes the TARGET_I386 condition from the rtc-reset-reinjection command. This requires providing a QMP command stub for non-i386 target. This in turn requires moving the command out of misc-target.json, since that will trigger symbol poisoning errors when built from target independent code. Rather than putting the command into misc.json, it is proposed to create misc-$TARGET.json files to hold commands whose impl is conceptually only applicable to a single target. This gives an obvious docs hint to consumers that the command is only useful in relation a specific target, while misc.json is for commands applicable to 2 or more targets. The current impl of qmp_rtc_reset_reinject() is a no-op if the i386 RTC is disabled in Kconfig, or if the running machine type lack any RTC device. The stub impl for non-i386 targets retains this no-op behaviour. However, it is now reporting an Error mentioning this command is not available for current target. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Signed-off-by: Pierrick Bouvier --- qapi/misc-i386.json | 24 ++++++++++++++++++++++++ qapi/misc-target.json | 17 ----------------- qapi/qapi-schema.json | 1 + hw/i386/monitor.c | 2 +- stubs/monitor-i386-rtc.c | 12 ++++++++++++ qapi/meson.build | 1 + stubs/meson.build | 1 + 7 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 qapi/misc-i386.json create mode 100644 stubs/monitor-i386-rtc.c diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json new file mode 100644 index 00000000000..d5bfd91405e --- /dev/null +++ b/qapi/misc-i386.json @@ -0,0 +1,24 @@ +# -*- Mode: Python -*- +# vim: filetype=python +# +# SPDX-License-Identifier: GPL-2.0-or-later + +## +# @rtc-reset-reinjection: +# +# This command will reset the RTC interrupt reinjection backlog. Can +# be used if another mechanism to synchronize guest time is in effect, +# for example QEMU guest agent's guest-set-time command. +# +# Use of this command is only applicable for x86 machines with an RTC, +# and on other machines will silently return without performing any +# action. +# +# Since: 2.1 +# +# .. qmp-example:: +# +# -> { "execute": "rtc-reset-reinjection" } +# <- { "return": {} } +## +{ 'command': 'rtc-reset-reinjection' } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index f7ec695caad..c5f9f6be7e1 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -2,23 +2,6 @@ # vim: filetype=python # -## -# @rtc-reset-reinjection: -# -# This command will reset the RTC interrupt reinjection backlog. Can -# be used if another mechanism to synchronize guest time is in effect, -# for example QEMU guest agent's guest-set-time command. -# -# Since: 2.1 -# -# .. qmp-example:: -# -# -> { "execute": "rtc-reset-reinjection" } -# <- { "return": {} } -## -{ 'command': 'rtc-reset-reinjection', - 'if': 'TARGET_I386' } - ## # @SevState: # diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 7bc600bb768..96f6aa44133 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -61,6 +61,7 @@ { 'include': 'replay.json' } { 'include': 'yank.json' } { 'include': 'misc.json' } +{ 'include': 'misc-i386.json' } { 'include': 'misc-target.json' } { 'include': 'audio.json' } { 'include': 'acpi.json' } diff --git a/hw/i386/monitor.c b/hw/i386/monitor.c index 1921e4d52e9..79df96562f6 100644 --- a/hw/i386/monitor.c +++ b/hw/i386/monitor.c @@ -26,7 +26,7 @@ #include "monitor/monitor.h" #include "qobject/qdict.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc-target.h" +#include "qapi/qapi-commands-misc-i386.h" #include "hw/i386/x86.h" #include "hw/rtc/mc146818rtc.h" diff --git a/stubs/monitor-i386-rtc.c b/stubs/monitor-i386-rtc.c new file mode 100644 index 00000000000..8420d7c93c2 --- /dev/null +++ b/stubs/monitor-i386-rtc.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-misc-i386.h" + +void qmp_rtc_reset_reinjection(Error **errp) +{ + error_setg(errp, + "RTC interrupt reinjection backlog reset is not available for" + "this machine"); +} diff --git a/qapi/meson.build b/qapi/meson.build index eadde4db307..3a9bd061047 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -64,6 +64,7 @@ if have_system 'qdev', 'pci', 'rocker', + 'misc-i386', 'tpm', 'uefi', ] diff --git a/stubs/meson.build b/stubs/meson.build index 63392f5e785..9907b54c1e6 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -77,6 +77,7 @@ if have_system stub_ss.add(files('target-monitor-defs.c')) stub_ss.add(files('win32-kbd-hook.c')) stub_ss.add(files('xen-hw-stub.c')) + stub_ss.add(files('monitor-i386-rtc.c')) endif if have_system or have_user