From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277334; cv=none; d=zohomail.com; s=zohoarc; b=ZRrC8AYfXk2GWggFxkjClI4cNBKzGzxQip/D5BxYM9ae2p2je0fcprtHKC3pcwi1EJCEQukoPYxMY/1Dm8dupl7qtoThpGkHugBF7k9UFl54Vch0+cv4zl7Li3kUCJWYOjhGYdYmIxAflSv5BwLIWE6TI8FtOZk+HRTW1g8UkaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277334; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=sWl7zs+vJ9KpTPK00MmmqNspBBmxXNXt2EwW/Xoq1YA=; b=UugTXuZ1oeLk6ed+FwC21HQs/kBnDf7fKpwsaty4ATYQ42iWjNpYrdOoeN8iI6dcKJdWJXBiGAAGXc52FhWr4cBwoqgil5lT86qkB+TWu4jLHAZJ7OhM5y/8l+dUBH6Q1ufRIelt4oUXjY7twQxhF147Lt3E1+7HK84e2qSmTnk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277334637321.99175956478746; Mon, 27 Apr 2026 01:08:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH0T-0000VO-Lp; Mon, 27 Apr 2026 04:07:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH0S-0000V0-94 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:07:52 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH0Q-00018w-MB for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:07:51 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4891c00e7aeso72855255e9.2 for ; Mon, 27 Apr 2026 01:07:50 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a575ad67asm391196425e9.2.2026.04.27.01.07.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277269; x=1777882069; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=sWl7zs+vJ9KpTPK00MmmqNspBBmxXNXt2EwW/Xoq1YA=; b=ihtqIyzX/zmP3zCYbDdD/mpwPienK56+V9On06wBVDw/0Y4/VfGKrqSB27kx9yegOM 1mU8K2aJvaLolek6pTeV+FlMGQuk/LtzxkN0ftsonF96e81jFSggDSZ9hGuYofJO3QJv qV7pYt/L5Wf61jj2zH/aqF428T2JHs+0ffKhcYkdCo1RDPsZ2WIpToUN+SwZJORqKTmr 20Wce5NwoxNGHmDner7xzyvL4ROZOkk8uiczav1LcgFAjyW6yUkKKPHMmvli/uJS7UBr +OeNaTHubAGIxhh+ZfUAUoFdV8P/Jv2jlP6cw81d5eeWbNgdyDl6drDZ5lmeeDhUn8hx Fygw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277269; x=1777882069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=sWl7zs+vJ9KpTPK00MmmqNspBBmxXNXt2EwW/Xoq1YA=; b=SnNtZPXOIL42RDppzTuJ/WJjnR52m8Qot7GJeJaSla13NPvUyW9hRIzjh9eKE/xDYy 3utOf+o5CSu5ORjKKKHhNsheajsqYBiL/B02ibZCJOpve6e9ei0vbJpXEDG/m5SCLvvf /rOkuKF65x8uxQfPEGXRBMzFeAlT0Hz5okGhX3OC0aPdOlwqEZDIhOYGsGWfE6FF/RFC +jXEktMj6+sORUO/A+bdeiyNUnNLS24/BD715oNZJ4p/rCPlH2EmCr4m4YT/gePoT/Qz JneMR/tDXKvm/ivhQ03NdFrTeRCIT2D8OIXXHit8nqTEclQkH8i9kSFHQzMyFy1Us+P1 UGRQ== X-Forwarded-Encrypted: i=1; AFNElJ9bFjygr4wwsFsaMAfYXQKywABgZ7gAx2i0VeABFfZwVVxyAIF2qfyCIfnsoGMKxOusELVCUzhjiVse@nongnu.org X-Gm-Message-State: AOJu0YzkBlTPnJTSIo2qMlvF0Hb7TIshyhPPpSr2vBCKxpC6cLNAa6Ej 5LSe4Zl4jfMFI+uAm+thoCIjYniqV1zb0CT/xZqlY6x9JngjW/4YhxhnErGxwlz46Is= X-Gm-Gg: AeBDietwv89tqn7+Rn/1EYS9VRWaHwuQZ0sHEDvF52xjsjf1l3jlVciar3cs2z0RdZ4 dgUGsYQLsCJR6VWikmmAKmg1xtChf1Yicqw+9NAaU8jNOt4wLN/MkY/CKyou9aw47hzOE2AVJvF 4gsuwqRQxf5ZZCG2lDpR+lZqtCRQPLDuTEX3hbSoYY+vQVUMYWIa9vtJbR0Z9A3i8phTRWj8fNu q9uf98kLhrHWyPbi0YLbWDA8I46p6QfsMHwqKg7jnDQ1dxGsVB9bxG2uDix2Aqb2wivBzrZLC7L 7ZfG/LNdr4PB7DsXS8nHNDf3mOcugMuibLhcsl+98kFXQQvJt7cDJOkc9ZpIEpWSsgDRYC2Kcsr UXvieyWXJ69jEy/UaPVDrKSw3oIDKsKqpjDvRVoskJZ+fdvA9E1Bl6VEiY1Y7AnnbCK5xg1SFEP 9lg/AptlbgseJwCwtHFsOviHIbjkiSaO0CkGkxsOCXF/V2ubKf29tf6awr/bnpKU+TLpwgXQ+lO 6JpozxgoMo= X-Received: by 2002:a05:600c:890c:b0:485:3ff1:d5ed with SMTP id 5b1f17b1804b1-488fb739cd9mr492990015e9.1.1777277268956; Mon, 27 Apr 2026 01:07:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 01/32] monitor/hmp: : Include missing 'exec/target_long.h' header Date: Mon, 27 Apr 2026 10:07:07 +0200 Message-ID: <20260427080738.77138-2-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277335799158500 The "exec/target_long.h" header is indirectly included, pulled via "cpu.h" -> "exec/cpu-defs.h". Include it explicitly otherwise we'd get when removing the latter: monitor/hmp-target.h:35:5: error: type name requires a specifier or quali= fier 35 | target_long (*get_value)(Monitor *mon, const struct MonitorDe= f *md, | ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Pierrick Bouvier --- include/monitor/hmp-target.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 5167d17d41d..898473b3ed0 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -28,7 +28,7 @@ typedef struct MonitorDef MonitorDef; =20 #ifdef COMPILING_PER_TARGET -#include "cpu.h" +#include "exec/target_long.h" struct MonitorDef { const char *name; int offset; --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277305; cv=none; d=zohomail.com; s=zohoarc; b=Dp5ZYvwLigiHwNIjQhTvXviqBkNJTeeCr2b4P4ER6uRz62kcIOWfvy17PkZ7A/H3NjqlhO5PkLcvgqxrXmPyOgJVLob+eDukz6JW9b+5QCZLhaNCBfQjXvamhRWSJgdLihadyWB/Zih6VbPA18wSQ8N0fg5OzTuIFrpKCqxikdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277305; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=CUaWTZovjDgyCAn2d0HALI7PgHwWvhiaIIr4lldEoLI=; b=ZsXIjG0x9HF0XXspbo+vlYgAMKqw05dq0iK3GDFINJHuA3s3o4pWkqnUqHaPh//HxBFB1re2RJbO2KJOE71zt5LQqYjhrCkdfnbD6MGOWnUvpsiZg/afDDcc+bzvhLoQmt9kNZAlYC+oHul9o9M6j/uZrrYEdFxjKUjEbjT6z2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277304998900.0506653080979; Mon, 27 Apr 2026 01:08:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH0a-0000ZD-Fv; Mon, 27 Apr 2026 04:08:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH0Z-0000Y6-1h for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:07:59 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH0X-0001FW-Ez for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:07:58 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-483487335c2so96617065e9.2 for ; Mon, 27 Apr 2026 01:07:57 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a52583fe7sm448330885e9.13.2026.04.27.01.07.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277276; x=1777882076; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CUaWTZovjDgyCAn2d0HALI7PgHwWvhiaIIr4lldEoLI=; b=OlmxYBXKMNX/s24tGU0hfp1ldWYvmQZ8ErQzKn7N9IqelE/JxqwxBDYAw006l/e0iU WFA76SgaJ5TBDFgJRHw/HSHKKJXUSn2dHSX32oXmoKjXQGVnN3/TvI+dx1C4R49AWmM/ pD9bZoUMFh1I0eh723KMDcNcIWZInc6USW7UCnTclCr67MVHcSFfqlO0SY4ntfq5B4DN hsy6kr/apD3mxrudeggEpedn8TR0dtd3WdVrWlbrpRQBQrUOAF2orgOPkXsDSyIgxvvZ 6qtza+A5za7GVpChnM7ScmxAsnAPWcvW5OIM95X6hoXZ1sVEbh/1LrdXOVQ3A+P2KQO5 ttMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277276; x=1777882076; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=CUaWTZovjDgyCAn2d0HALI7PgHwWvhiaIIr4lldEoLI=; b=UTPIdgI9X0v3C/QZqaC3epdvu3f+oqyL8z+zXlcA/BxVcAnK6iP9DpUxlHLPN83kcS G+4mifoVjsK5scejmyjsUL/MDRj3RgGhsbILxmmYD95Odyf/JYYtHy8kzs1/7MqZijWn 5MfC2jFpS/XnlWenIOF4MCe52NAF1bO+3C0atw4IFWz6Mby2t8+ln/sDPA1Whh0OHI14 9KJAF1V0aJeihLhQCu3Ovdc64h2b518kyyjqadHR2058MiK5TFf9K+P8oGsJzYNGkpFS fBb5CiI/GCttMwSoN1eT1ewGHeMxrDFwX9hdDqcM4/pOIIolry6irk5LLzbYjsPTwX7Q szmg== X-Forwarded-Encrypted: i=1; AFNElJ9ioAHKdaT4VEEKAWgl94ecsdy2Fkv/Jhsvtch2+VKXmEMYM8ZEZJSlJwzwqBgiQSNhpWx75EIHLl2X@nongnu.org X-Gm-Message-State: AOJu0YzRSyp2uawI+RHrKSFIsXK2PJAcIXzaYmE5aD/Yia4SVsiGsXqJ pBtcXbd45fnFbbsv+hwTkfEwl0VC1tWJ9/mCb/jtV9wOFVpY7zpDk7CnjRKPdyA+ngQVyhc3ZTQ SG6HQg80= X-Gm-Gg: AeBDievyAALxtTIOhTmlfeQHmMzk6rMdKpmll5gL5XwAjVg2LdXyFGn/8nQpeNmcsdJ W+Xsk1oTUIVS4GGjUazWXb9p2nYwAyl4ZQVz+LCntbE84enQbzEJBK6Zkp7KacEGUhZULxjRbZp dvsIywPrq/vGgiI4CTZW5AACyT+5uhDdNCPMPOWzolAGm+R4R1xt9IXr+ImTfKqdUh9k1n5aUAi 52SkBQFecqh6qmdK2EQrRxM+VV82lxhUnxYTmXRu3A2aS3AH/HKWkFPcFbT2hVfM4GJ5i1XvEjQ gsOCb2REg7nTcPrnYk+NsuGHdiyHDEQczBHB80XRXEFp4MkfHCq9bTqyYmJPQ/wTlV1hXAM8u2f JMAac3snac4DUBSHzDgBsMD/xaw1zwLcQ3Mbl+uyMsCyUBVmRC2wEo7ElWpJPDlLj2IOt3YwE7+ PlUyCFPO0ISWWJcUVLNC86j4Mt+tDe3fvz0weiz6WrFTQTs3xhzQx85yrfcjeASCKkfWtklWe1J G3QJMQD65E= X-Received: by 2002:a05:600c:3150:b0:480:3ad0:93bf with SMTP id 5b1f17b1804b1-488fb7930famr600071025e9.24.1777277275775; Mon, 27 Apr 2026 01:07:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 02/32] target/sparc/monitor: Dump all registers as 32-bit Date: Mon, 27 Apr 2026 10:07:08 +0200 Message-ID: <20260427080738.77138-3-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277306991154100 All these SPARC64 registers are 32-bit since their introduction in commit 3475187dd81 ("sparc64 merge"), see target/sparc/cpu.h: 511 #if defined(TARGET_SPARC64) ... 515 uint32_t asi; 516 uint32_t pstate; ... 519 uint32_t cansave, canrestore, otherwin, wstate, cleanwin; Set MonitorDef::type to MD_I32 to dump them as 32-bit. This removes a pointless unsigned sign-extension on 64-bit binary. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- target/sparc/monitor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index a60671a60a4..e9300ded4ad 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) =20 const MonitorDef monitor_defs[] =3D { #ifdef TARGET_SPARC64 - { "asi", offsetof(CPUSPARCState, asi) }, - { "pstate", offsetof(CPUSPARCState, pstate) }, - { "cansave", offsetof(CPUSPARCState, cansave) }, - { "canrestore", offsetof(CPUSPARCState, canrestore) }, - { "otherwin", offsetof(CPUSPARCState, otherwin) }, - { "wstate", offsetof(CPUSPARCState, wstate) }, - { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, + { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 }, + { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 }, + { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 }, + { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 }, + { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 }, + { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 }, + { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 }, #endif { NULL }, }; --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277310; cv=none; d=zohomail.com; s=zohoarc; b=GU6gXxRxXGka3GJw3E5X3pdw7tsoZEdE8LKfnrA0y5H8wyJjr6IjPyuqrtJiUu4/QvvqA+AwgXvfRxCN01nW7rVJj0ETGXO4LnEgbAuhO4PW/RmSJ0lmcssT7UDMjepq/VsxqhvoxVfDJrU1mSH5IYnPNP+G32+bDTBOqxogxc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277310; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=cBuj8J+8c77rLL4d5hAULRShpRlZCQscvo/9rmO1W0M=; b=gDf8xgFGjpwwE9TfK2U/G1AiyXsWpixklSbdji7+i6HhYS4JqokoO6cWDaT6qlFR9SBg0dO25oKhL8aTQkGnclmJ098MFEuthx9qyMy6hq2+NIHxi5ylXytyVKpeOOiTn2rRiAZy4CKAgke/HZigwFKZ1M6DI04EMrFb0Dtpphs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277310884705.0533658710438; Mon, 27 Apr 2026 01:08:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH0h-0000az-Ac; Mon, 27 Apr 2026 04:08:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH0f-0000an-PD for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:05 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH0e-0001LH-69 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:05 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4890d945eb4so49147635e9.0 for ; Mon, 27 Apr 2026 01:08:03 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a575ad67asm391204825e9.2.2026.04.27.01.08.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277283; x=1777882083; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=cBuj8J+8c77rLL4d5hAULRShpRlZCQscvo/9rmO1W0M=; b=rWALb7mwTDx4gEQzdA0NarRnVNW/sXb4kqjQwgrb01BKZTs6NTpIMhJvWOKAdoiydz 8LL7vhaWJi9F/p9ALYzvQghEKQVbpPIp2j/YK1zNWygrBXv57iau5Ugp0yAyaWTuJojT 12hKageMklIjod+8SQBqCLFLyCjXXUFKMzwjt7DeKd/WRMnescnMpHNb+xrQYWDdirDo PYx6AGVChrscOf/2K4hEHAKmZbeCsJr6ExXV13/q95CgYVG0OhDsq9VVdkz/MgfO7/AI 7iVr3awyH5we87Vt6TF3DGXvXEiIYCo6VKETS+99OUhTUGQpYsgQh5v7+2WSrFq2KKXr jPDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277283; x=1777882083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cBuj8J+8c77rLL4d5hAULRShpRlZCQscvo/9rmO1W0M=; b=hGt9esblfi8i5jIcEiph72dZpzY1WuBmq7/WGyCMrO9/l2WiE46dwZtn1wi6xpWn2y nJOoA53gCtpkZnbqK9OScm+zvzdDcovY3xE9U+ij4DiAjcgkfYtvfpOAZN/6PggTnmTd C59mFTECsk6h3mfw9IS/qPTFqPq9o1Y4qPhNxZAPyU+yQuFVqc0HMfn4jKwsbApL9t4D 7xLjxd3CWrAuHeTmnI1nDjH8LMmBPreQOL53Jag/tVCkrZ1T5NoAQfzKl9ixj847kyuJ if6+uWWbtmirAIb85dol2m1+W5sGiqroYwFdTeS8jBW8nEdNllJf3tbb6ii2UnRwtET7 EWmg== X-Forwarded-Encrypted: i=1; AFNElJ/gaoL/Y9zOW6BcRB3I8kcldonPuYH713TC6yrFu/+1mTs3midhW3IlZPz4RV4D4LN1HhIiwTkV3nRK@nongnu.org X-Gm-Message-State: AOJu0Yzv2a4EhIPKrvML8IaI23yIl+s6+xz2LHw1nLTl/tWGgswOGBaN +vQjvu2BYfmJUTAzkAswKSqN/JRDt4xegbbNSvd6aQdO6X35vkcm0e7rZtIVha9vk2XtJv9I2li L16PSsv0= X-Gm-Gg: AeBDietKlWedA4eHKnLO+jrIcnim3ACgi5k/zjXJc1fHbv2dAxq4XisGL4qTPKSwSdb KW0BeeL6QXPA11Yo2E0ziEMTsvCEIhB/BNhmjyHnlwvDyJAZF2N5YSeCrpdT3VHQtyV0txaxJ4J DCit2vEnGRQE+nSBnLcIcMp0BXfbvO5WH7xQH4A1VMlqHq5w1Mv90DNyzdP804oRPVKMgJyVj1g 9qoGep6YsJ+v77voeY2jofzKx4I8lXXQ/upABCGJbrwgTcRQYckZCs8JQd2omLOT8FZvvKvkOH/ erL8h+hKNyAaybFomdKzqOOwv3eeuwkHhi+pf0tLxJ7VZjc1Pr6Y4jp+9j2XFEhF35MkJ5/ePYd hye12VU5xKdZqFTAeMfkB2ZAN6uXujCSxdJjKbMSNvRhL+A2vXm/ZzQ4j2x121bdw16xe/9ZPWO H6Jrhik7rQrW9bkXnoKUeQLeP1bvY6wwqTrnvyi0aObpONKuMu3x4G01dpNV3KOrJxXV/JfiVwR /oV9MBnnUY= X-Received: by 2002:a05:600c:33a4:b0:489:1abb:5559 with SMTP id 5b1f17b1804b1-4891abb574amr245058715e9.5.1777277282572; Mon, 27 Apr 2026 01:08:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 03/32] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32 Date: Mon, 27 Apr 2026 10:07:09 +0200 Message-ID: <20260427080738.77138-4-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277311930158500 None of the few targets still using MonitorDef use MD_TLONG, they either use MD_I32 or the %get_value handler. Remove the MonitorDef::type and its definitions altogether: simply check for the %get_value handler, if NULL then consider 32-bit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/monitor/hmp-target.h | 4 ---- monitor/hmp-target.c | 12 +----------- target/i386/monitor.c | 2 +- target/m68k/monitor.c | 24 ++++++++++++------------ target/sparc/monitor.c | 14 +++++++------- 5 files changed, 21 insertions(+), 35 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 898473b3ed0..ce0bb1983cc 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -34,13 +34,9 @@ struct MonitorDef { int offset; target_long (*get_value)(Monitor *mon, const struct MonitorDef *md, int val); - int type; }; #endif =20 -#define MD_TLONG 0 -#define MD_I32 1 - const MonitorDef *target_monitor_defs(void); int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); =20 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 420969bd6eb..3f019ae2a28 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -82,17 +82,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const c= har *name) } else { CPUArchState *env =3D mon_get_cpu_env(mon); ptr =3D (uint8_t *)env + md->offset; - switch(md->type) { - case MD_I32: - *pval =3D *(int32_t *)ptr; - break; - case MD_TLONG: - *pval =3D *(target_long *)ptr; - break; - default: - *pval =3D 0; - break; - } + *pval =3D *(int32_t *)ptr; } return 0; } diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 446428602ef..977f65fe16c 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -602,7 +602,7 @@ static target_long monitor_get_pc(Monitor *mon, const s= truct MonitorDef *md, =20 const MonitorDef monitor_defs[] =3D { #define SEG(name, seg) \ - { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 = }, + { name ".limit", offsetof(CPUX86State, segs[seg].limit) }, SEG("cs", R_CS) SEG("ds", R_DS) SEG("es", R_ES) diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index 08ced037b47..94bb12833af 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -24,18 +24,18 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) } =20 static const MonitorDef monitor_defs[] =3D { - { "ssp", offsetof(CPUM68KState, sp[0]), NULL, MD_I32 }, - { "usp", offsetof(CPUM68KState, sp[1]), NULL, MD_I32 }, - { "isp", offsetof(CPUM68KState, sp[2]), NULL, MD_I32 }, - { "sfc", offsetof(CPUM68KState, sfc), NULL, MD_I32 }, - { "dfc", offsetof(CPUM68KState, dfc), NULL, MD_I32 }, - { "urp", offsetof(CPUM68KState, mmu.urp), NULL, MD_I32 }, - { "srp", offsetof(CPUM68KState, mmu.srp), NULL, MD_I32 }, - { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]), NULL, MD_I32 }, - { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]), NULL, MD_I32 }, - { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]), NULL, MD_I32 }, - { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]), NULL, MD_I32 }, - { "mmusr", offsetof(CPUM68KState, mmu.mmusr), NULL, MD_I32 }, + { "ssp", offsetof(CPUM68KState, sp[0]) }, + { "usp", offsetof(CPUM68KState, sp[1]) }, + { "isp", offsetof(CPUM68KState, sp[2]) }, + { "sfc", offsetof(CPUM68KState, sfc) }, + { "dfc", offsetof(CPUM68KState, dfc) }, + { "urp", offsetof(CPUM68KState, mmu.urp) }, + { "srp", offsetof(CPUM68KState, mmu.srp) }, + { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]) }, + { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]) }, + { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]) }, + { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]) }, + { "mmusr", offsetof(CPUM68KState, mmu.mmusr) }, { NULL }, }; =20 diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index e9300ded4ad..a60671a60a4 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) =20 const MonitorDef monitor_defs[] =3D { #ifdef TARGET_SPARC64 - { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 }, - { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 }, - { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 }, - { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 }, - { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 }, - { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 }, - { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 }, + { "asi", offsetof(CPUSPARCState, asi) }, + { "pstate", offsetof(CPUSPARCState, pstate) }, + { "cansave", offsetof(CPUSPARCState, cansave) }, + { "canrestore", offsetof(CPUSPARCState, canrestore) }, + { "otherwin", offsetof(CPUSPARCState, otherwin) }, + { "wstate", offsetof(CPUSPARCState, wstate) }, + { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, #endif { NULL }, }; --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277439; cv=none; d=zohomail.com; s=zohoarc; b=adYAaxYK3igP2fgJGOtSwxNAIwozAGtbLoLVpkMjQMlreLRDCXyLomFzgzC/q9jrqbQQM0Se6mB5JSAoQaOOLNsMG1MKmSltkiUnXqMQ8+15bojcNDXY2z/OYiHzdFWkVZi+ac4eMip/OGRomC3RzUwdhSse9CaFU0XhDM0xvTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277439; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=TmErLYkkyC0UQ3cHtYrsC9C+y1iumERnceYY02O3hcE=; b=XHB8zGnoep7e2q2fIR2hOzLBrPIurcuyeOcoUI4CPtUmDQ2jLwYK4R5Z+15vrUF7SW42kNLQaJlBUrAo7O5SB5lRjGmXd9aUpLTAsE+qWxdCtGoZb8Yf+QjQaLf01Tecx2qGTZudknOCnj7Dy4acb5mwhU+l6pL3KVF2VxxBAxc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277439657739.7922585408529; Mon, 27 Apr 2026 01:10:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH0v-0000d6-2b; Mon, 27 Apr 2026 04:08:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH0s-0000cD-R8 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:18 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450: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 1wHH0m-0001Tw-I7 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:18 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-43cfde3c3f3so10075425f8f.3 for ; Mon, 27 Apr 2026 01:08:12 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a7b4sm73442112f8f.22.2026.04.27.01.08.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277289; x=1777882089; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TmErLYkkyC0UQ3cHtYrsC9C+y1iumERnceYY02O3hcE=; b=xPbbklx0SYfMg1/FSHscTSWVkaylF6ZZkBzOpcdVeVR19UHHUMTGX2gBXPTapk4M39 24RiufFM7ZzajxWxALAf+nTSQCVn+4xBvZZyIu0jdiU95bgIq8h4AQj55JVdTs50e1ZE wiHiABicMijUBxPzqzPPepc8af/soovipmRyJH539loFJSS/fg7z48I6Y56tlqfP/NnA 19XwPHTUCOU3HV/1c7GBZ/qUOVGjGvpdDIvOyf6Cy2A5fq0KH5ALZu9CHD5tyol355PV Jt0G3hyXHD1JaiwK8WeVK6ykT2XJOdjj+HwJ+/ohaUOjNe6oDDRD38p6Bji5UIpFLtpv 88zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277289; x=1777882089; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=TmErLYkkyC0UQ3cHtYrsC9C+y1iumERnceYY02O3hcE=; b=HDgx9L9YV7WMo6s+RJ/1YIdCqiKk5laIGq6rd6b0EFUjePogguCCQv7I6sOZJbgzQW bYsSs9cC6YfcspzCwMmkI0Fx5aqNXbtXZ5uMCxWZXIVGnn1nhjFwXDJ4dQq8zjeuBV8I 88zdQlEAVgNY42KMT2UU8U9OcNYpqWw3io50b19Lsh5TjrXmOwehKQA5oUQxzfpcp3ro dOlZ18+mKK0+xs7MzSJbxbi06QLumxViBgfj+u9gOKkZpM037oesf4Z7w7Yh1K3Z2CFa wRo+434SaJRb8jqMbPiYF9i9ZGHI3MICxjLC5HFMW05LZb7ktiRYk2VHXR3ocUw9vaiB ITQQ== X-Forwarded-Encrypted: i=1; AFNElJ86JhtWS++1go10AsHYa7uvK1YQGyP3L+tZTfBOiJbn0JGfGo0IRiKd3d0+zu8Lgu1P5YjY0owWfpu1@nongnu.org X-Gm-Message-State: AOJu0YwzHf+KYoJDOBbYwrP4rxLVQIWlFywVsV2KCuDD1CKT+q9KLgHJ WX6NnpGPRiathWmTafXurpsiQAlxInNTJzMBKDr7/qLyhzAgPAeCcP80BMhVqM7zl5wxi0uDbOW 6ipv2rvA= X-Gm-Gg: AeBDiesezDmd0RKb19NjVSjtFYMJ1JvTqelYNWrM+kOIXYqsYfAGnBgBPxOUXPh+xqp BGs5N7t+aqUGiXDqgCpaVAsYBltIF3STfX1VS7v8e23N7fNfSt6uk4SH/0f4+a8wfEB3u5W31KJ t2DDYm0AsgtJxXjnaoYjrV8ekZxT/Lk6gZa28TpSbwtoCIFN6d8DefXVB78uKYJzeiTJHmIp9dQ bDSqWE1E9GQVPxZJ/MJzFJF+O77/J6KP3fcKIo4o42W4xPZtfGufnPQ16Db0M0x/KlvdlYviwf4 cYnTQyG4gwoG2f6sv0wvqX2wUklekf3Mbw05TCT+3W3M8PfKBPj6R+TAGXjpHC0BdreelOskWXJ 2ZDxouTU6HNXt/+u5oysu2jKo7WZa5emxxGKG1WIMxpB5q4YHVMZPEqDElbHjmm9v43zssToa6G zqtAN9lQqnlFQlTQrKjhfKLDtxhmHyEjw11AxKHE5OA65aT2g1jRsfLXDROunBHn9QW0irHqApb DTbKnCH5l7dM3iQWpB7Yg== X-Received: by 2002:a05:6000:200c:b0:43d:77f4:7145 with SMTP id ffacd0b85a97d-43fe3dd407dmr66647608f8f.19.1777277289285; Mon, 27 Apr 2026 01:08:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 04/32] monitor: Extract completion declarations to 'monitor/hmp-completion.h' Date: Mon, 27 Apr 2026 10:07:10 +0200 Message-ID: <20260427080738.77138-5-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277440666158500 Many files include "monitor/hmp.h", but few of them really need the completion declarations: move them to a distinct header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- MAINTAINERS | 2 ++ include/monitor/hmp-completion.h | 40 ++++++++++++++++++++++++++++++++ include/monitor/hmp.h | 21 ----------------- chardev/char-hmp-cmds.c | 1 + migration/migration-hmp-cmds.c | 1 + monitor/hmp-target.c | 1 + net/net-hmp-cmds.c | 1 + qom/qom-hmp-cmds.c | 1 + system/qdev-monitor.c | 1 + system/runstate-hmp-cmds.c | 1 + trace/trace-hmp-cmds.c | 1 + ui/ui-hmp-cmds.c | 1 + 12 files changed, 51 insertions(+), 21 deletions(-) create mode 100644 include/monitor/hmp-completion.h diff --git a/MAINTAINERS b/MAINTAINERS index 35529266a26..fda43a7605b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3383,6 +3383,8 @@ F: monitor/monitor.c F: monitor/hmp* F: hmp.h F: hmp-commands*.hx +F: include/monitor/hmp.h +F: include/monitor/hmp-completion.h F: include/monitor/hmp-target.h F: tests/qtest/test-hmp.c F: include/qemu/qemu-print.h diff --git a/include/monitor/hmp-completion.h b/include/monitor/hmp-complet= ion.h new file mode 100644 index 00000000000..dab21867dc9 --- /dev/null +++ b/include/monitor/hmp-completion.h @@ -0,0 +1,40 @@ +/* + * Human Monitor Completion handlers + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * Anthony Liguori + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HMP_COMPLETION_H +#define HMP_COMPLETION_H + +#include "qemu/readline.h" + +void object_add_completion(ReadLineState *rs, int nb_args, const char *str= ); +void object_del_completion(ReadLineState *rs, int nb_args, const char *str= ); +void device_add_completion(ReadLineState *rs, int nb_args, const char *str= ); +void device_del_completion(ReadLineState *rs, int nb_args, const char *str= ); +void sendkey_completion(ReadLineState *rs, int nb_args, const char *str); +void chardev_remove_completion(ReadLineState *rs, int nb_args, const char = *str); +void chardev_add_completion(ReadLineState *rs, int nb_args, const char *st= r); +void set_link_completion(ReadLineState *rs, int nb_args, const char *str); +void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str= ); +void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str= ); +void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *= str); +void info_trace_events_completion(ReadLineState *rs, int nb_args, + const char *str); +void trace_event_completion(ReadLineState *rs, int nb_args, const char *st= r); +void watchdog_action_completion(ReadLineState *rs, int nb_args, + const char *str); +void migrate_set_capability_completion(ReadLineState *rs, int nb_args, + const char *str); +void migrate_set_parameter_completion(ReadLineState *rs, int nb_args, + const char *str); +void delvm_completion(ReadLineState *rs, int nb_args, const char *str); +void loadvm_completion(ReadLineState *rs, int nb_args, const char *str); + +#endif diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index e222bea60cd..9c2330205fc 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -114,27 +114,6 @@ void hmp_vhost_queue_status(Monitor *mon, const QDict = *qdict); void hmp_virtio_queue_element(Monitor *mon, const QDict *qdict); void hmp_xen_event_inject(Monitor *mon, const QDict *qdict); void hmp_xen_event_list(Monitor *mon, const QDict *qdict); -void object_add_completion(ReadLineState *rs, int nb_args, const char *str= ); -void object_del_completion(ReadLineState *rs, int nb_args, const char *str= ); -void device_add_completion(ReadLineState *rs, int nb_args, const char *str= ); -void device_del_completion(ReadLineState *rs, int nb_args, const char *str= ); -void sendkey_completion(ReadLineState *rs, int nb_args, const char *str); -void chardev_remove_completion(ReadLineState *rs, int nb_args, const char = *str); -void chardev_add_completion(ReadLineState *rs, int nb_args, const char *st= r); -void set_link_completion(ReadLineState *rs, int nb_args, const char *str); -void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str= ); -void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str= ); -void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *= str); -void info_trace_events_completion(ReadLineState *rs, int nb_args, const ch= ar *str); -void trace_event_completion(ReadLineState *rs, int nb_args, const char *st= r); -void watchdog_action_completion(ReadLineState *rs, int nb_args, - const char *str); -void migrate_set_capability_completion(ReadLineState *rs, int nb_args, - const char *str); -void migrate_set_parameter_completion(ReadLineState *rs, int nb_args, - const char *str); -void delvm_completion(ReadLineState *rs, int nb_args, const char *str); -void loadvm_completion(ReadLineState *rs, int nb_args, const char *str); void hmp_rocker(Monitor *mon, const QDict *qdict); void hmp_rocker_ports(Monitor *mon, const QDict *qdict); void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict); diff --git a/chardev/char-hmp-cmds.c b/chardev/char-hmp-cmds.c index 8e9e1c1c021..f377e00b699 100644 --- a/chardev/char-hmp-cmds.c +++ b/chardev/char-hmp-cmds.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "chardev/char.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-char.h" diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 0a193b8f54a..d5712d11b8c 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -17,6 +17,7 @@ #include "block/qapi.h" #include "migration/snapshot.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-migration.h" diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 3f019ae2a28..da7dd7f31f2 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -29,6 +29,7 @@ #include "system/device_tree.h" #include "monitor/hmp-target.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "block/block-hmp-cmds.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" diff --git a/net/net-hmp-cmds.c b/net/net-hmp-cmds.c index e7c55d27876..2b24c9e6049 100644 --- a/net/net-hmp-cmds.c +++ b/net/net-hmp-cmds.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "migration/misc.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "net/net.h" #include "net/hub.h" diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c index 32e40630c96..47110ca58c0 100644 --- a/qom/qom-hmp-cmds.c +++ b/qom/qom-hmp-cmds.c @@ -8,6 +8,7 @@ #include "qemu/osdep.h" #include "hw/core/qdev.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-qom.h" diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 1ac6d9a8575..2ed95e83602 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "hw/core/sysbus.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "monitor/qdev.h" #include "system/arch_init.h" diff --git a/system/runstate-hmp-cmds.c b/system/runstate-hmp-cmds.c index be1d6769926..02d1d42bf39 100644 --- a/system/runstate-hmp-cmds.c +++ b/system/runstate-hmp-cmds.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "exec/cpu-common.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-run-state.h" diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 45f4335ff5d..390173095cf 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c index 6c93d452c9c..1e9bc77bd80 100644 --- a/ui/ui-hmp-cmds.c +++ b/ui/ui-hmp-cmds.c @@ -18,6 +18,7 @@ #include #endif #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor-internal.h" #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277396; cv=none; d=zohomail.com; s=zohoarc; b=kee0O8QJt2/EdABiOhvRHUGDLaw6nOYhoUdhXJpMJvq2kcRuuVDl6iNGZjVwCpQ6Q71seDbbDSYOxwQBFilOyWGssHWMgMTC638Ug/JcNYefHu0Df7SipMNuBNhtyRXZ5yyHFC5XECp+iyj16gnKU7RtS9N2geR5BeIZtzzboVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277396; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=soongvcfrV5N/fMvpjm2AWSwT0obpT+oO9D8kh7HmCM=; b=NeXe3EcGu2/Q2R7w60gtmyu7Z81kj5VtwAdKajzaau0HZ3DsECTMDECs98UZ+qDPcGT6dW6HcbUKumILIkmR2d6dcWl70/HlY8EUO99ozd4mAqeMd9E8dtVsdurneFBMFHJSkgfRwwYKympCx8xtq+9sfB9xTCtJssZxZnxkp2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277396960685.5598097618512; Mon, 27 Apr 2026 01:09:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH0v-0000d9-Dy; Mon, 27 Apr 2026 04:08:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH0t-0000cV-OF for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:19 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH0r-0001Wn-US for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:19 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-43d0deb7ad5so8221006f8f.2 for ; Mon, 27 Apr 2026 01:08:17 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4c221cdsm80108909f8f.0.2026.04.27.01.08.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277296; x=1777882096; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=soongvcfrV5N/fMvpjm2AWSwT0obpT+oO9D8kh7HmCM=; b=o3EAJkGdzvkFzsUQjLmpB2D1E2dVH9yA7Dds+Uar2ceTHJqHPRomKQNiAa918FV1Vi 449mVXEmOhbEpd+0Ksa4k/oJMiUD1WAzCuRMx3TpWzRDenrZCSxKp1hfRB1noIyn5umm DyVn1u6nsot9OJ5oVZO6nXx+VYmeBdGKbJDBhBlYGNsVqjkH5F8qWtCAV3siIfl26uEv /qh3kXmPATmetUjQCHdUyKYOaTXsqlLKi4iANyH8b4WvaEJiDFeKlxXKRfFi2hZBUhdO JPD54612Y2VJ6FVprDbHEL2KACwwNeMpWYDg+g7rVLlw1Qfpe1BDvt6zrpU0OY5BZ4R/ m4eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277296; x=1777882096; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=soongvcfrV5N/fMvpjm2AWSwT0obpT+oO9D8kh7HmCM=; b=G77OHz9i+YnQDHv0zQz1R585dkjKS0wHbyyEel9NvtfR39mQc+dml7qImXQm/M41DB DYrkKsN+NJKsQnSUvdJVvId13gRgc2c+wlaGJwfg5T6aZQX8kfoayTsmBKG6lsqPBKbx c4GgglcELtqX4ihBE2EmmFEizQ/fI1JOo4MoKOTGup4lLvZiqIjxYpU2l+8AwjiGI7ZX 0NobcQ3OUiMRoVc4G6mCss9AvOXFxv3ZY/o0/VfbWx6aTQXnS8O63WBu7HtJJUW/iWqW 1pVAu/lsTtDfth7K01PWXeLc+mAXGaXqlWWB/PCTuKBvAcV1Uv9qewWwJVq7l6yue4AR mCdQ== X-Forwarded-Encrypted: i=1; AFNElJ+CeAsZSiMaDL9OY1po0SGOohfe+qyJoZh5amM4lyeZE5tT39dQiZMSsaFIo4Y7DE69waKGr4h4cPZY@nongnu.org X-Gm-Message-State: AOJu0YxtAO4wWlFykfnD1mCI1HxdZ0QFizcJxKfpbCiELS52Pk9NAZG+ DpDEEjMqj9B0Z9HtuNIK5xtae7lzwBsfZC4UEWLdVZRmRutGSLs9td0izapFAvH4CtfTuRXO8jy r3dA1XGY= X-Gm-Gg: AeBDies+Cguvvo2sJjulzdnlvyc+dvLQPleNkX2ZNdqfAIjiLaY2h0AKSel4ZDk4TgD b9NwvhYVSYqPLb4SLRtw118hpNL5qz/1DLRbu4p3eBR4ImwJ0sCjcXMFKmNw0U7bMtpp+vVhMj2 s1ugBfNaJ2rSNkgsuWkWzBRLcl2eoFlmTbCf+Rqar6n+WQRUpcC4zNBJq0OQqogjyuy0GWwGn55 YcLUOssUKAHaQ31lNS55m+VxZXUwsemt5dYm7JMrxTcbG/czaJ9eUR9aOl+PbX1vFKAvRofudrF mHOK4VGNlpYz/TLBD+ECR+kSMGQoYnUvsId2UUlHpQNIGshPXbUHQ++76zCmGbOVauAIdBYC0tU 1Hxx9aiN3XjGdTyAWQ48rt0H448IZ7wvEPgLau/xIuWNRjaCowoBkscRvda6ysY0lbDLd7/XM48 ks97OhhnUENTWhX+rSIh207FL9KA8HLyEb1C1XtC1n3OHe/zBN5fY/ZS5riHEn3LFKmUhGpnm3z yCzhZIOiPE= X-Received: by 2002:adf:fad2:0:b0:43f:e439:5c2c with SMTP id ffacd0b85a97d-43fe4395ccbmr46157638f8f.1.1777277296026; Mon, 27 Apr 2026 01:08:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 05/32] stubs: Rename monitor* -> qmp* files Date: Mon, 27 Apr 2026 10:07:11 +0200 Message-ID: <20260427080738.77138-6-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277399792154100 We use 'HMP' for Human monitor and 'QMP' for 'Machine protocol'. These files aren't about human monitor but QMP, so rename them for clarity using the 'qmp-' prefix instead of 'monitor-'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Eric Farman --- MAINTAINERS | 6 ++++++ stubs/{monitor-arm-gic.c =3D> qmp-arm-gic.c} | 0 ...nitor-cpu-s390x-kvm.c =3D> qmp-cpu-s390x-kvm.c} | 0 stubs/{monitor-cpu-s390x.c =3D> qmp-cpu-s390x.c} | 0 stubs/{monitor-cpu.c =3D> qmp-cpu.c} | 0 stubs/{monitor-i386-rtc.c =3D> qmp-i386-rtc.c} | 0 stubs/{monitor-i386-sev.c =3D> qmp-i386-sev.c} | 0 stubs/{monitor-i386-sgx.c =3D> qmp-i386-sgx.c} | 0 stubs/{monitor-i386-xen.c =3D> qmp-i386-xen.c} | 0 stubs/meson.build | 16 ++++++++-------- 10 files changed, 14 insertions(+), 8 deletions(-) rename stubs/{monitor-arm-gic.c =3D> qmp-arm-gic.c} (100%) rename stubs/{monitor-cpu-s390x-kvm.c =3D> qmp-cpu-s390x-kvm.c} (100%) rename stubs/{monitor-cpu-s390x.c =3D> qmp-cpu-s390x.c} (100%) rename stubs/{monitor-cpu.c =3D> qmp-cpu.c} (100%) rename stubs/{monitor-i386-rtc.c =3D> qmp-i386-rtc.c} (100%) rename stubs/{monitor-i386-sev.c =3D> qmp-i386-sev.c} (100%) rename stubs/{monitor-i386-sgx.c =3D> qmp-i386-sgx.c} (100%) rename stubs/{monitor-i386-xen.c =3D> qmp-i386-xen.c} (100%) diff --git a/MAINTAINERS b/MAINTAINERS index fda43a7605b..02628ca20cb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -121,6 +121,7 @@ F: include/hw/s390x/ F: include/hw/watchdog/wdt_diag288.h F: pc-bios/s390-ccw/ F: pc-bios/s390-ccw.img +F: stubs/qmp-cpu-s390x.c F: target/s390x/ F: docs/system/target-s390x.rst F: docs/system/s390x/ @@ -496,6 +497,7 @@ M: Christian Borntraeger R: Eric Farman R: Matthew Rosato S: Supported +F: stubs/qmp-cpu-s390x-kvm.c F: target/s390x/kvm/ F: target/s390x/machine.c F: target/s390x/sigp.c @@ -510,6 +512,8 @@ L: kvm@vger.kernel.org S: Supported F: docs/system/i386/amd-memory-encryption.rst F: docs/system/i386/sgx.rst +F: stubs/qmp-i386-sev.c +F: stubs/qmp-i386-sgx.c F: target/i386/kvm/ F: target/i386/sev* F: scripts/kvm/vmxcap @@ -522,6 +526,7 @@ S: Supported F: include/system/kvm_xen.h F: target/i386/kvm/xen* F: hw/i386/kvm/xen* +F: stubs/qmp-i386-xen.c F: tests/functional/x86_64/test_kvm_xen.py =20 Guest CPU Cores (other accelerators) @@ -798,6 +803,7 @@ F: include/hw/timer/a9gtimer.h F: include/hw/timer/arm_mptimer.h F: include/hw/timer/armv7m_systick.h F: include/hw/misc/armv7m_ras.h +F: stubs/qmp-arm-gic.c F: tests/qtest/test-arm-mptimer.c =20 Bananapi M2U diff --git a/stubs/monitor-arm-gic.c b/stubs/qmp-arm-gic.c similarity index 100% rename from stubs/monitor-arm-gic.c rename to stubs/qmp-arm-gic.c diff --git a/stubs/monitor-cpu-s390x-kvm.c b/stubs/qmp-cpu-s390x-kvm.c similarity index 100% rename from stubs/monitor-cpu-s390x-kvm.c rename to stubs/qmp-cpu-s390x-kvm.c diff --git a/stubs/monitor-cpu-s390x.c b/stubs/qmp-cpu-s390x.c similarity index 100% rename from stubs/monitor-cpu-s390x.c rename to stubs/qmp-cpu-s390x.c diff --git a/stubs/monitor-cpu.c b/stubs/qmp-cpu.c similarity index 100% rename from stubs/monitor-cpu.c rename to stubs/qmp-cpu.c diff --git a/stubs/monitor-i386-rtc.c b/stubs/qmp-i386-rtc.c similarity index 100% rename from stubs/monitor-i386-rtc.c rename to stubs/qmp-i386-rtc.c diff --git a/stubs/monitor-i386-sev.c b/stubs/qmp-i386-sev.c similarity index 100% rename from stubs/monitor-i386-sev.c rename to stubs/qmp-i386-sev.c diff --git a/stubs/monitor-i386-sgx.c b/stubs/qmp-i386-sgx.c similarity index 100% rename from stubs/monitor-i386-sgx.c rename to stubs/qmp-i386-sgx.c diff --git a/stubs/monitor-i386-xen.c b/stubs/qmp-i386-xen.c similarity index 100% rename from stubs/monitor-i386-xen.c rename to stubs/qmp-i386-xen.c diff --git a/stubs/meson.build b/stubs/meson.build index f33b1d2a089..af4051e6c5e 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -79,14 +79,14 @@ 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')) - 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')) - stub_ss.add(files('monitor-cpu-s390x-kvm.c')) + stub_ss.add(files('qmp-arm-gic.c')) + stub_ss.add(files('qmp-i386-rtc.c')) + stub_ss.add(files('qmp-i386-sev.c')) + stub_ss.add(files('qmp-i386-sgx.c')) + stub_ss.add(files('qmp-i386-xen.c')) + stub_ss.add(files('qmp-cpu.c')) + stub_ss.add(files('qmp-cpu-s390x.c')) + stub_ss.add(files('qmp-cpu-s390x-kvm.c')) endif =20 if have_system or have_user --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277352; cv=none; d=zohomail.com; s=zohoarc; b=PE+r3uHndN5YHOBXPY37EeCYJ0WSijklJJf7nUfuYkV8C5Xy3T9fRQQgYFadP7CtqBdgdidkD58tQ6UeklFfgpqsyL0hRAigl9apVfZTP67A6agsxm/bV3ZJ8fTqLXD6eXMes66dg1JbrUBzToIfSxirMPsdVYbq/M4qeEJYsfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277352; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=qNtUCJEojkga+haWLj/ILWXdDy+o/7LVCJo0CbKm7kQ=; b=L3LuKTFSxV14vtB6Y+0awwuZBVs8hVrzivSQFD5RAI8HdONvEUtQ4/Oo/dbPSFj+qtaDeDvZlBSHqoAKsmOnw3AppE3L6osirMT2hGDnz7B9Yv59+ohfWOPTGloD/xrB3u9wW+4TTd4bH/mHMzFSDB+fTYq8TL5AaYYz5YKEkn8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277352244620.9321479819798; Mon, 27 Apr 2026 01:09:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1G-0000oe-RZ; Mon, 27 Apr 2026 04:08:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH10-0000iR-4s for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:27 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH0y-0001b6-Hb for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:25 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4890098abbaso77827915e9.0 for ; Mon, 27 Apr 2026 01:08:24 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb77b001sm369730625e9.3.2026.04.27.01.08.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277303; x=1777882103; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qNtUCJEojkga+haWLj/ILWXdDy+o/7LVCJo0CbKm7kQ=; b=ggZb/aWJYZTF7XOIzFGBKOKWLn43BG0G86jPt71pU2fn9HZ2QfcHTpvB9tCfgjomm+ RoOyvAHLZWl34xNZR9fhRZSZYBgbnoF9WhI4KRZJ3W4/BR1X8z24R8cMKSMtmJHd1LKc nofGRWQqZXKZStUDBTh62bOVBFQjlsNc7m3dUPcYHajOBMWZy17kvs2Xk175vJBgIY2L a2vIjRcwHy8ZBn07sDx0To58P9mPKmytY6rxA9+ytXaUrjoSjQb1k7PI8bdXD3qm4AQe uTg93f5jhCRTpAnIglVzMPgbOnew2xZnwvoj8iH2Lnez/h/SPRDPDD75MUrxSerwmjCI 9DmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277303; x=1777882103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=qNtUCJEojkga+haWLj/ILWXdDy+o/7LVCJo0CbKm7kQ=; b=PynT5+wLcGmPfLVJhMgvOQOAa2FD0tQmfCt9yd+c25kI+jNClA0oPdDluFnuJ+aEmu vB4uAt/u5ITDQcV0qnGE4DtFJghNVcntxV+qLRQTzdjmzf45H/orhP5rMVm+FKi1jssr r5HOCG2SWi3nI3mx+GsV9X780y0elb2yqv8aMDuFkef8yCZwfZC+42A54KdYHFa09/3R sUGDDHoGiB6oFnQNlMJ55o5aSKAAjHpkfHRyXBTkGKU8/TBgya0r7z3GJfgLJIq/9hgm aIFySEIjM4nfx+XLv5icbh1PLVblmYm8EbzDv2/KmQmo9PaHh0afHe4qGWOF/SCO0EPt m3qg== X-Forwarded-Encrypted: i=1; AFNElJ9Bsbvce+GTXDXiltTcRBbzbn679Jp79EUNUlUY24WjV3v6fmrqbNJXAG846TymACVumulWD4lfC16I@nongnu.org X-Gm-Message-State: AOJu0YyR1QC3w55/xHj0crKrx/ysLxSBfETCqcSkgBjoWM1hM8M76dSa HTnrn69s61q0q9Re4CPZUVAAzHTpMd0nvSRAuun4D36Xcir8fzMXSdkCcshg2ZU8FmDXcL2o0dK gPFHbQ08= X-Gm-Gg: AeBDiet9s1xQrJj7/pstY6El2aAP3DuTiLJCSXdShwiYXXVFQh7tM0z6hFlzXwGS8f9 Nv5LUjV/SUmL8J4vA0H7wnfDv3RM6Jsd83gTTKXGgwLhkuUcRaKxVuKp36r3zTDpHSgki17Q4Aq s5/X09BOcltPQ7kKAnAJDooVop31a3FZu6lyfhIJXE1epVhAG7f1ygE+lFFxNJJRBeCMubPe2OE u+UiMLn/pGSTWiQUCvF0cEd1qEHZilbkyXsRMxsPNiQ5gmqz1k+lAlneSfjWiJP2a/DNrhVwImG XsHu7gOydt230FI5VOgBFc9rGcSRqMxDrfTQ3xEzAHWaHFEmdf32hMzi/Tnijg5d5lKSNVtvx/h hj1eUYoa/gnVinjsFMJi001jR70XjhbOv88Sy2ng7fBic9gzIaKhb/svzbxrc+QzPanGgpqoqWf v37LV1hlvCwxp+rqigGi78nnHKcy+tA0DzUCds7x5AXHa7diqoYBgtoFDPmho2spB0FpJq5Bjxc tqwNeITJyA= X-Received: by 2002:a05:600c:621a:b0:48a:592c:e642 with SMTP id 5b1f17b1804b1-48a592ce867mr333974625e9.18.1777277302759; Mon, 27 Apr 2026 01:08:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 06/32] monitor/meson: Use SPICE with migration HMP commands Date: Mon, 27 Apr 2026 10:07:12 +0200 Message-ID: <20260427080738.77138-7-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277354112158500 When moving code around in commit 27be86351ec ("migration: Move the QMP command from monitor/ to migration/") we forgot to update the meson rule about SPICE pkg-config flags. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- migration/meson.build | 2 +- monitor/meson.build | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/meson.build b/migration/meson.build index c9f0f5f9f21..e583822dec6 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -23,7 +23,6 @@ system_ss.add(files( 'fd.c', 'file.c', 'global_state.c', - 'migration-hmp-cmds.c', 'migration.c', 'multifd.c', 'multifd-device-state.c', @@ -37,6 +36,7 @@ system_ss.add(files( 'socket.c', 'tls.c', ), gnutls, zlib) +system_ss.add([spice_headers, files('migration-hmp-cmds.c'), spice]) =20 if get_option('replication').allowed() system_ss.add(files('colo-failover.c', 'colo.c', 'multifd-colo.c')) diff --git a/monitor/meson.build b/monitor/meson.build index 2647100e04c..585251804e4 100644 --- a/monitor/meson.build +++ b/monitor/meson.build @@ -5,8 +5,8 @@ system_ss.add(files( 'hmp-cmds.c', 'hmp.c', 'qemu-config-qmp.c', + 'qmp-cmds.c', )) -system_ss.add([spice_headers, files('qmp-cmds.c')]) =20 specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', - if_true: [files('hmp-target.c'), spice]) + if_true: [files('hmp-target.c')]) --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277352; cv=none; d=zohomail.com; s=zohoarc; b=LLvJEWluUHw0Niy5YBK/A70h2o8mFW95vYDXkLfh7gEPGSpHUOd4cy01J7FfJRf3R69zrJsoiXVtTO3Rp00VmeGtBQMY4WJprCKa4BseJ3fadoEZfx+VKZJdr3yZKCXtUBF9e6Y2fphf0jyy8VwoxuZT7u1yLydrZu2/49N28AQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277352; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=UfM0rjL9l7HImwIhQNZz86yWfS4Ppx2p9yTZq5d663s=; b=boHnI84LhqHKqApTtMlS/9bWZPWmUr/KZ4wcsl6RmzURZH5S71/FWcKiZa5ij3u+CytvdmkVz/vtWELUTVB3W7I293UoPlLCXs7BDkoUawubMFsALXt/+OYm8a5gBGZFUiLrsBhL3dM8G8ZwlKVShxLWRF9WlIEoSJnojJMtpV4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277352929833.8043540569569; Mon, 27 Apr 2026 01:09:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1W-00017Y-Qo; Mon, 27 Apr 2026 04:08:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH18-0000na-Kg for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:37 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH16-0001ca-TD for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:34 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-43d77f60944so7303917f8f.3 for ; Mon, 27 Apr 2026 01:08:30 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4411c9f4f03sm48330850f8f.1.2026.04.27.01.08.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277310; x=1777882110; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=UfM0rjL9l7HImwIhQNZz86yWfS4Ppx2p9yTZq5d663s=; b=EHS+Mcx6CHsrAT5+EfeEVoSInqXK5jx/3jCuMDP4G8BwMS4i3vdcruOXShk1HWzBbK vM6uwzLtF+OolhIzPIRK62gH+9c6Cmu+b9rMJAK2u4D+BgbrxXYvPjChGTp1nly2HpYg tQt430Ni3gm2v1j0cm70RfK56IIna+nBnBhQZKibo04RqmBiO2H8MeE3OZ6qabw14/n4 S+aK7cA80a/VDo8ZYGC7nXeae7O/Y/FW9vVa2WQKcnKqqMhmKZwqGuSFSH+H5HuX5TaH VQXu9OfPrDCsb8RsZ6eQ07mhtttZTU4p9NdKp3bAXvIGryqa28gtbezFMNnB8lwF3hyn Kd9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277310; x=1777882110; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UfM0rjL9l7HImwIhQNZz86yWfS4Ppx2p9yTZq5d663s=; b=UM5W9yhsdNJbnPoA8MS7JBbkwjxg2R86lV/ZtQMWP9Zx1I+XldIBr5btONybeQYs2d /nP8lIgXYo/pilnOOPWC7dBfhI5MPlIENOyq570yOlooLXJ7vIDRytNjko3lEE9s1Zm0 nMIOX0EB96vb/dgOKh6qmgOinek56ncIQEd4yaSkrg/PiISDA4NmVlYJ7ThCZJhnl0no PmwXVDUXa4CzvLb3xgDZVIjLgM9JLNpthAqrTPq22r1RjwOtAK+gGmjInHwehqSrulDM MQLxQiOAKpS0d3I2PcrnG3lqI9w3JD4e8nKBJTPkfoXdXNo5afB9SaIngLuEKoZCw/zV v71Q== X-Forwarded-Encrypted: i=1; AFNElJ+c3HVHGHvPJHIBhHOaB1FiDhz0YDzsGlCLAvvieUckRsWjlfyof7urIrXDqyMRLoIROuT5MkvwDIUv@nongnu.org X-Gm-Message-State: AOJu0Yz/0Qn7tWizipz0gmTJJFmDI9kI8RF0yDnSh31dxcLFQEmih19U QmpdeNLLpXtWIt0Yg3v91hN9CS04r0KVIgub/p327+XdyApazXwb2zlwFyreUFMhaS4fSTzc2sH D7RNBPSs= X-Gm-Gg: AeBDieuoAYpAeaPvRcH5ZMKeL+7l2XFqSHXLhsv8fbU6xy9q4ZMypzULj5MkwSkjQe3 jJ2aZyEMFmsfl2LmBvwELMGRes2JrFAi5jaHzIfAB4e0Py5xyUVHKlJL5TURzBZMHGm0Rdty3Ra 7RxFhs6GCNIXcaJ5YZM8NPkQpEWZXoftzN4ilLZdFWzGFWLLkmSSXlwH/mFJxS2S5FDcRC1OAI2 0Dm/qadLM5UIgCwIy7qlywPc6d39LwbTmRdukq3FOclsOQLeqwk/4EC6KB+13Z2chZ46XKakuK0 hwl7iOSIqgZsubgBCRccTvB22Jr3Z0CQfXghyWAHH6bYDI0J4rIOyvHV1NLrRAK6mMnVc5DfTTK Q2d2VHvAsFsOER1nsgQ8OKkS0JfOjfPZYtXXipuh5+7qI240k8r1tPoCyOdywpFuBs/ZqoRU9EH NQf8+WFFq1Msj5DYI0RRojKLIICkzblvbDTwo1lDRJH3TtQkxM9WzxJnmKMgzlz3EBld3NoDjs4 /fsJhg49ozDIlhrQ6mp9g== X-Received: by 2002:a5d:5f82:0:b0:437:711c:8754 with SMTP id ffacd0b85a97d-43fe3dc842bmr66027146f8f.7.1777277309482; Mon, 27 Apr 2026 01:08:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 07/32] monitor: Restrict monitor_set_cpu() method scope Date: Mon, 27 Apr 2026 10:07:13 +0200 Message-ID: <20260427080738.77138-8-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277354115158500 As mentioned in commit 755f196898e ("qapi: Convert the cpu command") 15 years ago, the monitor_set_cpu() method is a temporary bridge between QMP -> HMP and shouldn't be used elsewhere. Make its scope internal to monitor/. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/monitor/monitor.h | 1 - monitor/monitor-internal.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 296690e1f1c..55649a86641 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -37,7 +37,6 @@ int monitor_vprintf(Monitor *mon, const char *fmt, va_lis= t ap) int monitor_printf(Monitor *mon, const char *fmt, ...) G_GNUC_PRINTF(2, 3); void monitor_printc(Monitor *mon, int ch); void monitor_flush(Monitor *mon); -int monitor_set_cpu(Monitor *mon, int cpu_index); int monitor_get_cpu_index(Monitor *mon); =20 int monitor_puts_locked(Monitor *mon, const char *str); diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index feca111ae31..80b4a8150bf 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -175,6 +175,7 @@ void monitor_data_destroy(Monitor *mon); int monitor_can_read(void *opaque); void monitor_list_append(Monitor *mon); void monitor_fdsets_cleanup(void); +int monitor_set_cpu(Monitor *mon, int cpu_index); =20 void qmp_send_response(MonitorQMP *mon, const QDict *rsp); void monitor_data_destroy_qmp(MonitorQMP *mon); --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277420; cv=none; d=zohomail.com; s=zohoarc; b=Q7hycisxQErONpyKfIyNn+cjA1W7mPl4F5qz0lyClTcwnhbFaKXMJ/MV1hSZBzWsJ1OsH2JPfMME+9WdaQPBgdpMrmo+pGKR6EfNMbI6/E5uD1T9VlBYmqlQ3xxqQaK10jjsKOpoIsnLz8x0voHHRiNtcd5GkXQVb85VJ1sjmyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277420; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=dBz5nfiIUSdPkWdXYRedfkJmFQeJEAnz3d+04j8ybgc=; b=jUdOU88u/KIcOokqzRUHZMZaIIlQfs/DrgT3cYsbfIU33aEh7SLk3OZfjSUMaloqYcVR3YoQJVyKVXrHyr9rJHI5tWTnNBqJtOGJwwF/eO7/BRvqVczqYS1OWnzgFv59Hs8ihNF3QVp5A+2P/5L+P3v+vorsavi1m/BmTcSr0o8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277420176297.8782661267304; Mon, 27 Apr 2026 01:10:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1X-00019Z-BM; Mon, 27 Apr 2026 04:08:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1F-0000pC-Ei for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:42 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1C-0001dh-7j for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:39 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-441209fb77eso4253526f8f.1 for ; Mon, 27 Apr 2026 01:08:37 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4cb1365sm83719523f8f.7.2026.04.27.01.08.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277317; x=1777882117; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dBz5nfiIUSdPkWdXYRedfkJmFQeJEAnz3d+04j8ybgc=; b=NfpmGvst4vdHG45MmsmpCiWdJLXfXxdDtrPWVq90gMWXfqkt7hakltDs21aRjH7nL+ PTk0Bo5OtJjy+BTpZ6DPHSmWZ9khkJFfhFVMgclSXOvtKp6+wor3xbGoVUS19trumlVU fL/0p6etZa5oOEwN57fmWD6yaV0nudarDSqr4eAxQ518Gda3QxlUTCbVpaBfQLUZLEuW pxpn71QXLnz4qfYFm6+PsJh1JCtULwWXDhcaEKg3ettFMk8F7tn0F27Pcd75lwZBtjsc DvenwiuIm3C5WBKcFLJ2guPdeZjh7rrojb6zxFX/4mFhLiqAe/HP8gvj2sqjTP/E0ZDg YrZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277317; x=1777882117; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dBz5nfiIUSdPkWdXYRedfkJmFQeJEAnz3d+04j8ybgc=; b=M4nD1RfeQ6HAi3/fNTM+0Xe9nrVCmgl/SLqNd/oV0Pi/fmUUYqnjmVqY8v5ofNMyh4 vTwee+ph3rl0H+TcwPUGG+Ljfx9dkAebUHhqLGjWaQJuCH9jiEwE/MSDNQUMx00P56MJ IL3my/rSzkjhiDfK3SrM8b9+aYb/dT061vCt4SrnpTQUMJXhczECwOJ4EtxsTal1v0Dq nAvNw22sWEjgVgx/B/tPS11DI95v4E1xK/TaqwCosqjDQOFBXKObPeBZlJ0x75dODkg/ 2m94aB1yJq3JLdMTWj5MsH4BuJ7M/pMDtutv7UYEfVhdUVO1jaxni5tWmv8KdY9L+5MU 08GQ== X-Forwarded-Encrypted: i=1; AFNElJ+OMfDw7M23xeXCAgPdi7HWpiASi0+hQ7y2CGOAn7pI9Bs5UwgFBt+cLr/hUPBESxm3pOA3Bpb1bBfy@nongnu.org X-Gm-Message-State: AOJu0Yz4AFo4QTGI/fIOAcunG09HzolZ2rLtKNjrit4Ef5PBqpHlbeCl enxsH/+0o3D4IlFeaVv+/wTjVIiRGnmPmy1aat12FCejLU7ol9YqbxSQfjSexykoz1HLOM8S23d rtYzpoEU= X-Gm-Gg: AeBDieuHIU6fRxshATt5dxIo66zbstJFOuHxfWHzvZVCqNCOHu3KMta9wq0nmG6kvrl pf8XJizqJwvCbfy3bhFrRAxNXqnqJBfK5qKHZebMBgUhs7VIBuaKxJPyIiBQ/RCmxW5fIrFufwm VUzvtYTgdg09vyuxEk4soLiZmBWM/tUq16yL3OYu5QYz71kRDuAmRFZN/gBpaY2/TlRp50cMbRj j+3YsYA+D0yuT+GUJ6slNQ3tgxMg4UuhPhaouEGMAtx15waUrwIgIQkeYJ+9HALGs0x4hx0xmmV S9En1yoOic4+nOipIbl0k2+cJ/IPnHH4IjACEu3jSfUyLOe0zGwxT4TxLzcPjkoOdyOXRI8j2mX l/Ff/kwslbxbnmlhWAZpxbQ7sUDqlRq+SyXNvmkug1vwQb9tzoNq311I7ZjoWc1bls3UQgyfxFH RKBmNt7PqybCRonzuSwZojuJ4/bT9JFs1Cj1GWAvIXTWWiK1uFsshPFKkGf+GdLUw+lKzOCl0Tb Rj3X1i6kvY= X-Received: by 2002:a05:6000:41e5:b0:43f:dd8e:869a with SMTP id ffacd0b85a97d-43fe4032b3cmr56617295f8f.3.1777277316410; Mon, 27 Apr 2026 01:08:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 08/32] monitor: Make 'info via' a generic command Date: Mon, 27 Apr 2026 10:07:14 +0200 Message-ID: <20260427080738.77138-9-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277422243158500 In order to build hmp-commands-info.hx once we need to stop using device target-specific check. Use the generic pattern to make the command available on all targets, providing a stub with kind error message when the device is not available. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 2 +- hw/misc/mos6522-stub.c | 16 ++++++++++++++++ hmp-commands-info.hx | 2 -- hw/misc/meson.build | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 hw/misc/mos6522-stub.c diff --git a/MAINTAINERS b/MAINTAINERS index 02628ca20cb..8ed6648d094 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1554,7 +1554,7 @@ F: hw/ppc/mac_newworld.c F: hw/pci-host/uninorth.c F: hw/pci-bridge/dec.[hc] F: hw/misc/macio/ -F: hw/misc/mos6522.c +F: hw/misc/mos6522*.c F: hw/nvram/mac_nvram.c F: hw/ppc/fw_cfg.c F: hw/input/adb* diff --git a/hw/misc/mos6522-stub.c b/hw/misc/mos6522-stub.c new file mode 100644 index 00000000000..85eb0ee36ee --- /dev/null +++ b/hw/misc/mos6522-stub.c @@ -0,0 +1,16 @@ +/* + * QEMU MOS6522 VIA stubs + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/monitor.h" +#include "monitor/hmp.h" + +void hmp_info_via(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "MOS6522 VIA is not available in this QEMU\n"); +} diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 74c741f80e2..463038c302a 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -885,7 +885,6 @@ SRST Show intel SGX information. ERST =20 -#if defined(CONFIG_MOS6522) { .name =3D "via", .args_type =3D "", @@ -893,7 +892,6 @@ ERST .help =3D "show guest mos6522 VIA devices", .cmd =3D hmp_info_via, }, -#endif =20 SRST ``info via`` diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 245ab9b98cc..d7e97a4a32f 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -20,6 +20,7 @@ system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('arm= v7m_ras.c')) =20 # Mac devices system_ss.add(when: 'CONFIG_MOS6522', if_true: files('mos6522.c')) +stub_ss.add(files('mos6522-stub.c')) system_ss.add(when: 'CONFIG_DJMEMC', if_true: files('djmemc.c')) system_ss.add(when: 'CONFIG_IOSB', if_true: files('iosb.c')) =20 --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277364; cv=none; d=zohomail.com; s=zohoarc; b=HfNJRwZ7UHXbxRsPaSvFzqqV6zZFLNDYNsEDg+UY4y4o91TS1EqUI0e1313GOe86CUcMNgllIOoKK4VlOpsamtqMX7RhgBtcpIRkeHF6oDmohgCOGebsR7EYQeks9R6+/ZgfBGmsTACMuE/IoXY0yZwsa/XeYoL2xY9epBROjMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277364; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=+E+v9dwQEh1rdTkmhs/D+nnUCn7aDH8mDMozjNzzNdU=; b=TQj9Sdy7kRNzg1uP4zuaPvxCr7WaxXPGX+t8VxoF+6P3z6eUKAIqaSxHvvOg/x2lDFqBZpaKuf/HEdq62GmU/0M0Df4/PX5zQsc242nBbdHJFSSDgMNMks2C+i2G/CP4C36ePcGv9olWjBpONWvhysf4Q46LsZGPLroZo1KXGWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277364846923.5103620666393; Mon, 27 Apr 2026 01:09:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1l-0001IT-6T; Mon, 27 Apr 2026 04:09:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1L-0000wQ-4v for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:50 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1I-0001hA-VU for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:46 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso91137935e9.3 for ; Mon, 27 Apr 2026 01:08:44 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-489201cde98sm532876675e9.7.2026.04.27.01.08.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277323; x=1777882123; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+E+v9dwQEh1rdTkmhs/D+nnUCn7aDH8mDMozjNzzNdU=; b=nc35tCBeHr5oqD4SnbxRNFaW+/u4Jyzh6+y0Q8XUDMA9pMFtHmrfw++czLRuWLzM4C aQzSt4jkg9ApuQjJUErg8kPLGPwGr1ABgtrfxKDfdRGpT2t3zcZTLXG4Zx5GoRpo4oC2 Cm7PRV0h68XgU7hw7BPlGSyNZtaHBEE4oiodjYbxd9DJLnnrl20AmDbc4586b6IQM59G iUwB3Lel0Tfkd6i/SZZZ+QqKacTUogPw7SVSNKIzqGucx3H5FqJ6D9LD8p725JwG6ugS 1bTn5frdg1IYTqqA91oOtv5nHuCwj3XI8cdVWbMvqG5CmUI4wJRlx0wgxDQrWrUCfss0 Ilng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277323; x=1777882123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+E+v9dwQEh1rdTkmhs/D+nnUCn7aDH8mDMozjNzzNdU=; b=QWe4YPvqoLEO3SUVOtYRME0/cmcUo5ZVeOUCJGx2gwCSOxGgxMo65dqq8/wR5i2yuE dQJdcZlEfddyaiRkSivBO13L1064eIhA48eGhKMatdttEtany236A/7/GPe15v0FTpJm smCR3hMlp4PNRTKjacghXCtFr7f4HStn1k0Jiewh20DmmfmeQfEj0pCswUmwvgQtuZlp Nm5n8GnDoCY5DZ8ZLDl8kPf2IA4qzrjmQXcE3zihcchnOmA19Vtkm/az3kM1uW9yEWFu gnYcnhx8Kr6L9bxrMbJxO2BgVHpfPlOxPOFyPL+5nD6f4GYmm4Jw8AL6KGX6LepCGf3n zIPg== X-Forwarded-Encrypted: i=1; AFNElJ+0F5JlrVITv+yO6eV0BDLwFZLa3FCk3H3xWgqhfzk3lUuIVgoLo/M23AL4AU0J1SFTXLMOlHSQpFVE@nongnu.org X-Gm-Message-State: AOJu0YwC+aj4Hxu1b61JjCIUHfBzFQOfus0H5WrCm0c/Ls2lCcWi/vxE a+K1IzHfZ9b2/MUvToBkfBNOmsVgA+IN7p02XqaWhRxgV4fiCVNEx8RU+FcbaJCiXvtadkZp3Cs 3iRMagiA= X-Gm-Gg: AeBDievAdnqW4NoAZ5UC1tqWHv0vQXKwdgwB3mssJEQOmxfnfACjxtqFQLrFBCvMFbA oa3ybjphKtpUxQQKzuXCCYgH4I3PSbCtrRlpjVXs5DbWg6wEWO3m+5w8VGg2cdQ3tCzXlp743wh RbaeOfFqAXXCokVfarmyo4DgDlRh0qi2NgAG0BBjuMWPcbw4ijdhrJTQjXPMkXBwnH4UMD5g01y L5oVCM2oTTv8GYXadfTLTBTE4fOwbHYSymHO/cQqoWgumA+T8Q05Rp+SoHMvWKJOK7GLTcK+mGY WzLSBxUPcWBCa9xvGVEhjHn8mX6Paizi/EeZQhPh+Ptt8Quoi7bQFN0j++hb+Ka44L2HhhJ/JG4 c6sV+7kx/DgferOou0G124sq9TrYwwa2nxKM2cAAlPB7WW2AVcLDT2Lax4fZiPPkAGllfHTdx2b oT3P9JiUjMAuZN+QVnzzugqkZ+fufhd8FbubAyikH225L14heVweaRE5UmIAHW84UFcvsfoQd6X xMBFtSJK54= X-Received: by 2002:a05:600c:8592:b0:485:3ec6:e634 with SMTP id 5b1f17b1804b1-488fb779acbmr423717295e9.15.1777277323158; Mon, 27 Apr 2026 01:08:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 09/32] monitor: Make Xen emulation commands generic ones Date: Mon, 27 Apr 2026 10:07:15 +0200 Message-ID: <20260427080738.77138-10-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277366064158501 In order to build hmp-commands.hx once we need to stop using device target-specific check. Use the generic pattern to make the command available on all targets, providing a stub with kind error message when the feature is not available. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Woodhouse Reviewed-by: Richard Henderson --- hw/i386/kvm/xen-stubs.c | 12 ++++++++++++ hmp-commands.hx | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvm/xen-stubs.c b/hw/i386/kvm/xen-stubs.c index ce73119ee7a..bf6ac28bef4 100644 --- a/hw/i386/kvm/xen-stubs.c +++ b/hw/i386/kvm/xen-stubs.c @@ -12,6 +12,8 @@ #include "qemu/osdep.h" =20 #include "qapi/error.h" +#include "monitor/monitor.h" +#include "monitor/hmp.h" =20 #include "xen_evtchn.h" #include "xen_primary_console.h" @@ -37,3 +39,13 @@ void xen_primary_console_create(void) void xen_primary_console_set_be_port(uint16_t port) { } + +void hmp_xen_event_list(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "XEN emulation is not available in this QEMU\n"); +} + +void hmp_xen_event_inject(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "XEN emulation is not available in this QEMU\n"); +} diff --git a/hmp-commands.hx b/hmp-commands.hx index 5cc4788f12d..06d7b17bf25 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1839,7 +1839,6 @@ SRST ERST #endif =20 -#if defined(CONFIG_XEN_EMU) { .name =3D "xen-event-inject", .args_type =3D "port:i", @@ -1866,4 +1865,3 @@ SRST ``xen-event-list`` List event channels in the guest ERST -#endif --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277382; cv=none; d=zohomail.com; s=zohoarc; b=RHQbcalEokE+ysg5DWYjj86tpmdHTF9l3bA+IopLd0o/81tLl+UaMkEyHiMuSEnNttedyCZQBqQoorjq8lfxEwxZb7dMB9d+kN9vpBBqRySY+EcoHvkIUeGecTJlv8cXni5W67hHQUHLIJC8WlQBmlgR+7m3RqgKVQw7CmKNqhw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277382; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=+vMpMZoQNH3QhHcy99pn2A7JWOU5LwkPJbVb9DyM3Wk=; b=hB6NW1JG59urvOVTITboiO2BtUzFnGkIfJsicHU9Ea/cQ1fPlT04E9vMRg6NeY/XgebVzlJwkrSmqlyGU9OsycSUF7ZHcXgBYcouI//z2gVRFENatm3ZmuvJrxK/Y042MNEHLWi1plGHetKjS1wT2y6IPEVjO/TsQB7uM2ScifQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177727738260921.191965218136943; Mon, 27 Apr 2026 01:09:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1x-0001Y8-Jn; Mon, 27 Apr 2026 04:09:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1R-00014i-BC for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:54 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1P-0001ic-MJ for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:08:53 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-48334ee0aeaso103266475e9.1 for ; Mon, 27 Apr 2026 01:08:51 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7aa593sm245860535e9.24.2026.04.27.01.08.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277330; x=1777882130; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+vMpMZoQNH3QhHcy99pn2A7JWOU5LwkPJbVb9DyM3Wk=; b=H+xm4MGq3+ZAnjXtr4MP7YSJKCpO/YVvvB6GC/hj3wcMYJz5fqjRRPaDTLPBd1Y7oK DwlMSz/Vzh8JhKnoIzVcGMU9aerAVyEy98mFZjZGsXaHgkzJgLwu78DwBuwW7at48KQH 3TKa/bB0tMq6trbVrWEfy2YGnFtZ5ACZn+lWp4fwVG6r1wsZbdTLYzi2xqAikpr3Ga7G VeSbwsLyr1k52OoELtRTRyMhMx+SYOVMIxAoc2sHZrAnSoQOGqLF5gxBVmXgkJ9GOa8r 1M0ZdJ1uJsksRiu3CnHnCDi0BrbWkr3Zz44pqIaFkO6b0nkgGT6ohqLgynzP0ZstfhYa lHrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277330; x=1777882130; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+vMpMZoQNH3QhHcy99pn2A7JWOU5LwkPJbVb9DyM3Wk=; b=oW350WGRq3FiGQha0i4UAStessG94e5cydp006ibGR6NPtpnS9keTR6iFzDKbn5jEn J3vuZRt1Qb6JVsSJd2oQxOnxwQ76uO1l/CIg/H61cuYxPwRuVU6lC3dQQlyFHsEKjO0w hqX99ihjhXuNSRf4cmh+Tq0iXL+LV15LOeHzdrX9PWCnCaleC5SX8CdxAmW1MwYsVKzH doNXUnQK5ASk6A9OruWkvNaLAwNUGHZkbzCw4JO2n6dnqfX8dMhqMjjHNtfIDGFPWCTm 9huNQjMQlhl6cFMnyrS89gGwtrsBwO2Cufgw8v+6x/M1Bjh/9HE5UtafCp5HvMxWesAo EFxg== X-Forwarded-Encrypted: i=1; AFNElJ9cTMLZQ5ZNjnevsJ2Wi76cKKZl/IEvMQA8V7fNLCRaulTALOhHItEcPHkyBF/Qctow4j4dXSUtIaNp@nongnu.org X-Gm-Message-State: AOJu0YzZubYnBZRlH05QHHtNlm2AyvorvKhATWxhuQ0VkWZnZvjNhbiy Tt7P0sugnpBmEhv/GCjLJtOLaMNAqgR1gIr0mrw11nYgGWeeXxT5jFIiky3eKwo2L7EKroAlobn ZUOOKV00= X-Gm-Gg: AeBDieumFQ2oUWY4kTYCc08cFpTkP+fpv993bxBnl1TRo0K659OTXaRC6Cs3SlrBqie HnuAhDTGpDZGaLHkhhSWsrTvbxPqxD7qcUGGEA++4K53CF2ciB4Pmiuo36fILtOLRS51NLySPn+ LMFEM3ROnvqe84iz3PZZfA0N7XAX3y2NivsLJqlaRPvp0k9+NS33MjPe3FA+L6+BuitUbKeztrs 59dflpju3aAKVJ39tR9sBg9Ag1YWMS2bwcqyeFMHQo2lobdFMl27vlkmS5qWFv9s9H+/jAgYD5n RGzVit85woAJQ5a1pNjsErRlzLJKQK5wEzZzgZoIQWn6wVOtMkNOSqLFox3KvUDP0h2qGmIZpxc X48JfWh5MFPc1O0U4Xzrmm0t+6YZx3pnBAIOOmYyXk7koM8qBRUg0EstAZLGTshRXo+OXo3SnL+ dibBtYRIvnux8hf2pLNkCjTx8Qp4IOLrp8+ZCWdTqAijXnMuDt/VC08P1hYvqKsNTNaJY0FcOb0 JgMjlKMl2gX3tQzy/Zo/Q== X-Received: by 2002:a05:600c:1e09:b0:489:1f6b:6276 with SMTP id 5b1f17b1804b1-4891f6b6464mr432715975e9.15.1777277330033; Mon, 27 Apr 2026 01:08:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 10/32] system: Expose 'arch_init.h' as 'qemu/base-arch-defs.h' Date: Mon, 27 Apr 2026 10:07:16 +0200 Message-ID: <20260427080738.77138-11-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277385500154100 We already have a file unit outside of the local system' folder which include "system/arch_init.h". We want more files to use it, so make it official it is a generic header by moving it under include. Rename as "qemu/base-arch-defs.h" which is more descriptive. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- system/arch_init.h =3D> include/qemu/base-arch-defs.h | 10 ++++++++-- hw/pci/pci.c | 2 +- system/arch_init.c | 2 +- system/qdev-monitor.c | 2 +- system/vl.c | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) rename system/arch_init.h =3D> include/qemu/base-arch-defs.h (92%) diff --git a/system/arch_init.h b/include/qemu/base-arch-defs.h similarity index 92% rename from system/arch_init.h rename to include/qemu/base-arch-defs.h index 0c2b1f3a5d0..f33465738c9 100644 --- a/system/arch_init.h +++ b/include/qemu/base-arch-defs.h @@ -1,5 +1,11 @@ -#ifndef QEMU_ARCH_INIT_H -#define QEMU_ARCH_INIT_H +/* + * QEMU base architecture bit definitions + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_BASE_ARCH_DEFS_H +#define QEMU_BASE_ARCH_DEFS_H =20 #include "qapi/qapi-types-machine.h" =20 diff --git a/hw/pci/pci.c b/hw/pci/pci.c index a0dbb81fd90..4298adf5a0a 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -36,7 +36,7 @@ #include "migration/qemu-file-types.h" #include "migration/vmstate.h" #include "net/net.h" -#include "system/arch_init.h" +#include "qemu/base-arch-defs.h" #include "system/numa.h" #include "system/runstate.h" #include "system/system.h" diff --git a/system/arch_init.c b/system/arch_init.c index 604d5909ed0..1ad2f3d6f78 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -22,7 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include "system/arch_init.h" +#include "qemu/base-arch-defs.h" #include "qemu/bitops.h" #include "qemu/target-info-qapi.h" =20 diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 2ed95e83602..2e9dbb9b5c2 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -23,7 +23,7 @@ #include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "monitor/qdev.h" -#include "system/arch_init.h" +#include "qemu/base-arch-defs.h" #include "system/runstate.h" #include "qapi/error.h" #include "qapi/qapi-commands-qdev.h" diff --git a/system/vl.c b/system/vl.c index 0e1fc217b4f..c89fe8378c5 100644 --- a/system/vl.c +++ b/system/vl.c @@ -112,7 +112,7 @@ #include "trace/control.h" #include "qemu/plugin.h" #include "qemu/queue.h" -#include "system/arch_init.h" +#include "qemu/base-arch-defs.h" #include "system/confidential-guest-support.h" =20 #include "ui/qemu-spice.h" --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277397; cv=none; d=zohomail.com; s=zohoarc; b=RoTu/x19IhF0dXzuy+yAb9ssrn+WqzKGV7E4FdAxcOVhvEkuPuyCn6fnVJ64JW5QGsi5cz3WwXhA3w/dlnz3W5uuovvK6DsvDYXo3eUPecINdGZ1e1RVQ8hdQsZ82EDnUWJJHJC4V2T6HZuSfYG482eP2bjJYjGe6PbtKfFmu0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277397; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=1bo5Y+UZCJy4gHCz2x1tdhwNQXL4/DMiX/PocQwagYM=; b=LXpfvqKQAhTHdLY40wAJm59Mv7kw5PVC/OXhBOFrIiBtOp9HXCyX5QcvpsUIYopxIHteEz07aeU0bL8aOq2osR52bL2Zaxj7lPYpob6a90Ica8uE51A1FZfwEw/5rgWMQV6c58byZyMBN35fZGnxK85SJ2HVfyoiheMY93EX6cs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277397331952.543073492164; Mon, 27 Apr 2026 01:09:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH20-0001rd-Ln; Mon, 27 Apr 2026 04:09:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1e-0001GK-Sx for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:10 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1c-0001pO-2R for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:05 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488ff90d6c7so84331895e9.2 for ; Mon, 27 Apr 2026 01:09:01 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc1c773fsm858727835e9.12.2026.04.27.01.08.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277340; x=1777882140; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1bo5Y+UZCJy4gHCz2x1tdhwNQXL4/DMiX/PocQwagYM=; b=uIoHhn+VBCk5qT2LA4uhOEj2ZzjKNT2LxZnXoTuDMsMrnSGagsM8eFwdOxKeS+bgEI vMS5yCRJK3e+Uz5whDqXaroWFS8HQpuHojO43z5BgZrrMkyUHqIUqZhi9srwaoSaegN9 foLBdX8C1An7z1DVTrChygeCQilz3PSsR0GsFYhMZHOQVmfjEdR6NPZo3B1JDobBv72j NDEqItw3aMI12mchfJqNxtT7pVev9CLHpgPYXBc5y/Wz27o9KXffEWTIR25EW2MaOe3v hOghjIS/KthyZn57uDgU9oBnpjMFXVVYpPy+UgZqVrsg91R7SrH06CJ4T2Hq9Kd5hwxX ABqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277340; x=1777882140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1bo5Y+UZCJy4gHCz2x1tdhwNQXL4/DMiX/PocQwagYM=; b=WLC4IhtkO/J92YLLK/h0mxeCH9yOy45Az0ncdfCSBPjQej29QBb2CxzNN8bDjglZ0h 5hlWwCNcx6agNApIw3UAKFpyJtrfbNy+7kMhtkYMN42mI9exxjPYSjgPNpEQr6TD0Sl9 9egXnHrCwoGjZ5atxtuxO17iA0cW7J4Xm0Z3s8kFdDN/75kK+oTXIJeqMpwnYHgamqV1 uBafYemDInicea/Aj91IhXYhBtN2C7jSDTm/vG/eJrjxBSdB3yYAKuBVIqpLQEyLP1w8 9jzfkl+FWxl4J8MiI9QygjJi0qXYt4uK9C3QISR2s/nCGDoXZ60mG/A/L17GtgDzN1pF xJJg== X-Forwarded-Encrypted: i=1; AFNElJ+gV7zejVF4rEViZGWPF+ciL+7FaXuB8l0BPTsYwU1t3pQr3ZEnvAReBBkGO2WaHmT2d83IiBAmrzGN@nongnu.org X-Gm-Message-State: AOJu0YxbSxHl4romJgGA1KnN0cS32KWcvw9GLElBSFoq3DV61E2YYXeB nmFla59MksTlFc0s6n7XcTaEw/cjIiFe7RMbWfWc3VMpwSXuQ/M7Im7E/WsDHBDK9lQ= X-Gm-Gg: AeBDieu00ex0obK65Igulj55ep55Tc7g7HhGTo7GjwkvakxhAyRjhKziYSKRKb+Dxy6 nLzhbOvc7twW+OFsKrdW9KgylIYdDIP8nWafnapM3UYwzidwtvno47VOV9b72kkF0Jmxf//T1Hc wUlLV268UutULnnvi+0pyX7FftKwU0TOQONPRCVJhCOgfkSkGYZHVnxB+l+9Xolaff/5q7j7KL6 hseYMJwfi9ioFXoX+wjDV5tavNL4dVv3fbroJ4j9YcewGtBcGynTqxSxkYau8D8ROf0PNDcBBZ4 iBiaTUfFJDIjrMTMNI36YXKA+JgwzcvOJ/7LQhVMvsgaREqE2E5hcTdjMmK6bftQRKJQFIl/ksO ZPuLrv/wiKY9rPecNLkyvX1kzJaWAdE2fhT1NqNFy1h99F3spNr3n2HjKLBAbo59SJbnfbdt8AH q+qSBB8F7TQH5WY18bkVDY0TAnGqCVB3zfxefL1JaKG2/q5zspapFGbQ03gadQu2eI+kff+V1YU J0aob62XTU= X-Received: by 2002:a05:600c:46cb:b0:488:ac01:72de with SMTP id 5b1f17b1804b1-488fb7451e4mr611543445e9.5.1777277336726; Mon, 27 Apr 2026 01:08:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 11/32] monitor: Introduce HMPCommand::arch_bitmask field Date: Mon, 27 Apr 2026 10:07:17 +0200 Message-ID: <20260427080738.77138-12-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277398120158500 Add the @arch_bitmask field to the HMPCommand structure, allowing to restrict a command to a set of target architectures (represented by the QEMU_ARCH_* enum constants). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- monitor/monitor-internal.h | 11 ++++++++++- monitor/hmp-target.c | 1 + monitor/hmp.c | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 80b4a8150bf..eaf9a607783 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -82,7 +82,6 @@ typedef struct HMPCommand { * the formatted text. */ HumanReadableText *(*cmd_info_hrt)(Error **errp); - bool coroutine; /* * @sub_table is a list of 2nd level of commands. If it does not exist, * cmd should be used. If it exists, sub_table[?].cmd should be @@ -90,6 +89,16 @@ typedef struct HMPCommand { */ struct HMPCommand *sub_table; void (*command_completion)(ReadLineState *rs, int nb_args, const char = *str); + + /* Keep non-pointer data at the end to minimize holes. */ + + /** + * @arch_bitmask: bitmask of QEMU_ARCH_* constants + * Allow to restrict the command for a particular set of + * target architectures. + */ + uint32_t arch_bitmask; + bool coroutine; } HMPCommand; =20 struct Monitor { diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index da7dd7f31f2..f6dce326cf5 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/base-arch-defs.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" diff --git a/monitor/hmp.c b/monitor/hmp.c index 0e5913fabb1..e881c26c305 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -36,6 +36,7 @@ #include "qemu/cutils.h" #include "qemu/log.h" #include "qemu/option.h" +#include "qemu/base-arch-defs.h" #include "qemu/target-info.h" #include "qemu/units.h" #include "exec/gdbstub.h" @@ -219,6 +220,9 @@ static bool cmd_can_preconfig(const HMPCommand *cmd) =20 static bool cmd_available(const HMPCommand *cmd) { + if (cmd->arch_bitmask && !qemu_arch_available(cmd->arch_bitmask)) { + return false; + } return phase_check(PHASE_MACHINE_READY) || cmd_can_preconfig(cmd); } =20 --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277411; cv=none; d=zohomail.com; s=zohoarc; b=aETKPHtkOkNsLRkw2ICk9Ro47RGCfBwww4KuMMYkgStVgOVMprVklFJFzu6R8Aqt6iSays0aNCavcD3n06lR7Tksx0LvPM+9LX/MSbAkDQRueyMVwUThrir10rMbol1InOUZ+cC1SY5IbmpLx7PcJiRl7QdD4pBtgSzq7o7DtU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277411; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=vj1VCyGpmEVZZgVNhKzGcdjLaf+nPbuu+8SZqhBUOlE=; b=NR0NXOlqDoGLh4e2rF7eiNGXQfTHmTBPYVH+J+dFaIVQEi0ehBuLina/pj/UBKp+VYbnk9EoHphwFuuDo17MBOgtrYyA4kocnGHPbv+lSvJHz8oC90+sifLGHEWD/SkN6dz0IWvOhOk3cUmCLE3ZVlTy/sia7b5oda52C8LYnUU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177727741161364.17874514383311; Mon, 27 Apr 2026 01:10:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1x-0001Wb-55; Mon, 27 Apr 2026 04:09:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1h-0001J1-SU for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:10 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1e-0001qL-L8 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:09 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-43eb012ac4fso5952818f8f.0 for ; Mon, 27 Apr 2026 01:09:04 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4cc09b1sm79693042f8f.9.2026.04.27.01.09.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277344; x=1777882144; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vj1VCyGpmEVZZgVNhKzGcdjLaf+nPbuu+8SZqhBUOlE=; b=egeU0eVQCadUmdEanMQFm3vXfE2gdLqQ6np2ddcTYBt2S89TGn5Myj8dkDXCfftWbv ZhwKmGsKCu1KMwciqZXXES8VZzk4X/N/O50f872Xil/wDabn/WI/he+vuMzgFzBpEU7C gRy89XfjUPsMIISWbKmiUhSkLTBU63h1o2qQgM65MIFgYECSiihjMnSCY3ysZgveFqXO /QTkcPzeSYb2MR4L6MyExMsRqF+bQI5IYJYh9mG9E8PZVkptGp4mqJHul4B3bFYt/hYP bihsJsAp85THWlBOsoZ6aWZlO3vEuP8PZa+8UNc5fFwMNq2bzM7wPHymhgsB1++OouOI Qb2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277344; x=1777882144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=vj1VCyGpmEVZZgVNhKzGcdjLaf+nPbuu+8SZqhBUOlE=; b=baVHUOqebuSJrBVCjA2K443qGRvFVxpfPWkzJRcVAR1JCmHkn230Tm0FdgD4JxMPq4 fIlLwcw39SV7Pwmac7m5USjcBQnRj9H/mrqtH40cyiS4HvQSAq+ZE05Xo7I0nCXgRKYE oPXDS399GrORBCmF7qS26TdMKgl/fhikpFdSM4eCX2dUlYkkroWNArffup0R9SRNCp/W jXQzSbwVYd50wcAMdmqLy73CTKZXe8EVtQIFjrLS+OlM1dbd79ej/JDmAd3muoeXkvvj Z2gnDQa8oGPfybZghny+394bVGnOLDp4OiyHzxDVdcC4jAnTd/t7eRfreJMzQd4XTffR Ze9A== X-Forwarded-Encrypted: i=1; AFNElJ/KOgfurPILpMSj2SEALR7pex/ZCBP9fgEpySzfYuHcKMzANvl6vwJC8ZBo0jOjxZbLx3Ou/Xzr2IvT@nongnu.org X-Gm-Message-State: AOJu0YzsAGPeOwigtCx8TPU9gLSUyDpdPK5H8zFK0sm/Q1QEojIH/XFt 61v9tYgNl4UjXfjnao+VxOY6R6R0iAMHQsFnTqVFe69ZEouljoJgflsT8XrZ5CKfGwW38FFX72c 5nMzQQpg= X-Gm-Gg: AeBDievVyF5PnQfR+ytyBEPT+7oSzKR1CeQSQ2RsUEb3K+aO22GG27vFDv2ZRtGV3yB 7BX5j2LQslOf66ALdzM3Blq4nZLwPqOOi3jNHjj0W6aQOoLp2ziflI3ovHSG886gLtWi2+hhRH8 ICcyxiyWy19p5KaHXdUHBzLZ4pIYciWcIhfRttQntw1NU+BN5i5LnoHrmrlFXAypUD6ILvWVyhw YlpbmnpbwRGBiGPTcmN38vSWlI9eoz3bEc5R1exU+/fIxfKqw7YZV4FD7URiYWLh5YxJzmpGrUz BDZ6yn8764N/+EhiRJGi6Str5OwDCbUCUvSJDvJ6ryxEbWbAzcgMAlWlg2G6PCkpyxiATaMsPeM eX9w4gXSFHNLkDv3TW0fL0Ky6swKE8TPALgOymhmbzgGXPpBRI0V0rfFJUSc274o2coxTBcaUMg c76Dt2dNp+/f5suAdP24PPR7Qo5cvD+Mhuso6aHkLQ7YtJcHT6WxLZcQ4fJKMWl1UShJXTZ0o85 n1w/XYy5+I= X-Received: by 2002:a05:6000:184d:b0:43d:e31:68d1 with SMTP id ffacd0b85a97d-43fe3dd958amr64858841f8f.21.1777277343559; Mon, 27 Apr 2026 01:09:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 12/32] hw/s390x: Reduce 'monitor/monitor.h' inclusions Date: Mon, 27 Apr 2026 10:07:18 +0200 Message-ID: <20260427080738.77138-13-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277412212158500 We want to make the HMP commands available for all targets, move the declarations to "monitor/hmp.h" where all other are, and only include the monitor headers in the source files. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Cornelia Huck Reviewed-by: Eric Farman --- include/hw/s390x/storage-attributes.h | 4 ---- include/hw/s390x/storage-keys.h | 3 --- include/monitor/hmp.h | 5 +++++ hw/s390x/s390-skeys.c | 2 ++ hw/s390x/s390-stattrib.c | 2 ++ 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/stora= ge-attributes.h index 66716a97c05..0305873b019 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -13,7 +13,6 @@ #define S390_STORAGE_ATTRIBUTES_H =20 #include "hw/core/qdev.h" -#include "monitor/monitor.h" #include "qom/object.h" =20 #define TYPE_S390_STATTRIB "s390-storage_attributes" @@ -72,7 +71,4 @@ static inline Object *kvm_s390_stattrib_create(void) } #endif =20 -void hmp_info_cmma(Monitor *mon, const QDict *qdict); -void hmp_migrationmode(Monitor *mon, const QDict *qdict); - #endif /* S390_STORAGE_ATTRIBUTES_H */ diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-key= s.h index 2d02936c31c..666c05e2996 100644 --- a/include/hw/s390x/storage-keys.h +++ b/include/hw/s390x/storage-keys.h @@ -13,7 +13,6 @@ #define S390_STORAGE_KEYS_H =20 #include "hw/core/qdev.h" -#include "monitor/monitor.h" #include "qom/object.h" =20 #define TYPE_S390_SKEYS "s390-skeys" @@ -123,8 +122,6 @@ int s390_skeys_set(S390SKeysState *ks, uint64_t start_g= fn, S390SKeysState *s390_get_skeys_device(void); =20 void s390_qmp_dump_skeys(const char *filename, Error **errp); -void hmp_dump_skeys(Monitor *mon, const QDict *qdict); -void hmp_info_skeys(Monitor *mon, const QDict *qdict); =20 #define TYPE_DUMP_SKEYS_INTERFACE "dump-skeys-interface" =20 diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 9c2330205fc..d694bfdf768 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -173,4 +173,9 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict); void hmp_gpa2hva(Monitor *mon, const QDict *qdict); void hmp_gpa2hpa(Monitor *mon, const QDict *qdict); =20 +void hmp_dump_skeys(Monitor *mon, const QDict *qdict); +void hmp_info_skeys(Monitor *mon, const QDict *qdict); +void hmp_info_cmma(Monitor *mon, const QDict *qdict); +void hmp_migrationmode(Monitor *mon, const QDict *qdict); + #endif diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index d974d97b5e7..7dca67d6618 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -24,6 +24,8 @@ #include "system/kvm.h" #include "migration/qemu-file-types.h" #include "migration/register.h" +#include "monitor/hmp.h" +#include "monitor/monitor.h" #include "trace.h" =20 #define S390_SKEYS_BUFFER_SIZE (128 * KiB) /* Room for 128k storage keys = */ diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index 2e83aa211cd..74b23b0a995 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -15,6 +15,8 @@ #include "system/ram_addr.h" #include "migration/qemu-file.h" #include "migration/register.h" +#include "monitor/hmp.h" +#include "monitor/monitor.h" #include "hw/core/qdev-properties.h" #include "hw/s390x/storage-attributes.h" #include "qemu/error-report.h" --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277390; cv=none; d=zohomail.com; s=zohoarc; b=mRHxVy8AEyylmRFxHQZl+W1lKKU4HWIwFp1tV4wTvnWBgcHt7kNw+/AbdXJ2/pN6mo3pN10JbkPpvyBOTvwxpiZ0OOFQ0Xq0+O8QX7tudB7H6dAspUFrbo9zg7fsnOkKqrtvvU+GmroW4EFH2Yk1g9G3KWS0dxHQyhq7h9AI108= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277390; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0N5garPfkGQjAeUEzsjLtjevClXnBOjQBVGcUSmAQTU=; b=FypuPBTA3o68pk5+0IonQO0wk3HjPu9DdP28H8X6h6zAqz9QvywMZJO+/H9y5mZUXo6Y50z7rlgzo9B9iJjR1LYKjWoMibnCR9ogCsrqdzPmB9kXmVW5E8ME1DG6JhrRc23sVKmc5mSjdfuIN6DDqaUzeRv4WTRKgpUBSRXcjvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277390431918.1753854103886; Mon, 27 Apr 2026 01:09:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1y-0001ie-Sk; Mon, 27 Apr 2026 04:09:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1o-0001O2-22 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:20 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1l-0001vJ-P8 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:15 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-48a3e9862f0so52116325e9.1 for ; Mon, 27 Apr 2026 01:09:12 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4899dc95920sm167976405e9.6.2026.04.27.01.09.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277351; x=1777882151; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0N5garPfkGQjAeUEzsjLtjevClXnBOjQBVGcUSmAQTU=; b=hUt31tiRtYBDDfMeg/P7McYqmi84LYz2qin14TvGwE+MbxvCUvpVAwqYAYNI66XDS7 sVGJap+KbPFxbUJBuDjkAEByEP6n0H4z47CVlHEBEVHHCBRf4sF5hyKSfp+5eMQYZ4oE 7kCxf39L7KF8iJ+TWsGy18ocyWgMS4Xkk+2UOh6Ct+4yOCrAlKEd+pk4MH+ceaoXPobl XPa8cB0xmzsFAzsC9MWpvZZMZhq7W4L958NjbmZMaAEm/Quyx8zgQQo9qEAEiITQetSe kvGyIDkbM3i4quxDq0ZeFXfhc+mzCsAKXLqWU8QXf3R4l61NzI79ffugm5LrqwjqP7ii z4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277351; x=1777882151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0N5garPfkGQjAeUEzsjLtjevClXnBOjQBVGcUSmAQTU=; b=FtYCpxCEcB3AhRuNASVIxwWJrOcYhPKAilQjz/dNS8S3z35kfkzfEeea4NcvtpolFK KDwUdSr2mvTsdbwbFMlJj9rl/9Y+ePrkgnV7S/5a1mPJotwNDCzUlQrUCZgK4H50Etz3 ASLX3kmxjjIsXaV9trpQFFFtOPi4JFWbE3CPJgt9LJxewZj5598Zh4qoVYMmxcfsaaKS FzDLG1N3JbNIvUadm0kR21ZwCFjrCGH9sG/U/a+lm9P8SOVW21a/n3bTkuLmhM7vJ9Dh lqUcI1UUDekrzsSVLA8hwQW9YX+meEAz9QY1ji+X0xp4VnQKXGJGBRrGiasOII97TVAD Wdow== X-Forwarded-Encrypted: i=1; AFNElJ8jjDJh+ZM8EMFR2oI+EnTiwETWflqef8Cwy12C3TS2OD8ZDTHPecTcwZujfsR6XlnJBUAMx477VUuy@nongnu.org X-Gm-Message-State: AOJu0Yy1lMuySIkyDvcvuT7SCq0shuy8dVDCxBXpI8LRgb9Z77mblyCn cvJgkZmRR9m0OvErJVPPpdAGAuP4PbCIZ9SuBTJwwDXaUj5thCWKvFyVSg3wEtCFLR6xMIIeat9 LxbGUdAs= X-Gm-Gg: AeBDieuE9I/v9xCn4Li9qp+BDtGNvy4nRilOdP92WndJImUVAyiN8lysrZ3ZEW8xnrJ 7OoDy0fcN2z41pOXFqsSaqiXkMwzP4eCyRnbL0+k4Yidr6bv9yfdM/hlVK2PQZ8EflD0c1h9CP/ YozhRu4Nmku7gPVX04QEOpuqK5ypaxbJWqNrQ3Ek2vWEO6VNazKPUO/jBkIh0OPeeSx2PoasZfR N7KXZCyXzWyhhM8YBznz6ORtSYAR9mGOkc6OTvDQ+VqEF3RM3Vxo55LC4rKiVtCUcFlZVn70f/d mkzFcvjEkyaj3JGAp9/szKPbupVMgCNsirga9VkJCFMKXq7H0es98NVkZ5WDV2qr6hT+8//zx2z 0EnQEKXMkE/08JzuiVXigOOzj56PVa+pj0ZMqXds/03F1FE2ovT9m4z8wMQhMR95bBpqvfjUCuf bfaAwzk9LhquWDeMFz58gUMaeXPsaWZc5kzts0zOFehllwk1yyON40oEQmL1JffcZYG6yEMNxml Pzy3T3c3jE= X-Received: by 2002:a05:600c:3ba0:b0:486:faa8:9e4 with SMTP id 5b1f17b1804b1-488fb8b91a7mr543470445e9.12.1777277351292; Mon, 27 Apr 2026 01:09:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 13/32] monitor: Do not check TARGET_S390X to build s390x commands Date: Mon, 27 Apr 2026 10:07:19 +0200 Message-ID: <20260427080738.77138-14-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277391637154100 These commands are filtered at build-time for s390x binary. By using the recently introduced HMPCommand::arch_bitmask flag we can filter them at runtime, making it possible to compile hmp-commands[-info].hx files once. Since the methods are used unconditionally within hw/s390x/, define them in the same stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Cornelia Huck Reviewed-by: Eric Farman --- MAINTAINERS | 1 + include/monitor/hmp.h | 7 +++++++ monitor/hmp-target.c | 5 ----- stubs/hmp-cmds-hw-s390x.c | 15 +++++++++++++++ hmp-commands-info.hx | 6 ++---- hmp-commands.hx | 6 ++---- stubs/meson.build | 1 + 7 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 stubs/hmp-cmds-hw-s390x.c diff --git a/MAINTAINERS b/MAINTAINERS index 8ed6648d094..5583df5087f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -122,6 +122,7 @@ F: include/hw/watchdog/wdt_diag288.h F: pc-bios/s390-ccw/ F: pc-bios/s390-ccw.img F: stubs/qmp-cpu-s390x.c +F: stubs/hmp-cmds-hw-s390x.c F: target/s390x/ F: docs/system/target-s390x.rst F: docs/system/s390x/ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index d694bfdf768..a29185741b8 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -16,6 +16,13 @@ =20 #include "qemu/readline.h" #include "qapi/qapi-types-common.h" +#include "monitor/monitor.h" + +#define HMP_STUB(cmd) \ + void hmp_##cmd(Monitor *mon, const QDict *qdict) \ + { \ + g_assert_not_reached(); \ + } =20 bool hmp_handle_error(Monitor *mon, Error *err); void hmp_help_cmd(Monitor *mon, const char *name); diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index f6dce326cf5..a222fd4c96a 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -36,11 +36,6 @@ #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-machine.h" =20 -#if defined(TARGET_S390X) -#include "hw/s390x/storage-keys.h" -#include "hw/s390x/storage-attributes.h" -#endif - /* Make devices configuration available for use in hmp-commands*.hx templa= tes */ #include CONFIG_DEVICES =20 diff --git a/stubs/hmp-cmds-hw-s390x.c b/stubs/hmp-cmds-hw-s390x.c new file mode 100644 index 00000000000..2b4f4cac79f --- /dev/null +++ b/stubs/hmp-cmds-hw-s390x.c @@ -0,0 +1,15 @@ +/* + * Human Monitor hw/s390x stubs + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" + +HMP_STUB(dump_skeys) +HMP_STUB(info_cmma) +HMP_STUB(info_skeys) +HMP_STUB(migrationmode) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 463038c302a..28dec25642d 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -717,30 +717,28 @@ SRST Show rocker OF-DPA groups. ERST =20 -#if defined(TARGET_S390X) { .name =3D "skeys", .args_type =3D "addr:l", .params =3D "address", .help =3D "Display the value of a storage key", .cmd =3D hmp_info_skeys, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``info skeys`` *address* Display the value of a storage key (s390 only) ERST =20 -#if defined(TARGET_S390X) { .name =3D "cmma", .args_type =3D "addr:l,count:l?", .params =3D "address [count]", .help =3D "Display the values of the CMMA storage attributes= for a range of pages", .cmd =3D hmp_info_cmma, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``info cmma`` *address* diff --git a/hmp-commands.hx b/hmp-commands.hx index 06d7b17bf25..ff65b39b454 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1125,30 +1125,28 @@ SRST =20 ERST =20 -#if defined(TARGET_S390X) { .name =3D "dump-skeys", .args_type =3D "filename:F", .params =3D "", .help =3D "Save guest storage keys into file 'filename'.\n", .cmd =3D hmp_dump_skeys, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``dump-skeys`` *filename* Save guest storage keys to a file. ERST =20 -#if defined(TARGET_S390X) { .name =3D "migration_mode", .args_type =3D "mode:i", .params =3D "mode", .help =3D "Enables or disables migration mode\n", .cmd =3D hmp_migrationmode, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``migration_mode`` *mode* diff --git a/stubs/meson.build b/stubs/meson.build index af4051e6c5e..99a89c00066 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -87,6 +87,7 @@ if have_system stub_ss.add(files('qmp-cpu.c')) stub_ss.add(files('qmp-cpu-s390x.c')) stub_ss.add(files('qmp-cpu-s390x-kvm.c')) + stub_ss.add(files('hmp-cmds-hw-s390x.c')) endif =20 if have_system or have_user --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277373; cv=none; d=zohomail.com; s=zohoarc; b=Y0UWF34H8IOXU1LRdqWBzFVeyYkT3tQ8GJJ+w8otwV+OnvW6afpQQsrQR8lvLlOdP8CL5ftMNQ5UaV3OM1+i0B458EkTWK6+LDilkp5ofWbRomxxb+u0hzyVjm4L+SbxCTr/yEPhbkTzE9g49E9O9491ec6gpy3pyz2qDWXHIe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277373; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=O7UCdCKJ1c5qVGsxeGNM3DP4EYb+8E6FPBO3612XPg8=; b=NIT9/sp3i95WUU0+Jk9kc0AXkIw7GH3kHZrBNfJ+02kldcZoRVie5u9R1uporwEYsg4KhSIp/00IHZ8LqgsHSk12MjXNvABfRnTeTgAvZ6gSZblMKHVL9xWds1htU7rBLp2+A3sRJWnDczdDgJ5UoalhE5Ai0vnxU03YpryxHy8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277373713572.8297413282672; Mon, 27 Apr 2026 01:09:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1z-0001lr-91; Mon, 27 Apr 2026 04:09:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1t-0001QQ-NX for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:22 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1s-0001zJ-1b for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:21 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-48a563e4ef7so65805275e9.0 for ; Mon, 27 Apr 2026 01:09:19 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc10019bsm797040345e9.4.2026.04.27.01.09.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277358; x=1777882158; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=O7UCdCKJ1c5qVGsxeGNM3DP4EYb+8E6FPBO3612XPg8=; b=k2fx1BVd0JdohBqCRPX/OnkgLDcJQ8HagO8csgISU4zGlGPp69MdSNs45LO9i1oLdg ebL9IbwrO9Qy1IJQ6aP38HnSCqaOyxfc5klpb+5kcXmWXnDPKZOYGw0Fxnt4E8vE6FkS NM3HJCXmYI1pDHbtsEhK9toBgvYE+o7d6lDU84Uq+IhUIOZg5N6KxmrC2XkNE+0SV/+z ygkfXP+EKmYXkvK7rVyg8GCs5CZo2PGLJIkkYoZLsHvZfOu+Wb8SL+a2E5gH/ahMt7hD BGgPJ69utj7Ohl3cQ5lY1T2CJL0i3l5kmWTWC5Yg92pJdOezsa4po+EtLnNy0pGBhyqj u9qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277358; x=1777882158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=O7UCdCKJ1c5qVGsxeGNM3DP4EYb+8E6FPBO3612XPg8=; b=UnDvN9VcluiVgeT2r/tdjdxfKpCVwPZoE3b3ZwoUJzdkobPPFE9zbp1bw2/kRPCZB4 bZBsw0ohz7X8kq6fqzq/G6oCJxaWp4C0OmJLwEU8WggExAZBHW8r2JdG5e/Zhg216O4w o9DFLXsOBWvBeLf3QskhetiFxuI47CN0RhvUhRGv3n8RQgUQTNko4Ysb1co4S+3TQAj9 M69mgCxWVb+nKoPk7M+a/2M+Lft+mEEcFVeXjHVC3IByKNy2a07gbDF2cF8bxAKAvr1V q5mhbp1WEHsPRQfGKG1rRwZd/9XT9zhzctKRqsiE2VBzgODqF+PScetKbWX3ryYcvty8 46OA== X-Forwarded-Encrypted: i=1; AFNElJ/jxQs9ame+Nqjgp9eK2JeqnnZOVHlfKjDRnunwcxZTJuL/wG/LoljXhHGNHmP3u+dpIf7wZzXlbeGD@nongnu.org X-Gm-Message-State: AOJu0Yy3dD5JyO8KCGy2sUZ4siJtu8u6zuDcRoOeQOmtFbPgZrssnRV/ ZgOcxfhcFa5NYMC8gdqJA70IR+nS52RwuPqod07i9LvFOVARFXffSN+939yXzQEmOJk= X-Gm-Gg: AeBDiestYr3lEBZccVtYzHLRn3luEYEsjwEC8jFR5FlGeLN403vlJrWHm2tdiz9BMJE kQMIndJdQXru2NHXComv0sfC44wWhOpV/ae+2QuIUWh3m6k9tvociIpuytJETlYbTWTuvA8hyA9 +RM6WovKZooVoMgVjiFll/FmP6ZfpG6nUlazi9kZi+npi0IHVQ7g4M0xlww3t/yi3d3sdehK+bH vFu8z47kRcEDCT9ihGQfCWyiSr/46l1AhXI/dzWFrIS9S+v+8Au/NSb+uZWHvY3Nl1CIhzGRH+t wVxdDKUBLeo0Lfh4apv5P5DmM7pTAe1aqrUlnTFdechb6XaWbA39KjhGFPbdcmXka4S6nsVBR02 Uuc1H3g4Fb+F3v3X3u1+O393Lua8F57XTtJl6+SfSNf4iKGAEkBNL4ZdNUValyg2E3alx99Vn5D ZvDpN5E9/z2qGXM6ty6Aelp6qvk5xcyOkw72XdF/bYgRZkRRL/vms2CC9MGB044QYolKQD4EKHs cxokjvAAas= X-Received: by 2002:a05:600c:a30a:b0:48a:581c:ead with SMTP id 5b1f17b1804b1-48a581c113cmr262189365e9.10.1777277357847; Mon, 27 Apr 2026 01:09:17 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 14/32] monitor: Do not check TARGET_I386 to build target/i386/ commands Date: Mon, 27 Apr 2026 10:07:20 +0200 Message-ID: <20260427080738.77138-15-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277374129158500 These commands are filtered at build-time for i386/x86_64 binaries. By using the recently introduced HMPCommand::arch_bitmask flag we can filter them at runtime, making it possible to compile hmp-commands[-info].hx files once. Since these methods are used inconditionally within target/i386/, define them in the same stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + stubs/hmp-cmds-target-i386.c | 13 +++++++++++++ hmp-commands-info.hx | 4 +--- hmp-commands.hx | 5 +---- stubs/meson.build | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 stubs/hmp-cmds-target-i386.c diff --git a/MAINTAINERS b/MAINTAINERS index 5583df5087f..8493b12a342 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -148,6 +148,7 @@ F: configs/targets/i386-softmmu.mak F: configs/targets/x86_64-softmmu.mak F: docs/system/i386/ F: docs/system/target-i386* +F: stubs/hmp-cmds-target-i386.c F: target/i386/*.[ch] F: target/i386/Kconfig F: target/i386/meson.build diff --git a/stubs/hmp-cmds-target-i386.c b/stubs/hmp-cmds-target-i386.c new file mode 100644 index 00000000000..43a167056d5 --- /dev/null +++ b/stubs/hmp-cmds-target-i386.c @@ -0,0 +1,13 @@ +/* + * Human Monitor x86 stubs + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" + +HMP_STUB(info_local_apic) +HMP_STUB(mce) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 28dec25642d..b575e4ac993 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -113,16 +113,14 @@ SRST Show the cpu registers. ERST =20 -#if defined(TARGET_I386) { .name =3D "lapic", .args_type =3D "apic-id:i?", .params =3D "[apic-id]", .help =3D "show local apic state (apic-id: local apic to rea= d, default is which of current CPU)", - .cmd =3D hmp_info_local_apic, + .arch_bitmask =3D QEMU_ARCH_I386, }, -#endif =20 SRST ``info lapic`` diff --git a/hmp-commands.hx b/hmp-commands.hx index ff65b39b454..cfd53bdc744 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1488,18 +1488,15 @@ SRST Stop the QEMU embedded NBD server. ERST =20 - -#if defined(TARGET_I386) - { .name =3D "mce", .args_type =3D "broadcast:-b,cpu_index:i,bank:i,status:l,mcg_stat= us:l,addr:l,misc:l", .params =3D "[-b] cpu bank status mcgstatus addr misc", .help =3D "inject a MCE on the given CPU [and broadcast to o= ther CPUs with -b option]", .cmd =3D hmp_mce, + .arch_bitmask =3D QEMU_ARCH_I386, }, =20 -#endif SRST ``mce`` *cpu* *bank* *status* *mcgstatus* *addr* *misc* Inject an MCE on the given CPU (x86 only). diff --git a/stubs/meson.build b/stubs/meson.build index 99a89c00066..6142e0f4d9d 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -88,6 +88,7 @@ if have_system stub_ss.add(files('qmp-cpu-s390x.c')) stub_ss.add(files('qmp-cpu-s390x-kvm.c')) stub_ss.add(files('hmp-cmds-hw-s390x.c')) + stub_ss.add(files('hmp-cmds-target-i386.c')) endif =20 if have_system or have_user --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277396; cv=none; d=zohomail.com; s=zohoarc; b=OK1WZCwE33uajBn26ExyKv7k7kEyideHInqSyJ4FE1f66bhrZSTGGgNmk2Sjw3RMf/llE8HB1QAiOZUBIaUO+FlJaV5ogBToZYGyo8cxnBNbS8BmC292YzP9g5UplZmXZFOD0esOMxOM1bQgfnTzPpFRoRYHWffotvBXjAjtU4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277396; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=dMU/VWsKmdyzWtFbXIxN14oBh1lK9MG9g4e1e4MZRyI=; b=CBG4/RBtcG7rK9ST2GPyLJ64DpY2blOgA+lEhuFOkEUetXrBQ/LKtXB7q8G6ruMJVbjusKdi5Uv9wfIPFRINn4Mc8mkOxG5LLLWwTkqhHdNpAoKEy8AtVw7BS3XUiHuvq0+D0ZpiWpKhYZ7NSdz/STs6SR6fzOPxZs9PoXQ0v0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277396330988.2847833118192; Mon, 27 Apr 2026 01:09:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH23-000234-WE; Mon, 27 Apr 2026 04:09:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH20-0001rz-8h for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:28 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1y-00021v-CY for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:27 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-44261378651so1035171f8f.0 for ; Mon, 27 Apr 2026 01:09:25 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e4ffa8sm81205156f8f.35.2026.04.27.01.09.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277365; x=1777882165; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dMU/VWsKmdyzWtFbXIxN14oBh1lK9MG9g4e1e4MZRyI=; b=AyVtClKyjIDBKfU8QA/C2R9ZZfQtspU/wEwgILDnne9NSIsOWthdaHyoAO/yEU7LKd GmjtQoeVYBi9cwvhxtBZz/kVK+vB2gAKKWB8dyQvBfTrCk0KF66qrNRDi+QmZFShnQoc V9sCPcv9J4qCJK+Hqh12zo2wwCEhTlGYpQPk1ZN/gke4oIKbhX3oOL74txM1vhhBqb2f SB9VAq9r02mH6HfiiGXKSrBzUQHkFRkX8kqKjGrtF/DNB32X4UWwB4Pi0hoSuzGCrDkb go6W3ZPJ79F/Py5FnzXA0YJIctVRleKkPbMlq0lqf7SyRrnUO9j+PBI5f9NTDwDcx2ZL IVUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277365; x=1777882165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dMU/VWsKmdyzWtFbXIxN14oBh1lK9MG9g4e1e4MZRyI=; b=VjB/z9FfVN8uh7nrg0GWr5Cdl1F72+EGsA5pCgnat+gQ3OE0b1b+U4wNyk3W8CMyhv YqvwfCXhjwd5bHsOYSKLJjuJU7pVWhZ1UcMNYIydziVqLxfKMd+tG/mICODUwjLp+6q0 vXywS2YLSTwt60cj9JjrwoLd/jJu7SwsUAzmk3FRAUgPKkCZAk859DGRBKfLNQjddkGS NI+HcA6tSKHt4X3Y0z5aoUCMLUKs1oby5cGzbaNlv8HWJsFCcXaW1HYsKbMq5tYr1kaE VTFyQjWaqIS3X1k55AZAEnw6x4tLIq0LtUW+DQy2cXR0twX6vAiLShwt9YwxUOANYG1E 1PnQ== X-Forwarded-Encrypted: i=1; AFNElJ98B/czmtkXusivhOcOhcNrlZkQzJvDmLrfScWXrAc+GZ57o6ccSD7TOmqxo9kWhkrmmV8ct+XTTRKR@nongnu.org X-Gm-Message-State: AOJu0YxozoALbwcDDyCnzhKfkDTQxnzohb/8eOWcFyn7R3nl1bUjPxwM qDPfIsv/SSo8rpEZiGGrCGct/2syZoMtmPcS6hLJCM8Esfui86bX+ctcSM9qTXaiwMhGYPR2PBv pYfqkcTE= X-Gm-Gg: AeBDiesEvM6uAGQPla72Z53V2SSvGYHi4Ls3dyQCdr66+WTyXIwmaQ9qmcKJpEG0TE5 U4cl3XfHW1k5qvuFlZYIbBKkgQ9urKTNhRyVJfBYxzfD534gghO6/ICA50ubX6wkRurRW59Vyj1 OHD/90Pjv3yff/SlOGkKa2a/bjmGt6O/L7XhvaPWMOPIQmO6HhSAsfl9fvfBtuGbuyCyng18N06 XqTDwT0HCuvuzT6PI3tdWX/zFVNoE3Q4Dho+mee97iKvBnhwucln070OhE4ZIY5pgaTq14fcmjT Lpwh2ZvLn88j4GuT5KKGv0gwquX0bh93q4yUbcq07p0xALZ66E571M38PuLN0BwVhSmC1zwxNTf z8e1c0vbP581BR+KBRIZYmrSQvzwsw/AK/HqsOHw65LFChPq3P1gg1WaBd00VFpXTFT5rRcozee MLlqgffuAu4MP4g1cNageAvDO2kr47x2dpvTSDK42MTUVQ9BuVrsYGP9d3r1aVxgtm3tUYjB2Wg 9r+sbq9+uA= X-Received: by 2002:a5d:5d83:0:b0:43c:fc5c:aa08 with SMTP id ffacd0b85a97d-43fe4034413mr65432120f8f.8.1777277364616; Mon, 27 Apr 2026 01:09:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 15/32] monitor: Do not check TARGET_I386 to build 'info sgx' command Date: Mon, 27 Apr 2026 10:07:21 +0200 Message-ID: <20260427080738.77138-16-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277397681154100 This command is filtered at build-time for i386/x86_64 binaries. By using the recently introduced HMPCommand::arch_bitmask flag we can filter it at runtime, making it possible to compile hmp-commands-info.hx once. Since the method depends on the CONFIG_SGX definition, define it in its own stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + hw/i386/sgx-hmp-stub.c | 16 ++++++++++++++++ hw/i386/sgx-stub.c | 5 ----- hmp-commands-info.hx | 3 +-- hw/i386/meson.build | 1 + 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 hw/i386/sgx-hmp-stub.c diff --git a/MAINTAINERS b/MAINTAINERS index 8493b12a342..8f587756cbd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -514,6 +514,7 @@ L: kvm@vger.kernel.org S: Supported F: docs/system/i386/amd-memory-encryption.rst F: docs/system/i386/sgx.rst +F: hw/i386/sgx* F: stubs/qmp-i386-sev.c F: stubs/qmp-i386-sgx.c F: target/i386/kvm/ diff --git a/hw/i386/sgx-hmp-stub.c b/hw/i386/sgx-hmp-stub.c new file mode 100644 index 00000000000..cf1d9a6344b --- /dev/null +++ b/hw/i386/sgx-hmp-stub.c @@ -0,0 +1,16 @@ +/* + * Human Monitor 'info sgx' stub (CONFIG_SGX) + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" +#include "monitor/monitor.h" + +void hmp_info_sgx(Monitor *mon, const QDict *qdict) +{ + monitor_printf(mon, "SGX is not available in this QEMU\n"); +} diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index 1dd8d9afbfa..2b083c77bc1 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -23,11 +23,6 @@ SgxInfo *qmp_query_sgx_capabilities(Error **errp) return NULL; } =20 -void hmp_info_sgx(Monitor *mon, const QDict *qdict) -{ - monitor_printf(mon, "SGX is not available in this QEMU\n"); -} - void pc_machine_init_sgx_epc(PCMachineState *pcms) { memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState)); diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index b575e4ac993..da9fdc0ab7b 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -866,15 +866,14 @@ SRST Display the vcpu dirty page limit information. ERST =20 -#if defined(TARGET_I386) { .name =3D "sgx", .args_type =3D "", .params =3D "", .help =3D "show intel SGX information", .cmd =3D hmp_info_sgx, + .arch_bitmask =3D QEMU_ARCH_I386, }, -#endif =20 SRST ``info sgx`` diff --git a/hw/i386/meson.build b/hw/i386/meson.build index 63ae57baa51..b611fbb5a7f 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -24,6 +24,7 @@ i386_ss.add(when: 'CONFIG_VTD', if_true: files('intel_iom= mu.c')) i386_ss.add(when: 'CONFIG_VTD_ACCEL', if_true: files('intel_iommu_accel.c'= )) i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'), if_false: files('sgx-stub.c')) +stub_ss.add(files('sgx-hmp-stub.c')) =20 i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c')) i386_ss.add(when: 'CONFIG_PC', if_true: files( --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277432; cv=none; d=zohomail.com; s=zohoarc; b=L55+53uoWO0BEPwhq7MHWkFKpIioBmhh7qwOpQlZyMFJfmtLeyZtKIwuS9PAlBeHUSawWliQALsS/TDT8ZWx7u4GeSyBZ+7BhDh7hYCfEOT+X3rVIB7KXI/xfYfsKXvNVtdfyttfEV1eAM8QoyMAzVbEzyjAt6BAJ8rLaXiRNps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277432; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=UyizkhPwA66T9NIfFzFir+Q1fq4kdPQuZBgZLFR1jbQ=; b=FJ1268YurXgwKCK+PyG+6Ez+jdTiHT6IYXO6Nd4X7I8RgWskyiSihD5DQHSqgciZWG2AV55tK/w7K1+Z7I8c7ijSuosejNNDVexh1OVYosv+ud8OCGB458pmoWyiSCWxHquIwGd2QfzXCsdt3CgeSnihJh/blYANYd8piuYjiFE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277432235185.0022665093727; Mon, 27 Apr 2026 01:10:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2I-0002Xx-4V; Mon, 27 Apr 2026 04:09:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH27-00029B-Mf for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:35 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH25-00023n-Sa for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:35 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-43d74086e5bso9505328f8f.0 for ; Mon, 27 Apr 2026 01:09:32 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-444eebec868sm3920561f8f.31.2026.04.27.01.09.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277371; x=1777882171; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=UyizkhPwA66T9NIfFzFir+Q1fq4kdPQuZBgZLFR1jbQ=; b=g0ynTMmVXv59PgU77K8PcD9pN8TMnxWdzPMTdtC2RftZpXjp2jD79CY3V0MqCgHMS8 PErOL4aFy84lusbaPiwal8sL0EDWZxxe50Uqto0+R/m49i8o2H+4OWvmCqWOYvW2AlDt QzW2GjAk5oJ4HrKTAcapW0+OSTS6O4avYXJQppFI0E829CGVM8BPrWOTKTqX/42Qmv/n CwqO6gxn30bcsEZezrSEFCsFqMLaf8Ssy0P7ePVmvwVhKAFzzoRUF0QRznKwFpbHM5UZ jA9Jn6Q0fOi/z8vEVq+TSn9Zh6OfVEef13O/JCb7IcWDWCxPdMnYz+pXXc5Y4NABL/5n Kvzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277371; x=1777882171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UyizkhPwA66T9NIfFzFir+Q1fq4kdPQuZBgZLFR1jbQ=; b=Ogd5zrz5wX1dwsTviqR+P3G+THwALQMY2w/tlPVFPPw88zYIBQqB6PbPXwzrIpvy6I 5qbUE3WdKmZKQbA8J6xxAXgSD6NNrHpElyb04apgmOCGzu0Pe30vPkq9Hr0mrqedV/ei WGjaM5AtxUfSx+UlxXo+Pg4Xtgf4sFm4Fl0mNLIG8FtF2R38gSMNrkhpR8rKKgkWtQ8w jTvI5H1TenItQAwE8Rkwz/vgs+IZy9ElWEujZ79O/O25E0xKGbL1aOhsh1DGCg6/9/p6 KvOazNMoQzQV8lWM1M1GEk5IGizOkcGYUk5+gGeQNZRr4NvKiiKsgAfxBOFKW0Y6npt9 6ctA== X-Forwarded-Encrypted: i=1; AFNElJ+L9fDkYOoHwz8rMsoci0EoLpM22Ly1lXTESoTLzpFI2wQzbDNMxQ916pr+w1+G71jAgh19kaivg2Vm@nongnu.org X-Gm-Message-State: AOJu0YwZT214K1YZ/ltl7gCp8M5Jk9Y1JBAwFJk4HV06x4drV9Fzy+jV ltdIcsWwJ++TIBUMcatkF5vKd8n0PgJDsu0oJV9RVSKFUek3XYSnsFLYH8zo7cHXa3NszL0Pjcj QMoHcu30= X-Gm-Gg: AeBDietmkFbqII0EcmNzVPZPrJSn+ZtfosuhK+k75i7WSG2lkPXaRzruLTNThU5IcNz /3K3nMC3hXT1No3PlDBNMpd9y0AwOtflbS4yrm1yR8RcJuKe3k/+SNS9HOvo+Xc1xAmwsbBgG9q 7Qtt0Uc41K8WnElpMeTxmF8VW63Y6wE6R8YYm9PUQ5qA0GwIPgRt2t79hJBtRFSw1hn2Qe1CJfg PZje2L/AVVV8Cy7aBd8w0IESU7DgzK0KifT0NIzdd92BP+32wF2QBaPkO7ilMv9GEyS+HNAZ6LA gtHAzWLjm/ZF1L1llhUsXgJQINRSw46zuARh7LqWuB7fSeAjsaO6BQMH+TO/wf84bOprWyG2NmF 0koYQh3xu15J1r2Yk/ZtROasJbV5CHYCcBCUEF9QfIiW1aafZw9KnKF3g77tF9f4He/leWkGPeN fPyB4PsvCj/sTRRX0H6xSYH8NV44TzvCul6Qc9XACEwKnC7XRSl7lSjF5lcHmbrOoj+xFJpEXZa crK7HV8oqc= X-Received: by 2002:a05:6000:2dc3:b0:43d:d037:d59c with SMTP id ffacd0b85a97d-43fe3dd5069mr64972242f8f.16.1777277371176; Mon, 27 Apr 2026 01:09:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 16/32] monitor: Do not check TARGET_I386 to build 'info sev' command Date: Mon, 27 Apr 2026 10:07:22 +0200 Message-ID: <20260427080738.77138-17-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277432505158500 This command is filtered at build-time for i386/x86_64 binaries. By using the recently introduced HMPCommand::arch_bitmask flag we can filter it at runtime, making it possible to compile hmp-commands-info.hx once. Since the method depends on the CONFIG_SEV definition, define it in its own stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + stubs/hmp-cmd-info_sev.c | 16 ++++++++++++++++ target/i386/sev-system-stub.c | 5 ----- hmp-commands-info.hx | 3 +-- stubs/meson.build | 1 + 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 stubs/hmp-cmd-info_sev.c diff --git a/MAINTAINERS b/MAINTAINERS index 8f587756cbd..eeb7115edcd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -515,6 +515,7 @@ S: Supported F: docs/system/i386/amd-memory-encryption.rst F: docs/system/i386/sgx.rst F: hw/i386/sgx* +F: stubs/hmp-cmd-info_sev.c F: stubs/qmp-i386-sev.c F: stubs/qmp-i386-sgx.c F: target/i386/kvm/ diff --git a/stubs/hmp-cmd-info_sev.c b/stubs/hmp-cmd-info_sev.c new file mode 100644 index 00000000000..f3624423a33 --- /dev/null +++ b/stubs/hmp-cmd-info_sev.c @@ -0,0 +1,16 @@ +/* + * Human Monitor 'info sev' stub (CONFIG_SEV) + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" +#include "monitor/monitor.h" + +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-system-stub.c b/target/i386/sev-system-stub.c index fb84aee94d2..2ea85597cf9 100644 --- a/target/i386/sev-system-stub.c +++ b/target/i386/sev-system-stub.c @@ -32,11 +32,6 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t f= lash_size) g_assert_not_reached(); } =20 -void hmp_info_sev(Monitor *mon, const QDict *qdict) -{ - monitor_printf(mon, "SEV is not available in this QEMU\n"); -} - void pc_system_parse_sev_metadata(uint8_t *flash_ptr, size_t flash_size) { } diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index da9fdc0ab7b..336ab870a2c 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -812,15 +812,14 @@ SRST enabled) memory in bytes. ERST =20 -#if defined(TARGET_I386) { .name =3D "sev", .args_type =3D "", .params =3D "", .help =3D "show SEV information", .cmd =3D hmp_info_sev, + .arch_bitmask =3D QEMU_ARCH_I386, }, -#endif =20 SRST ``info sev`` diff --git a/stubs/meson.build b/stubs/meson.build index 6142e0f4d9d..f086521cde4 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -87,6 +87,7 @@ if have_system stub_ss.add(files('qmp-cpu.c')) stub_ss.add(files('qmp-cpu-s390x.c')) stub_ss.add(files('qmp-cpu-s390x-kvm.c')) + stub_ss.add(files('hmp-cmd-info_sev.c')) stub_ss.add(files('hmp-cmds-hw-s390x.c')) stub_ss.add(files('hmp-cmds-target-i386.c')) endif --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277442; cv=none; d=zohomail.com; s=zohoarc; b=l7T0FprUxJzxjh+ZgU0NAmJfuz3ID6jo1HE4QCumVhb/tvMhxBl+eNt0qiNcQwZHayi+W/eOkyckNtxvfv8AU+EH/iRbXC8r48aAHPKLvWaBjpol2kvZMmJC/TvVY/d4DvX07hqPORmbtFRUYpxcAFjOVdMhKa9/iT0TS1+bP6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277442; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=JshNpgqW4cCYul7Q+y/QdsSlweDRsNaeeQFwo1ONxPo=; b=bO4TP+Ce6AiXTcb8mo4QaTZs1JnoQz+7cXhwnv4ZneGxd8PV3flWIjq08nIUG5aoLd1uuQJW6s7u5d4MgDoWzLNTeq3BzzX89CHordtF3BcmKl/E6KSeAdTTPLmdhbbxOm9jGWXEMVrLOOtwbo5P+UfyhRuWtXhKN8b/JN+kAfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177727744226220.01347096970767; Mon, 27 Apr 2026 01:10:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2K-0002t1-0f; Mon, 27 Apr 2026 04:09:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2D-0002SH-C8 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:43 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2B-00025R-Mz for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:41 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-48334ee0aeaso103276075e9.1 for ; Mon, 27 Apr 2026 01:09:39 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a5aa3ae83sm778866945e9.12.2026.04.27.01.09.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277378; x=1777882178; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JshNpgqW4cCYul7Q+y/QdsSlweDRsNaeeQFwo1ONxPo=; b=i5f9AJbNGReyeQIM2GEWxADBdMZ2QavQlXBQP1nsOL9y4n45YbaV7wV489zlN3TXGc 3mjnyJ4iVhvMKP3tZsXBi3qyqtWXZNX69RnGElBSEVcpwmV4m/EX7PUiieQ/tPz8u5mm olxTdnoTN17XiOmDB3XZQVkyy7y5GB+C9hu+de5EknSWRHI4GNppLDsxBQXsPanRupfG gKR1dtKgny4rG9iYaNudyiKnF9G6oI406su4yB4tljfvazo3F6vnn/1xtn4z/MSiHFAg ehqOMiesxw6YblKbd8/hOzgnakn3GZjbXA56hg2r+RPw3ZMSSEfpJZYyMgrWhBDefNvR s9sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277378; x=1777882178; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JshNpgqW4cCYul7Q+y/QdsSlweDRsNaeeQFwo1ONxPo=; b=GGYccJRpNUj5W/aHyBcQLQ575m8OGpRQbmtS73cHKs9za6DBfXDaFON/p6RJFJlxAW VV9Zjy8xoFUPnZ4bxSlktb3cyVz9a7q9/B5WXcjKgmlblCgxAGdG0yF0nCHlwKG6wfDh tN53No1I2inPLDXj4V4aR+B95J0R89d3LvliXTvH6ud415InMHUyFxZd/Zzjlm+cIaHG A6x1UCf6HJi1pa5JVeDs6RXY237Yo7q2h28fYoOJhdmOtXuR0OjXn+Z9vlQI4AedUY7C Sye23tabjE7RF7wXQj6x+Yd3Wk3f4LB3UKLbZN37dSaUwe+wYyX7aJxgeZDqTkBl0JU5 FyMg== X-Forwarded-Encrypted: i=1; AFNElJ/q3gj4dnjSrAPtXNzQ623QmXhVZjCKCv+9Bk9GwcnMs3Q6Y9p+z0bsasuurkazyMdKmy9WPg+wdqUc@nongnu.org X-Gm-Message-State: AOJu0YzMy5aAQlUr9zvqhw2e7V64Rq3CGEmQTA1BpJKyh2U0oi6stBFI Sun658azwtnOCaPoELnnuXYzVXdZfeMVaESM2RZnUmSbEQySQ53oMTTxn6qus5hUZA53bF+/XB+ 0ec6DNYA= X-Gm-Gg: AeBDiethfjIddgFL2UpEpjLc9siBThFndLl8oatiAWsFp6lE55xU8MfKVX+GfLBaUv5 Z7OfvCft68LGb7/eZylvLGDBzkeTuzMYPwEJDXLAhRWEEBl5eaA7BGoSp2zwsfDNVD9qaTPhZI2 NPH/7kRLyBLHO1RtUgtbEa/DYCbTlJiSnjj+oCST/si2NDaOryUdkdKI+BCvBR5/JkIPMze54lp pKLJXJoImNgoHFanEyeiFTGzoiQaxG0DQdvXcl55jqpnjATjEfvOON2hKkCnRlg2oahfc9EiVP+ 9c/K+zK7p06BgX+rpuEWuDzdm9oAhqja4V98TKBlh0SaevduO69WJeOetjryGmQQ0QDYaBt1bSu utSWIX6iriObfzGjAD/qHshfsxR2a+TYFfuHzp/PQm1fqP1C5rmj9qD1kpVw047BLldYTeejA9d JpbEOj59qGCRgN/39aHGdap1NnxFCoVQqJSM9jmA7NkX2hD+itS5zRoH7jSVg3YtHWM4FeovdY4 PLQB+zypZWBq6PGqhsODA== X-Received: by 2002:a05:600c:3f10:b0:485:35d3:ce59 with SMTP id 5b1f17b1804b1-488fb753c9amr565831465e9.10.1777277377790; Mon, 27 Apr 2026 01:09:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 17/32] monitor: Do not check TARGET_I386/RISCV to build 'info mem' command Date: Mon, 27 Apr 2026 10:07:23 +0200 Message-ID: <20260427080738.77138-18-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277444795154100 This command is filtered at build-time for i386/x86_64 and riscv32/riscv64 binaries. By using the recently introduced HMPCommand::arch_bitmask flag we can filter it at runtime, making it possible to compile hmp-commands-info.hx once. Since the method depends on a pair of distinct targets, define it in its own stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Alistair Francis --- stubs/hmp-cmd-info_mem.c | 12 ++++++++++++ hmp-commands-info.hx | 3 +-- stubs/meson.build | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 stubs/hmp-cmd-info_mem.c diff --git a/stubs/hmp-cmd-info_mem.c b/stubs/hmp-cmd-info_mem.c new file mode 100644 index 00000000000..8a53e367a9f --- /dev/null +++ b/stubs/hmp-cmd-info_mem.c @@ -0,0 +1,12 @@ +/* + * Human Monitor 'info mem' stub + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" + +HMP_STUB(info_mem) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 336ab870a2c..2d0a8f7d48f 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -209,15 +209,14 @@ SRST Show virtual to physical memory mappings. ERST =20 -#if defined(TARGET_I386) || defined(TARGET_RISCV) { .name =3D "mem", .args_type =3D "", .params =3D "", .help =3D "show the active virtual memory mappings", .cmd =3D hmp_info_mem, + .arch_bitmask =3D QEMU_ARCH_I386 | QEMU_ARCH_RISCV, }, -#endif =20 SRST ``info mem`` diff --git a/stubs/meson.build b/stubs/meson.build index f086521cde4..33053d932c8 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -87,6 +87,7 @@ if have_system stub_ss.add(files('qmp-cpu.c')) stub_ss.add(files('qmp-cpu-s390x.c')) stub_ss.add(files('qmp-cpu-s390x-kvm.c')) + stub_ss.add(files('hmp-cmd-info_mem.c')) stub_ss.add(files('hmp-cmd-info_sev.c')) stub_ss.add(files('hmp-cmds-hw-s390x.c')) stub_ss.add(files('hmp-cmds-target-i386.c')) --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277411; cv=none; d=zohomail.com; s=zohoarc; b=HyjJFM186euV+orNZTwSCHT7YZ7bQrJCN1akNQdYG3Jd2hUhi847NdtwAN0MJH0gAzC5xWe9CvwpdbcALKdLufh86RO+3LMzAbnPRjlozqelKX+6Ad7RtpkP1yniUCrDXpEzbMx0wIjIygzkiVnHxpMHb/1EB6IWpGyw1H0Fqqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277411; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=pik3BU464hnFHYYfndKD9+oHzuH7HfW/xw+RI/N+w7I=; b=XMPTvJrS+It9JpuTyXEalG/le2TxEDMm242C2h3G4G1+j+8B6dUF5W+yObWbRmJD93klAnP1lqGG/HudMV3ISRaY6rLx1GYzkmog7Zak+8SpTpBESOyS5Q9rJI/0fEiDIInqywyZnWS5Z8KFWzELvziosQfeMIyGac1pDMhtRzs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177727741160680.51750166862018; Mon, 27 Apr 2026 01:10:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2L-0003C1-KR; Mon, 27 Apr 2026 04:09:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2J-0002sh-Of for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:47 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2I-00029A-2r for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:47 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-48896199cbaso98648275e9.1 for ; Mon, 27 Apr 2026 01:09:45 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4cb1249sm75288495f8f.5.2026.04.27.01.09.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277385; x=1777882185; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pik3BU464hnFHYYfndKD9+oHzuH7HfW/xw+RI/N+w7I=; b=bSjpvvv7UM2GLcRF4dHVXuZ2kYxSqZ0BT7i0xGGYLMfq17tFZtYoXQCKoFIlYklmw2 /gZtTnySIefvoPNAUdR4wMZmcllGSmC+2NY6nW+7jmXGn1j4tlleqTx27efroWvX3BFQ MZPcIT/Lfpq5D2XIb89+cI1NCRsD5irrUd1nbTpZKnHWQMSrj2HuPtSyIaYWqXTb4oQ2 Bl6W3xoCdgFORB5anwTAHQA0Mn9HUTQVmY16xxcu8T1BajD/SS7L51wSMDT3/lMqO/Hf ELD2vkxTLDnUyi2E/6cilF3hwSuGj0t8lQLubL3Q71RAXN9gFFHaqpIj9MYlTyu7Pelp Iing== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277385; x=1777882185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=pik3BU464hnFHYYfndKD9+oHzuH7HfW/xw+RI/N+w7I=; b=o+3IpP7Hp3QxbASraIPFadtaCNUp4fgp7R58kTN9IlzuD3646K1NgS5FVaTqnFCeuT 2b5DNaTlPawCHyDTfF9V3rJ507zvSXi2E21V4LzlbEC+EfsKcBotRSdkMkHa9Fz72XZ+ 5zh2Yjch/9hfkfnOPSpgnfJq7Qz4li1d46oUyyJioBXHN5PWgN9eESliL4n0QA1uPwD/ 01suneU4LVzTnvjh99nHU6IqmV+cyDlTbQfgGterXE9TVp3Jxopw47Gd3t55K/D5CoM8 SS+wFABiBogG274gaL9HQi/IejTNStT6ZlfNxFMik/d3n13GXyokCVhXozZKYellPuY7 3Sxg== X-Forwarded-Encrypted: i=1; AFNElJ8VkcAPuRJMszwKyNKDDiFoVK5YwwV3VvcBGF5ubXaLIZJeBG32IS5KkaO1sAulzBItVqOoAmJF1Jmi@nongnu.org X-Gm-Message-State: AOJu0Yxw34d+cuMKyERZbKWyzLLk1K05iKmq1LQGnvoSEcFoqJeACter I/3aSNjuIYWm2Ks0jTTu3p21zFN+UANytZuauZfVvaWKldO+DKeV81JCNb3kC990IK4= X-Gm-Gg: AeBDiesSONercqFo4gCC0y0o6yI6ArlAwVU18UFsdNpt38uX/Xc2u4ae6eCVLDV/wKO 2JgdEbqmdeMBLSXaC0Q3v0xFEWOUnyZmH6lbjmuDuwmX9eaciwYOCrnGa5TzD3f9pVfXJQ0A8wN 3nVjkV2GRQ90aGAL3f9XmOFdnI/1iUxTqVPhfg9BlqM0ztnF5eyFwueblCLqw/YtLJbCmpZ80TL a+MOPNTpTQi5Z+s9LNh07sgYqiHkyT33qHPnAH/dpCvAW/IW2FZOzXWWkN9MtE/9KSEz1hIk/wM 3Y3kyWq9eR/YFC66i4rLiQI5b0rpBS8sriI4GEKFjVaWpoBj4bZgEweLdFZMXfamIyDzZ38JByi thQBwxUOvtfV7wKIZoaoTr8bM0+ASB92JGUXviY8o9zt87lBWIcdVVZTeatGpBh2HrsJ9mn6Fmj U65cDgmt+tQW5lzT8BkdkslhdVH0/beHw8G/26W1TqewKKyi+UpWR3yf06YVNDYwMFbGoli57A7 i9yjHM61WM= X-Received: by 2002:a05:600c:a416:b0:488:e7e4:8425 with SMTP id 5b1f17b1804b1-488fb787674mr473342705e9.23.1777277384463; Mon, 27 Apr 2026 01:09:44 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 18/32] monitor: Do not check multiple TARGET_* to build 'info tlb' command Date: Mon, 27 Apr 2026 10:07:24 +0200 Message-ID: <20260427080738.77138-19-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277412425154100 This command is filtered at build-time for a selection of binaries. By using the recently introduced HMPCommand::arch_bitmask flag we can filter them at runtime, making it possible to compile hmp-commands-info.hx once. Since the method depends on a pair of distinct targets, define it in its own stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- stubs/hmp-cmd-info_tlb.c | 12 ++++++++++++ hmp-commands-info.hx | 5 ++--- stubs/meson.build | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 stubs/hmp-cmd-info_tlb.c diff --git a/stubs/hmp-cmd-info_tlb.c b/stubs/hmp-cmd-info_tlb.c new file mode 100644 index 00000000000..a144e68c1c7 --- /dev/null +++ b/stubs/hmp-cmd-info_tlb.c @@ -0,0 +1,12 @@ +/* + * Human Monitor 'info tlb' stub + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" + +HMP_STUB(info_tlb) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 2d0a8f7d48f..0898221a486 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -193,16 +193,15 @@ SRST Show PCI information. ERST =20 -#if defined(TARGET_I386) || defined(TARGET_SH4) || defined(TARGET_SPARC) |= | \ - defined(TARGET_PPC) || defined(TARGET_XTENSA) || defined(TARGET_M68K) { .name =3D "tlb", .args_type =3D "", .params =3D "", .help =3D "show virtual to physical memory mappings", .cmd =3D hmp_info_tlb, + .arch_bitmask =3D QEMU_ARCH_I386 | QEMU_ARCH_SH4 | QEMU_ARCH_SPARC= \ + | QEMU_ARCH_PPC | QEMU_ARCH_XTENSA | QEMU_ARCH_M68= K, }, -#endif =20 SRST ``info tlb`` diff --git a/stubs/meson.build b/stubs/meson.build index 33053d932c8..2f4e1ab4300 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -89,6 +89,7 @@ if have_system stub_ss.add(files('qmp-cpu-s390x-kvm.c')) stub_ss.add(files('hmp-cmd-info_mem.c')) stub_ss.add(files('hmp-cmd-info_sev.c')) + stub_ss.add(files('hmp-cmd-info_tlb.c')) stub_ss.add(files('hmp-cmds-hw-s390x.c')) stub_ss.add(files('hmp-cmds-target-i386.c')) endif --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277408; cv=none; d=zohomail.com; s=zohoarc; b=VidvMNSVCC9Ly1Pkkq1bmGlQWdQa3W2jb37euoPv5feq1aUG5V/sE5mb8kC2JGVdf7dOlYtQXsRoH6ooE+HOaS+1ZsspSyHxqC7+iIROqixADrX+E3k5GsA877S1nzoGLMLEYMyt2tfwO36qN+OiMMcit6NnfdoRSQIDpT6+VZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277408; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=e+EDDgWhJI3ORltCGjgBjB3nc854c+rlyGvs0etBPgA=; b=dTxz/CC1t6A1Sw3t/74eOOogzhrcV1KrDS3X9jmlaePM/Os3dfpVXmhmYsNsBMRKV+CHqVsewyaogX3ErYBFaYsrc/xnUemR7dF+/Sv5W8K3+7EhIYKctYX4IswWv4odVCw5YaGhgE0FUZhZT85SSOsxCi7FiznwqtlDAVNcnnc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277408130401.3698951894188; Mon, 27 Apr 2026 01:10:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2U-0004bH-V8; Mon, 27 Apr 2026 04:09:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2R-00047G-8S for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:55 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2O-0002BL-PC for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:54 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so130183795e9.0 for ; Mon, 27 Apr 2026 01:09:52 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e591cesm106514862f8f.36.2026.04.27.01.09.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277391; x=1777882191; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=e+EDDgWhJI3ORltCGjgBjB3nc854c+rlyGvs0etBPgA=; b=Es8YNFZNny+dY5dEvhgmsb4sr8EMpY8g9DqoNHYlJDeCkgK7szn9jk/jqpRIsdC7uY AypSBjhi+uI1dOaVcbzODkJ7K1jKOqb6+va+yfGlkDhxANrsUKcMp+z/PNkbFIRjx9nf bxFc27TBADtwisn+A0UKfoLze/a7hRjpmaOFOEPNONptEYbGvvR4vhSHD4HbFfSgKalm hmPsddMOKyMmVjgGTkYvr4MQ5K1zgn6U2ADDVVm+u7JVhy4rrkUsVVCGtz6TM6LTJDsx UHXvCjB/TdDCDBbbEsQd2QlULL8mTmzsyd9b4ZU3pAP2HQJuB6DfguQCc1ER9dYLMq3x AgBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277391; x=1777882191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=e+EDDgWhJI3ORltCGjgBjB3nc854c+rlyGvs0etBPgA=; b=ibuIN7BVZSccsLAHgxIodfVY0BRc9KIErEx+TkazRXatJgt9y7/veV/GWPqE83vY0s T+G0CWcl3nxMHGdaB0w1o5RUjgjTt1KCH8asJHj5rciAiUHHbp2nRstYm+cgb2BOMTPh O2Lwd7OpFAMXnXD+RoesS6ND0jO7u4NQO7kzZfWpMiT7rHAPiC1NBT7H+u6E8WKTJc7E rilXa/5fB8KnK4vAtghddUTp1RO/JZISMuR6v5tEh2RZVfIcmRhaeYIERNcrIKLaoUGr eKyxOYz8mMN0WOYkgseLbYsf5Z78KlhTnOs0r96VCq7YUrDslr7F7nao2u8xAGDzZT7k autQ== X-Forwarded-Encrypted: i=1; AFNElJ8eEevAXLBeJpYEbKzoold59AUG0cEREV3njwrU/8C2w/tYBv7XFcfbJqadNrW9wwSozsKRpV1rEIYC@nongnu.org X-Gm-Message-State: AOJu0YwibuKZ9nXsOo9GN4CgTauk6CvOATPU3aFY9zW/jzBsRiJkzRdf j7WCDYn+lDLXOOlaibyjyOxRQtzt6HMlQkqaBU3AOTZuTRCVULWwuni3VJbza11JgaIJfqib3gX Uowjn0Oo= X-Gm-Gg: AeBDietNcChuJH0Fgqc8kyHHCsOyLYouHGpvkVCBo5rGg5FqpbEEJYbyN/fv6UT9dmp DpRg46AAOqyXlZqvB9sXe1dkdL39XKtyVR7qSi6RBj3CGD8HjIZAMx/tKtyIYSDMIHD6yS+Vk+K 8fw2mbvwj9o/zZCLB5mkeE5R9bBDEWka7x/a14RVu9zzf/jRmbORKdGsIs2l9g6qcKWykMYcHRr dGm1Ocujkh/F61njRWuHWMPs8YicYvT/kj01oonUzolvmbL+SGbR/AR/Qs34xofJaOLszz821UN POgF997SZXE7ZIQS2+y5UQhXcc5cWUVp27IpTSGfSHdQoTvhcvqT6laSk4XNm7m+yFIW4lYeVAh 1A7PHS0V6ievUhe1Ue1uwBAS3dUJLVwteoZHzxi8mkMbgdsfMJ8Kr675ZPHEqaAkc3igXbLpCZM AKIU8vtiPxfBxcUaX4xzlmkkbtwJSE60C1SEm8WXnB2EIDhAhDVOoliitRS686R1XRrIavq+88k PwRf5nQf7A= X-Received: by 2002:a05:600c:8483:b0:488:7ff6:1f75 with SMTP id 5b1f17b1804b1-488fb782d91mr633195655e9.21.1777277391201; Mon, 27 Apr 2026 01:09:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 19/32] cpus: Introduce SysemuCPUOps::monitor_get_register() hook Date: Mon, 27 Apr 2026 10:07:25 +0200 Message-ID: <20260427080738.77138-20-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277410256154100 Allow targets to register their legacy target_get_monitor_def() in SysemuCPUOps; check it first in get_monitor_def() otherwise fall back to previous per-target helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/core/sysemu-cpu-ops.h | 8 ++++++++ monitor/hmp-target.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 7b2d2d2610f..5b831393cf4 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -85,6 +85,14 @@ typedef struct SysemuCPUOps { */ bool (*internal_is_big_endian)(CPUState *cpu); =20 + /** + * @monitor_get_register: Callback to fill @pval with register @name v= alue. + * This field is legacy, use @gdb_core_xml_file + * to dump registers instead. + * Returns: 0 on success or negative errno on failure. + */ + int (*monitor_get_register)(CPUState *cs, const char *name, int64_t *p= val); + /** * @legacy_vmsd: Legacy state for migration. * Do not use in new targets, use #DeviceClass::vmsd ins= tead. diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index a222fd4c96a..46ccbd14aec 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -35,6 +35,7 @@ #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-machine.h" +#include "hw/core/sysemu-cpu-ops.h" =20 /* Make devices configuration available for use in hmp-commands*.hx templa= tes */ #include CONFIG_DEVICES @@ -85,9 +86,13 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const c= har *name) } } =20 - ret =3D target_get_monitor_def(cs, name, &tmp); - if (!ret) { - *pval =3D (target_long) tmp; + if (cs->cc->sysemu_ops->monitor_get_register) { + ret =3D cs->cc->sysemu_ops->monitor_get_register(cs, name, pval); + } else { + ret =3D target_get_monitor_def(cs, name, &tmp); + if (!ret) { + *pval =3D (target_long) tmp; + } } =20 return ret; --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277415; cv=none; d=zohomail.com; s=zohoarc; b=V/a1CIGLHHUrTO4Pfg1LtfQ23OdYM+gYk3Rr+AHYDIbe3/IehDh03pF3NE+ON0x3Zc4uSxSMhX3hggZX1gtCS43D6d3vCo99gBQIvdO1moby3TecdefW8ipC2G/Xi8fMjEIQergyalY8QU82P7Qs/g7wc9Vt88rzfICrbh84tWY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277415; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=+UtYw+wvw45FuO+6veL5kPFJkNDEH8lZGFLqErw/iU4=; b=SUuwlR36ks3aB9zaFjl8G9qn2HfMlzYU2eaq86q58qSiR+rtMoc51t+AJVEHhENyg6gCPhML9Qr48w28qJ0KvOhUZKTl2OZ/xNrMrDMuuDGBiW1J9MvZntXHvBp0UXqlr5qMtZAlh9lrRBf0afVstEJNGIf7WirBI9Ed3PxuqpI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277415796700.4632972442165; Mon, 27 Apr 2026 01:10:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2Z-0005Nt-Sz; Mon, 27 Apr 2026 04:10:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2X-00052m-Mm for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:01 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2V-0002D2-TH for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:01 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-43cfbd17589so7844595f8f.0 for ; Mon, 27 Apr 2026 01:09:59 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e4d5b1sm81979585f8f.30.2026.04.27.01.09.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277398; x=1777882198; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+UtYw+wvw45FuO+6veL5kPFJkNDEH8lZGFLqErw/iU4=; b=u9HXGMxfjYeQLBSZhiYTpo0rCr65rzP+g3zpp/G3v1W96FDHi7+h7MEajcO5/fA2m+ AYPJq4r/l/DsAXdMmc6R37HMx6BApM5aEgv5IykYSmVPBAcJtu9uw6gMZeZAzTeASiBg je+TkYzVLPp7IFoG1FqZLjwZELs34aBC4Xs4LVfJPNKMJ/i5sH1EmKEo/B+RvpItIC/G ce57K8mVXzrMXSs6lE1HduRHjqCggfgPXw+7teqyvTNiV4dQ8PO13+CrUpxRbeGRjRza x1ZlTGdHILhEoqVckTeserzmsIJXQg4jmm6OLzraj/rdQfaEn/piWkfMHPwBBO9kpYpQ rBtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277398; x=1777882198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+UtYw+wvw45FuO+6veL5kPFJkNDEH8lZGFLqErw/iU4=; b=eefGmMkscCqQhjoH5CQnyvfn0qgiyTnrtzbAClLDQzI0BVtMqrpoQ/XhphPXez6Rah QJXBLRNPD8LETXt3mhrE/tts6a0Uod1We9ATz5Q/Zrw3osqssmtuQjDTo7NWDV53buL0 ZqpPJ5gdxAPL4z/RnG1w2/aChpDSXIoBGdhvFfuwVDC2hDZNuhVtYGgnrvHO4UtSYV/j PnseroiSedqgj6WoC+B1Vhxm7KP6IG1Yp8u9S/p2/q2SxhWnRPf+/YNCihdjfZoucOOC fzbmFnGowGpgEnBMwoFSdhcnb8uUheZ5UNLqBPQa91yL/CxdkZ4kRzYV0s5xURvif8YT SixQ== X-Forwarded-Encrypted: i=1; AFNElJ9X9MPkYYGEFfbIqj7lALzIUTTHF/5hmpVCsaDGZCtiamrDVbLHZc7blCDnEtfeFevqjyWYZlhrfiA0@nongnu.org X-Gm-Message-State: AOJu0YxXpVgfbe6Of0yxCc+CVbPZ0bB0kIqptRPC4lVKbK34lhsa2RTO DJze+CYxuukpQlMwPaACE7SK6Tgvhj3LD3IFjKV1ym0p8ldabwl917PJ2VXE+0VcNlF++JSoyyu NpReNx2E= X-Gm-Gg: AeBDieuZuEL6E+HIrdWZrNzpoEhXoB3QsYhxVHpiFXFTKgrBwJ3YEsm3ebecIb20KYz p32w5ju7elgsg8fz5ZSRleCTufp81RVa3zALxaLrAqDY4RZLGJQDGUMoN9zxEvozCtE1jde0goi 4VRrfs6NiIICi2hg5F9GkmJorbCvSZ/XsEhXNEUQyZCVhGCbbAzM4NadTGc0KV5xIltChieMtBX U4mm80rJrKlKI3sinW9OunGQc0eZ1hx0RNCERDx5liXWbdmOVKa5iSozgtup9d/2nBUK0bgjyem kT56WOR7ImBuiVeFUVDg0OIdG59h6Fihdj/j227YyU/E8xIc25NrhanreKZCV+60ZQZuKy0Fbkj 8AmlTeOuOCywuPRgIGgZp8A2AE0oLDdMyRaEz6qpT43WiJC9DPks65f0wfCtmL3NlEu7UZcGHMd Vg9BZqdcThPqYHbCcln6zWisTliDzsiuTIeA8ZxRf2GZ79UwlULCBG1SbSYfrrj8MlnamlWMFl5 6tkfTdEJts= X-Received: by 2002:a05:6000:230b:b0:43d:7cb5:43b2 with SMTP id ffacd0b85a97d-43fe3db3150mr64172192f8f.15.1777277397980; Mon, 27 Apr 2026 01:09:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 20/32] target/riscv: Register target_get_monitor_def in SysemuCPUOps Date: Mon, 27 Apr 2026 10:07:26 +0200 Message-ID: <20260427080738.77138-21-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277416218158500 Rename target_get_monitor_def() as riscv_monitor_get_register_legacy() and register it as SysemuCPUOps::monitor_get_register() handler. Take care to sign-extend values for 32-bit HARTs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Alistair Francis --- target/riscv/internals.h | 3 +++ target/riscv/cpu.c | 1 + target/riscv/monitor.c | 11 +++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 35b923c4bf5..47becca37f2 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -233,4 +233,7 @@ static inline int insn_len(uint16_t first_word) return (first_word & 3) =3D=3D 3 ? 4 : 2; } =20 +int riscv_monitor_get_register_legacy(CPUState *cs, const char *name, + int64_t *pval); + #endif diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8ac935ac06e..dbd88fa6655 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2720,6 +2720,7 @@ static const struct SysemuCPUOps riscv_sysemu_ops =3D= { .get_phys_page_debug =3D riscv_cpu_get_phys_page_debug, .write_elf64_note =3D riscv_cpu_write_elf64_note, .write_elf32_note =3D riscv_cpu_write_elf32_note, + .monitor_get_register =3D riscv_monitor_get_register_legacy, .legacy_vmsd =3D &vmstate_riscv_cpu, }; #endif diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index bca04a7580c..3898595a3cb 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -27,6 +27,7 @@ #include "monitor/hmp.h" #include "monitor/hmp-target.h" #include "system/memory.h" +#include "internals.h" =20 #ifdef TARGET_RISCV64 #define PTE_HEADER_FIELDS "vaddr paddr "\ @@ -311,16 +312,18 @@ static bool reg_is_vreg(const char *name) return false; } =20 -int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval) +int riscv_monitor_get_register_legacy(CPUState *cs, const char *name, + int64_t *pval) { - CPURISCVState *env =3D &RISCV_CPU(cs)->env; + RISCVCPU *hart =3D RISCV_CPU(cs); + CPURISCVState *env =3D cpu_env(cs); target_ulong val =3D 0; uint64_t val64 =3D 0; int i; =20 if (reg_is_ulong_integer(env, name, &val, false) || reg_is_ulong_integer(env, name, &val, true)) { - *pval =3D val; + *pval =3D riscv_cpu_is_32bit(hart) ? (int32_t)val : val; return 0; } =20 @@ -369,7 +372,7 @@ int target_get_monitor_def(CPUState *cs, const char *na= me, uint64_t *pval) * to do the filtering of the registers that are present. */ if (res =3D=3D RISCV_EXCP_NONE) { - *pval =3D val; + *pval =3D riscv_cpu_is_32bit(hart) ? (int32_t)val : val; return 0; } } --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277445; cv=none; d=zohomail.com; s=zohoarc; b=gMCZ/9wcWb52i0YKmZO9C9bMQ6UkCavDNGh8v76/RiypODu9fc6UUPDcazMd80vpQhMgT8uh8tLC5zRbe5DdISf7W/12WMUCznIe4F+UFqZYvabLJhUIczAKz/Xpi327O6kcVBoIylWBczfALoKkLSUvKVBVtxJxGDrlk9qzvr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277445; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=5MbZLdHokWB3HHK4f6Bx4RdN98ey138uSNMtx96pK2A=; b=ErJbW9aZJKuA3VPfQrwl2+b9bebtwf2HMUDvLDB/8i7Ykc1Ky+/Rziu2kTaZT1Po8sfxIGwSGQY9GdfRT4MseT3XVW6QLDp0ThkKHtCD6ATiUpbsRsf6jdfxgoVsFv/OWox/aCUWME04B0u8X4IWQ4t8C2oM084lIyCNIMd4pDA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277445676884.7844185461731; Mon, 27 Apr 2026 01:10:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2h-0006cE-Uq; Mon, 27 Apr 2026 04:10:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2e-0006AB-I1 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:08 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450: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 1wHH2c-0002QM-Ct for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:08 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-43fde5b81a1so7438089f8f.0 for ; Mon, 27 Apr 2026 01:10:05 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e4d112sm82866871f8f.29.2026.04.27.01.10.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277405; x=1777882205; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5MbZLdHokWB3HHK4f6Bx4RdN98ey138uSNMtx96pK2A=; b=yHNrIgS3hOTrhHGBzpiWc17qMJk8gegizMA6bRFxeRnPeH02sHEV1dlyDSCudrJKJW BFRb0ESNdOamq9Gfd2T9mt8ydpcyeiFM7hUKTPWvkN5PJt7ecmuKuA2d7jTIyjFYVJmB koALeVha0ZuuzFxPNeNaUGF60MLIDkz7fmbH2Mwj06B5RD5xCqiB5d7eqQkzmNbe+lWY HMAFzDAdh/PXUUQMFt9jLb01MCDPH2svTaUOEb4tAO2jNvUe/7cPDCYY8CHoptZUB1iv GHYcC+YeMFGba+BeaPo9HHJjwFyAJwpZoN5+zmrROx6VZBfCReqOoftYY3Nofh74EMpj nKIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277405; x=1777882205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=5MbZLdHokWB3HHK4f6Bx4RdN98ey138uSNMtx96pK2A=; b=QrigV0Y5zC8AQpBP2CIbmH/5uwNsueX05MTbfo2wjYZVuU1/MF+Gkhk/sdQVUZOtvU 0zcII0u2jdTYwGKXq96KCB5A6ouaOePFCHvNGh1wBNhrqn07KzkWXecl1jHj8aZo+AHA 01wq+kY44dNd837JrZXnNj0vSFJXAr3sUjnCLtHMNd4fdmEdOxUOlGly1/WsVyaFBRWN NaMWJ4meqPT3+ucrnaeauRPHL09VNdaD+5un45OYEJLhXo2VywcX+tKxdJrGnYNO3y6j plEri+zmmZvDuE/0AA4VpLQbCudOFtlI0KUmFTevOK61iuobL+RBJ63uzLCokb3fjLsK OKgQ== X-Forwarded-Encrypted: i=1; AFNElJ8+5CaQVP6gEfDoMdCp3S4R0rJ41UGNyoGGiDeyneuUt1oF7a9pE9jOM79sDinsW2p1m8nbsN3zrreO@nongnu.org X-Gm-Message-State: AOJu0Yxgx8AiHwpZa7PiJr4qm4UMTMNF9Nv87tOWb+xCTTgzxHNB7XJR IK2eGPz1ag43vCaUwUiOEs4kJJFTRDNDElxFYUssfznnUG0r9ybA3b+d/yd2/yMbzOuFU165xlw zlp37W+g= X-Gm-Gg: AeBDiesoKSlU4v15ySRq6i0L6gEG6C1q6hAzfVOOz7INSfP8C/d9tcGw+XY+1b9K+YX Ib2+XylS4quW4uWHZtCYS9zSZowmWpJOymIrIgKeiFLO+oI+huPAjomocJ9G/YkXDIGFstQHPGS hV4jpmqayykfSBKkJIINBBZXeMa/8AB7QCr2SJlceWLRVig/Hn37CnuEIBuVQUUvK/IqKWKS/BS 2kssKlfXEai4CuzLM1ZNbj0W3HWZhLrp4AzajDGH4KTUDo/lGLNOBxtnme14hmSEYPOm+VhUK5U qyC40UYIJntga/hH/RuZI+18JEb65iZ3ODxpmCuRJscn9vXLw0K8VLc17yKxzMBBX0Tom15zsXb fQkqwGNZeQZWw7Cm/6O/liSSAiouUwRYmKD4Edg4VC99dOqYoxrAV4CXx8G2hSvsDHNmb1EDlns XE676Rq+P2zjyIQ4itHqAnkIgzYAtS0WfWTZ/Fa4K39jQCBq2fdt3udB4bLEqisf7Rk0BCHCT0Y eOPNA2JwPQ= X-Received: by 2002:a05:6000:200c:b0:439:bd70:610f with SMTP id ffacd0b85a97d-43fe3e13c17mr64355324f8f.44.1777277404597; Mon, 27 Apr 2026 01:10:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 21/32] monitor: Remove target_get_monitor_def() Date: Mon, 27 Apr 2026 10:07:27 +0200 Message-ID: <20260427080738.77138-22-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277446912154100 target_get_monitor_def() is now only a dead stub. Remove as pointless. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/monitor/hmp-target.h | 1 - monitor/hmp-target.c | 14 +++----------- stubs/target-get-monitor-def.c | 29 ----------------------------- stubs/meson.build | 1 - 4 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 stubs/target-get-monitor-def.c diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index ce0bb1983cc..008c1a6570c 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -38,7 +38,6 @@ struct MonitorDef { #endif =20 const MonitorDef *target_monitor_defs(void); -int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); =20 CPUArchState *mon_get_cpu_env(Monitor *mon); CPUState *mon_get_cpu(Monitor *mon); diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 46ccbd14aec..c2ddcd67e51 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -66,8 +66,6 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const ch= ar *name) const MonitorDef *md =3D target_monitor_defs(); CPUState *cs =3D mon_get_cpu(mon); void *ptr; - uint64_t tmp =3D 0; - int ret; =20 if (cs =3D=3D NULL || md =3D=3D NULL) { return -1; @@ -86,16 +84,10 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const = char *name) } } =20 - if (cs->cc->sysemu_ops->monitor_get_register) { - ret =3D cs->cc->sysemu_ops->monitor_get_register(cs, name, pval); - } else { - ret =3D target_get_monitor_def(cs, name, &tmp); - if (!ret) { - *pval =3D (target_long) tmp; - } + if (!cs->cc->sysemu_ops->monitor_get_register) { + return -1; } - - return ret; + return cs->cc->sysemu_ops->monitor_get_register(cs, name, pval); } =20 static int diff --git a/stubs/target-get-monitor-def.c b/stubs/target-get-monitor-def.c deleted file mode 100644 index 394e0f9a7d2..00000000000 --- a/stubs/target-get-monitor-def.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Stub for target_get_monitor_def. - * - * Copyright IBM Corp., 2015 - * - * Author: Alexey Kardashevskiy - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, - * or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#include "qemu/osdep.h" - -int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); - -int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval) -{ - return -1; -} diff --git a/stubs/meson.build b/stubs/meson.build index 2f4e1ab4300..3489b1f20dd 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -75,7 +75,6 @@ if have_system stub_ss.add(files('igvm.c')) endif stub_ss.add(files('kvm.c')) - stub_ss.add(files('target-get-monitor-def.c')) stub_ss.add(files('target-monitor-defs.c')) stub_ss.add(files('win32-kbd-hook.c')) stub_ss.add(files('xen-hw-stub.c')) --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277445; cv=none; d=zohomail.com; s=zohoarc; b=ODexQyzKZayHKxGvq91yRvfrFHLE2VBPRYrxyDs27yWb9wu23riKSdGm3++DhTLW6U6Am2Gh4x1Syjnq1sBGYzebipZUdDPWb1w/f0sDt8w92Vml2XzRpifDRigxXuL9+XBYp0K4yxDCl5Yy+gdc24JVC3qdFQQNc2/l46cNMew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277445; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=HQd4kWlVL3tTuUUEKzzbm5wkvsPG410wtgsY2aydV/I=; b=UoSpAlx/KINdKEU5ia/Hp2QfDlutEPlt3U7zEzGaiI4fAEHeX8A+3+W2vtuunV2SQcRGkLNQ+k+ijiq0FRIqeeytrwaLsl+T9HYg30HhEtGLyWxhm+oVA+fZ185w/mKfJM4u+83gsiYPQeJu3B466fBopcsxodXtsZSbmV7GkA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277445219191.65979216031178; Mon, 27 Apr 2026 01:10:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH2n-0007IR-0e; Mon, 27 Apr 2026 04:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2m-0007Bw-0M for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:16 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2j-0002TP-7d for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:15 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-48896199cbaso98654235e9.1 for ; Mon, 27 Apr 2026 01:10:12 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a4b329542sm856930445e9.3.2026.04.27.01.10.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277411; x=1777882211; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HQd4kWlVL3tTuUUEKzzbm5wkvsPG410wtgsY2aydV/I=; b=HpnP6B4lSgWNfY/dMvsTmCiZxr8ZESgCwH2xTd8rTEechp0y32jyC0xelF9PYep//S WJvwDmzTVccb7hVC6/YmeMjhjaxBvjLuDax0ZKe4Vc9juZnhVzoC5JfM79LFc2fhsQ1L yjipzvkzFXYotCyhqpEB4fZqUNBgo3zwYKR4Md6Xr8JKnbNaNW+ZYs9Nd1M2/RMFX38C NDdrN9uBGbwOM6/EHj0frEDae/5sx4SIT/YcuOZkKCY+traeOuHFavAmEgPtYfrSxaew Q+hRpjNTLpCIUxntMosf+UUdO5t/0DN2xPxHF6hB8BMsyn50lwzQ1aK7JK8nbhkUJNgT GLVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277411; x=1777882211; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=HQd4kWlVL3tTuUUEKzzbm5wkvsPG410wtgsY2aydV/I=; b=WTcFNRxryazDiFVAJBp1LpmQn83WBBPYGwg4PEYWDwXd+iPJ0tnfBzZm4jcaQDIGdp S/+uNqZl3qKNiqcPDiXagg3EZmes6iUIJBjTWnmsbrBN0RgUY0bBtU1Oo9UYqOYEbiDV ztb1Rc/3or1nVs9ivzW6Y9Q5mSyRnykXv6USMTQDLIgIcRkxf4wuJP1uLISoKxQFOHrV 8L3+xYZ48Y83s17rLaDScffIoKR3HyH7Qj/TlCiOoUmAzYoUTf/xPAVIxBjsATvTrRa+ WvOnf5YVIqRWJF81HQI+PpUupwUNPDCfEgH9E7Kc33nyAd63XmuMzPpF74yWrjwXer2s BBgg== X-Forwarded-Encrypted: i=1; AFNElJ8RhqgvANpkydVmgNYjyIywCwC59CVKlVN8NRIQquambyNdh+C6J/dDVj4RpSuQNC/+SJtPueEUBUX6@nongnu.org X-Gm-Message-State: AOJu0YzrYtm3MjvyPF2+anqqrHungOPrrl3A0WHFPou7CJXXR4yeWaev sy8uhWyF/xQ3BP4hM7paqcZKkxLNNEVoaMDNYOSfJPlkjBNcfwldd1ivyyTNEh0qVaTc0u6cPq/ 1hhxgeCo= X-Gm-Gg: AeBDievj/jl4zpg3c+ynn1LmsnXkWT3qJj4OiUHPCtvX9DxboTzk7SxaAZhPOTGjEpA ZbNR/C4PR8guhJhFTZ2MOeko7u8glPbtDNlP+koGsTvht6yMY3ZXQKf7MRW8Sm73bxYi0QKcaTz E08/giCuhsIBTriRpDUynz/p8qqleXXH1ygYLUQ/PoEJBb7roWWAA/P0KvgJ7NYqctKHzZP7rc0 TtT46JcN6UIv2W4Ac4yu+qtmz9DWD3br/n4XKiXKohcs0fnzuZ9Omd/lMrMDYcuuDvhaKkIRWss OoMj+OoZciBJE6YvbCLhWDFQEdxOmdQoQZRRObQZTpUY3slfp6e4ygnIqci4nUnjWDHbyfX1egP apybUea1QDcXLiva2eC/csyNtUFQHdUXmL3tpsJON1rOJMZsISrM+8UsDsJUzp6A/jJjoErnovg 2C6lBCUJ/8b6Cjghi7VVTFP1Bt6LqiEO7dn1IHOX3uyEfD25L957gjFJDzbsJBylAqUAmxrrWiK G7sUzTtjaI= X-Received: by 2002:a05:600c:5246:b0:488:a639:b787 with SMTP id 5b1f17b1804b1-488fb74fc0dmr600756645e9.11.1777277411297; Mon, 27 Apr 2026 01:10:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 22/32] monitor: Have MonitorDef::get_value() always return int64_t type Date: Mon, 27 Apr 2026 10:07:28 +0200 Message-ID: <20260427080738.77138-23-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277446543158500 Simplify MonitorDef::get_value() handler by having it always return a int64_t type. Let the single caller (x86 targets) sign-extend the returned value, directly handling 64-bit CPUs in 32-bit or 16-bit mode. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/monitor/hmp-target.h | 6 +----- target/i386/monitor.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 008c1a6570c..ae34ca65ded 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -27,15 +27,11 @@ =20 typedef struct MonitorDef MonitorDef; =20 -#ifdef COMPILING_PER_TARGET -#include "exec/target_long.h" struct MonitorDef { const char *name; int offset; - target_long (*get_value)(Monitor *mon, const struct MonitorDef *md, - int val); + int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); }; -#endif =20 const MonitorDef *target_monitor_defs(void); =20 diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 977f65fe16c..98df5c7fd12 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -593,11 +593,16 @@ void hmp_mce(Monitor *mon, const QDict *qdict) } } =20 -static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *m= d, - int val) +static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md, + int offset) { CPUArchState *env =3D mon_get_cpu_env(mon); - return env->eip + env->segs[R_CS].base; + int64_t ret =3D env->eip + env->segs[R_CS].base; + + if (!(env->hflags & HF_CS64_MASK)) { + ret =3D (int32_t)ret; + } + return ret; } =20 const MonitorDef monitor_defs[] =3D { --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277483; cv=none; d=zohomail.com; s=zohoarc; b=P30tb4lk8DWPYi1m6OMG9M2eNK5kh/sgZTpGK93jyIpMBFDgmT294t319Xb7f/iyh1AZuaK9lAOqTC5jHGNm3c4dw7Bc5OyO6r/4yyJ9s0BUn222l+ZimrrGa6TfJXkZQjaOuOGu4DMdcyaCB399QvKHWpm+Qf+I8J5eXZRY76I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277483; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=FEYVG77IATzxHN9K3rUtTEhkQ/61nsqF8+QMsN3xQbQ=; b=eQ11y+dMI1fFnbxhAsS6S2QnPUPV2w3SVWMGmMPRz4ojvMcjx8Yl+iC3BYeljBuVvbNi2dpNyT9nZrDiQH3ZpgjcmC+Xj0fwix3+C5wIOhJz8bZ7Tlb0wIxm3E3NO2fMSUF4sSzHMPiJQH2HCDb4fwRSyGXmdqHBNfleDwyz59k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277483602758.8429905819197; Mon, 27 Apr 2026 01:11:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH37-0007pa-T8; Mon, 27 Apr 2026 04:10:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2s-0007iw-1I for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:22 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2q-0002We-2S for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:21 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-48909558b3aso98954845e9.0 for ; Mon, 27 Apr 2026 01:10:19 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a52d232afsm162750135e9.31.2026.04.27.01.10.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277418; x=1777882218; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FEYVG77IATzxHN9K3rUtTEhkQ/61nsqF8+QMsN3xQbQ=; b=Uc8C1DgqWPsZqioqAaBQGH90WS98LNdP1O701eDwPWd+W57jckuo+7ud5fVZlD/QEZ jUof8KLE+W5rIpDrMVhd8x6hkfuZrfdmGNWVCtBZCjdw/D2X/LF3SjkCA+VVFPcpF1GP TzBKKhslIu2YNb7RUEHUYAkcPUiETG9ejWrtPHCnKPQQpTeYgo5ue+BNylo1y/vuvYFK 5zvS1uUuHeCePfsx3N6Vh5/Hy9Vm9dv0LeoQaU3Ql1Q/I8cm84xL79nVc64R/pjGdcLo Av64zlC0sLXiPXcv1hmlvMxBFOdXc3H+rSmBs4RCHVZ2H0NvJu1v+oaab3fib8DF1RNU PjdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277418; x=1777882218; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=FEYVG77IATzxHN9K3rUtTEhkQ/61nsqF8+QMsN3xQbQ=; b=e7RYnqsAj0r8rmEXmFZ9YlBZeuFiJwmuuGnma+PLPW4vDFx854cbYGPZZTMfRozlRM tl6infX4SPrBVHZgWcArt0rTuPIM64DnKLeS+c3aF89VBjATkc/MPP8YKEP0TYDF5NU7 irIlsAb6DOuFtglpuIzHOg50BFMp64f3z6rOBey4Gl0ei0mWm8jFr1XtpgNZMJE8TF8M Zj6pQkC/i0Mg7jGKPXKZIqIaAkjtIvcs2lNfYBXfJwjG04/SK6zFu6JPxo1KvMAFHzr5 yRKZ8BKuL8pEtaS1V4L8rGIFd+paj1G5QLldrHEVUcRtmKKMi4Ji5SDmulIiiRMihZzN 4OWA== X-Forwarded-Encrypted: i=1; AFNElJ85G3TD48KUxO7Ojeca9s07GJytXFyU6ms3qdVYg5qT+zPZi8GA0NXJ3LDFvXB89OY/zvxbVl2Y8LZC@nongnu.org X-Gm-Message-State: AOJu0YzO08hvHnfYP1fEnuAOBm/U8TBlvuymg8aDEEDsAVlMxRzTdI/Q 7LTPLmsxrTNSrkF8rO2TZxr91oRMdcU+vWfbNk6ELhng3dEE/2xFZwrdghDcqXYFpD85ReOScjA YOwaRd3o= X-Gm-Gg: AeBDieuSpOQr097Mv341ZSk/dHJogW6JTgWOwvwqquBFb87pKCo6/1WiRtlX54CfkNw oxdcRlt4mYbleB0TpBILRnBmWNpDZjBus1S3KQF1H4tHMbjZx1sBf3FIyD+JEr53YQr7k/75Niq GCNZ4B9wrkRIjpPXLlhMProeSEZ4Ou8uEM27DXXALx+ZRwGS8zaCxtrprBEn32FfEcdcPq1Myv2 FkR2OCih0vnQlP3OURIS/Cgqquuu9A1F2K4hYIAY/QV1TKi9kUHVA4JNvX/95VQ63ksCpWwyyPz /q7pjIXU77hQb+xY0CPc0FxyrHV1WMfDWPKOVNLubw3t4kcpQXyKsJlkFyVn1H0PAljKiNEoLva WKiNmEfuQZZ3AgCcEjp3VPY/RHvbk13BPyTTHYOxTu+ITuVQy5QzaXjM/hijEF3NfjMmPC0P8PL RiVkTK+jzrWRkAOXX+tkXq0dJrAYCqrVRA853Ur7bFdgonA/vVAyxnFXJzpK5sZOdmYnimXcJvx ZU2rC9eZSs= X-Received: by 2002:a05:600c:c09c:b0:48a:5363:8cac with SMTP id 5b1f17b1804b1-48a53638e07mr285628435e9.22.1777277418079; Mon, 27 Apr 2026 01:10:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 23/32] monitor: Reduce target-specific methods further Date: Mon, 27 Apr 2026 10:07:29 +0200 Message-ID: <20260427080738.77138-24-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277484785158500 get_monitor_def() doesn't use any target-specific declaration anymore, move it to hmp.c to compile it once. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- monitor/monitor-internal.h | 1 - monitor/hmp-target.c | 33 --------------------------------- monitor/hmp.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index eaf9a607783..a5c4aba306e 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -191,7 +191,6 @@ void monitor_data_destroy_qmp(MonitorQMP *mon); void coroutine_fn monitor_qmp_dispatcher_co(void *data); void qmp_dispatcher_co_wake(void); =20 -int get_monitor_def(Monitor *mon, int64_t *pval, const char *name); void handle_hmp_command(MonitorHMP *mon, const char *cmdline); int hmp_compare_cmd(const char *name, const char *list); =20 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index c2ddcd67e51..550a7178052 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -57,39 +57,6 @@ HMPCommand *hmp_cmds_for_target(bool info_command) return info_command ? hmp_info_cmds : hmp_cmds; } =20 -/* - * Set @pval to the value in the register identified by @name. - * return 0 if OK, -1 if not found - */ -int get_monitor_def(Monitor *mon, int64_t *pval, const char *name) -{ - const MonitorDef *md =3D target_monitor_defs(); - CPUState *cs =3D mon_get_cpu(mon); - void *ptr; - - if (cs =3D=3D NULL || md =3D=3D NULL) { - return -1; - } - - for(; md->name !=3D NULL; md++) { - if (hmp_compare_cmd(name, md->name)) { - if (md->get_value) { - *pval =3D md->get_value(mon, md, md->offset); - } else { - CPUArchState *env =3D mon_get_cpu_env(mon); - ptr =3D (uint8_t *)env + md->offset; - *pval =3D *(int32_t *)ptr; - } - return 0; - } - } - - if (!cs->cc->sysemu_ops->monitor_get_register) { - return -1; - } - return cs->cc->sysemu_ops->monitor_get_register(cs, name, pval); -} - static int compare_mon_cmd(const void *a, const void *b) { diff --git a/monitor/hmp.c b/monitor/hmp.c index e881c26c305..618ded40207 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include #include "hw/core/qdev.h" +#include "hw/core/sysemu-cpu-ops.h" #include "monitor-internal.h" #include "monitor/hmp.h" #include "monitor/hmp-target.h" @@ -359,6 +360,8 @@ static bool gdb_get_register(Monitor *mon, int64_t *pva= l, const char *name) static const char *pch; static sigjmp_buf expr_env; =20 +static int get_monitor_def(Monitor *mon, int64_t *pval, const char *name); + static G_NORETURN G_GNUC_PRINTF(2, 3) void expr_error(Monitor *mon, const char *fmt, ...) { @@ -1599,3 +1602,36 @@ void monitor_register_hmp_info_hrt(const char *name, } g_assert_not_reached(); } + +/* + * Set @pval to the value in the register identified by @name. + * return 0 if OK, -1 if not found + */ +static int get_monitor_def(Monitor *mon, int64_t *pval, const char *name) +{ + const MonitorDef *md =3D target_monitor_defs(); + CPUState *cs =3D mon_get_cpu(mon); + void *ptr; + + if (cs =3D=3D NULL || md =3D=3D NULL) { + return -1; + } + + for(; md->name !=3D NULL; md++) { + if (hmp_compare_cmd(name, md->name)) { + if (md->get_value) { + *pval =3D md->get_value(mon, md, md->offset); + } else { + CPUArchState *env =3D mon_get_cpu_env(mon); + ptr =3D (uint8_t *)env + md->offset; + *pval =3D *(int32_t *)ptr; + } + return 0; + } + } + + if (!cs->cc->sysemu_ops->monitor_get_register) { + return -1; + } + return cs->cc->sysemu_ops->monitor_get_register(cs, name, pval); +} --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277459; cv=none; d=zohomail.com; s=zohoarc; b=L6QWc3l7eS9s7aRnx9buEeEEiEpU+2/BQpUYoYTyguw+QZRbBtlfMvZ9Re+6oWSJimQYgS65/dQrwWwHQ/qYjfgCXp/2wJ5uGpqlslo/IJjyw02gn7bpa6TD+04BU8TnMOVmPKLbPy0Uw35d55xK6QgL7yDMs5VE95DWNT+UfaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277459; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=d+q6GyrWBAau8tlLAMlLqkdBys28oid3Y1FUgEt4bzQ=; b=MAn7cT5RYB7P5spKSq96PU4yYdvjjM1IwNp+pfC/0uEKKOBBp7EoJZ+qqraqo5wBnRi9lrnpHg0rY+4PNGw1+oeBgP6JQiJpXqeV7ufCqbh188wVHKCR3+cffcNPX2Y2U+bbgy8Fi3h2ZjSLDnn1M5NjTWP88hxUVIv0R0XCWvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277459362958.9370101946843; Mon, 27 Apr 2026 01:10:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3D-0008A6-OY; Mon, 27 Apr 2026 04:10:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH2z-0007pT-35 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:31 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH2w-0002YS-Kh for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:28 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-43d6fbd0954so7677889f8f.1 for ; Mon, 27 Apr 2026 01:10:26 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4cb1405sm80079851f8f.4.2026.04.27.01.10.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277425; x=1777882225; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=d+q6GyrWBAau8tlLAMlLqkdBys28oid3Y1FUgEt4bzQ=; b=P9m9+w4qxFfWutP7j9EKjqmT0g75jbk2vhLfFUs92vy1djeEGsm8ri3BfnFLLXt02R oBYPXmrLuxT3oWzAIP/0IaMuTQfGB6xGvqdqP5m4AtBveikoW3v3L72iWuVgz3ltH0ND +TO3mvY/RZRTmriOb7MJz++UPlCOe9xbs4QIt5Eo7vAMZLH2JPETncNjkvSalP1C/tkf pRnhS+prQy2jNMuAg4nEhRYguIOKBlPYrpRTCRrLo4lPvRmncZcWI1PWurB6RfMre+4R b7NpykBZTo4G/451Aou3fHWvyddFNnSCnfrLA3egrJrYsGcuXtdyIJbLi8Ri3YTxh9vI W0og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277425; x=1777882225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=d+q6GyrWBAau8tlLAMlLqkdBys28oid3Y1FUgEt4bzQ=; b=BXm04zdAi+BRcgVewTnRPsU4dtovKs4etxJoEdbdxSnONK6WA3g/+lfXANgqdLTK0j K37yECLgv1m33Y+YkdmAQ8StupTQ4pfA+rsn4ht+9jx4jHNSJlL1QaVFtwYJplKrR8jk W1f9CZL3XMwSICGV1LuAGKZ4kxZfpsulqInvK2HQW7qxZHKLq49cdw/YFfztq/CPVN33 AiMU+gVl9u2P7g+e5ko9f/pSG/nY3UJ+57YLzcIer0Z3LxkQacsy7uWY2fEhWB5bT6z0 hx999liOePpSGI5k5y6nFm8aOdEtwE7T1cykJs89EZ0NvzMWgYGSC2gEm1FzUaVtdhlM xR4Q== X-Forwarded-Encrypted: i=1; AFNElJ89wcI7FcNjAFNI7xldf8oroUbaxmNFn4xWqshjZ8PI260OatS+mMTqCQZU/R/w0x5lW6T4aLFg+h09@nongnu.org X-Gm-Message-State: AOJu0YyUkVv5/aYO33JsblUzc2NwgF4yTdtgxD6Rk1wie2lbN5tcnav/ TVajL9ilDKdnYFLJF/NOBPjsySjyhkMBQCMd4vV/9wgMLQTccC1nDgpSX/71qbtfw8D8E3ziUqi UofK327A= X-Gm-Gg: AeBDies6kppvS6n6DaNNVwBR+9jf/ADRWvsIZ8pQQ41nnrDysf59Don1PeN5dByc6/0 4b8TX/mXe3NBxB/Mlo3Z8Wi6b/A7XncmQzo7aqbFduK47YKD13YsLXT9/RgINdn/eD9+AfSwRfT xsumEQJnWQAtYRUgb1NUzkpcJeGbwM0S/AomRVKuR1MCgtnExoRpo3Vs/aGFYv0xE3a+EEkvSqO iJ+/9ApErC1WAVh7JJa7UOkXkIuw5ketibqLtXI3qmi1PguninorB2S/Igy2K5hQi0vhAve64/2 wrBSM1m8d3MPeF7o9Z3skVWcfVI3pxrbJBFAjhARhOIEHIfzzMQgS3kuehvTfe2bnAEKFX6QJg8 kS35L37DmLgyW64IEPGMf9Y8u03U6Hnk9hVcIbaL5lgfVHWamrqmG3/2UrNnKexYTGuXAREXgPg krYugbimOtDOCDhsQfcchVJB4RXppBCd3hp6nhM0SFj/iBCywZaPowuB5OR1747fsNdl7Ek6e27 b/B4i0IRPA= X-Received: by 2002:a05:6000:290b:b0:441:1fa5:457f with SMTP id ffacd0b85a97d-4411fa54aecmr40295191f8f.28.1777277424683; Mon, 27 Apr 2026 01:10:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 24/32] monitor: Remove 'monitor/hmp-target.h' header Date: Mon, 27 Apr 2026 10:07:30 +0200 Message-ID: <20260427080738.77138-25-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277461270154100 The "monitor/hmp-target.h" header doesn't contain any target-specific declarations anymore. Merge it with "monitor/hmp.h", its target-agnostic counterpart. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- MAINTAINERS | 1 - include/monitor/hmp-target.h | 41 ----------------------------------- include/monitor/hmp.h | 11 ++++++++++ hw/i386/sgx-stub.c | 1 - hw/i386/sgx.c | 1 - monitor/hmp-cmds.c | 1 - monitor/hmp-target.c | 1 - monitor/hmp.c | 1 - stubs/target-monitor-defs.c | 2 +- target/i386/cpu-apic.c | 1 - target/i386/monitor.c | 1 - target/i386/sev-system-stub.c | 1 - target/i386/sev.c | 1 - target/m68k/monitor.c | 1 - target/ppc/monitor.c | 2 -- target/riscv/monitor.c | 1 - target/sh4/monitor.c | 1 - target/sparc/monitor.c | 1 - target/xtensa/monitor.c | 1 - 19 files changed, 12 insertions(+), 59 deletions(-) delete mode 100644 include/monitor/hmp-target.h diff --git a/MAINTAINERS b/MAINTAINERS index eeb7115edcd..3e797b540d2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3395,7 +3395,6 @@ F: hmp.h F: hmp-commands*.hx F: include/monitor/hmp.h F: include/monitor/hmp-completion.h -F: include/monitor/hmp-target.h F: tests/qtest/test-hmp.c F: include/qemu/qemu-print.h F: util/qemu-print.c diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h deleted file mode 100644 index ae34ca65ded..00000000000 --- a/include/monitor/hmp-target.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * QEMU monitor - * - * Copyright (c) 2003-2004 Fabrice Bellard - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#ifndef MONITOR_HMP_TARGET_H -#define MONITOR_HMP_TARGET_H - -typedef struct MonitorDef MonitorDef; - -struct MonitorDef { - const char *name; - int offset; - int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); -}; - -const MonitorDef *target_monitor_defs(void); - -CPUArchState *mon_get_cpu_env(Monitor *mon); -CPUState *mon_get_cpu(Monitor *mon); - -#endif /* MONITOR_HMP_TARGET_H */ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index a29185741b8..8abe3168924 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -24,6 +24,17 @@ g_assert_not_reached(); \ } =20 +typedef struct MonitorDef { + const char *name; + int offset; + int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int of= fset); +} MonitorDef; + +const MonitorDef *target_monitor_defs(void); + +CPUArchState *mon_get_cpu_env(Monitor *mon); +CPUState *mon_get_cpu(Monitor *mon); + bool hmp_handle_error(Monitor *mon, Error *err); void hmp_help_cmd(Monitor *mon, const char *name); strList *hmp_split_at_comma(const char *str); diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index 2b083c77bc1..59d58926311 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -1,7 +1,6 @@ #include "qemu/osdep.h" #include "monitor/monitor.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "hw/i386/pc.h" #include "hw/i386/sgx-epc.h" #include "qapi/qapi-commands-misc-i386.h" diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index 5e792e8e6e9..7e4c509f5a4 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -17,7 +17,6 @@ #include "monitor/qdev.h" #include "monitor/monitor.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "qapi/qapi-commands-misc-i386.h" diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index bc26b39d708..e81632f5551 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -22,7 +22,6 @@ #include "monitor/hmp.h" #include "qemu/help_option.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "monitor/monitor-internal.h" #include "qapi/error.h" #include "qapi/qapi-commands-control.h" diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 550a7178052..2739383607d 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -28,7 +28,6 @@ #include "monitor/qdev.h" #include "net/slirp.h" #include "system/device_tree.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "monitor/hmp-completion.h" #include "block/block-hmp-cmds.h" diff --git a/monitor/hmp.c b/monitor/hmp.c index 618ded40207..d7b2f731def 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -28,7 +28,6 @@ #include "hw/core/sysemu-cpu-ops.h" #include "monitor-internal.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "qobject/qdict.h" #include "qobject/qnum.h" #include "qemu/bswap.h" diff --git a/stubs/target-monitor-defs.c b/stubs/target-monitor-defs.c index 35a0a342772..0dd4cdb34f6 100644 --- a/stubs/target-monitor-defs.c +++ b/stubs/target-monitor-defs.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" -#include "monitor/hmp-target.h" +#include "monitor/hmp.h" =20 const MonitorDef *target_monitor_defs(void) { diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c index eaa10ad2a3d..5599a4675c5 100644 --- a/target/i386/cpu-apic.c +++ b/target/i386/cpu-apic.c @@ -11,7 +11,6 @@ #include "qapi/error.h" #include "monitor/monitor.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "system/hw_accel.h" #include "system/kvm.h" #include "system/xen.h" diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 98df5c7fd12..1befb8ea824 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -25,7 +25,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "qobject/qdict.h" #include "qapi/error.h" diff --git a/target/i386/sev-system-stub.c b/target/i386/sev-system-stub.c index 2ea85597cf9..d97536cca1c 100644 --- a/target/i386/sev-system-stub.c +++ b/target/i386/sev-system-stub.c @@ -14,7 +14,6 @@ #include "qemu/osdep.h" #include "monitor/monitor.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "qapi/error.h" #include "sev.h" =20 diff --git a/target/i386/sev.c b/target/i386/sev.c index 261b6aaa37b..b44b5a1c2b9 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -40,7 +40,6 @@ #include "qom/object.h" #include "monitor/monitor.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "qapi/qapi-commands-misc-i386.h" #include "confidential-guest.h" #include "hw/i386/pc.h" diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index 94bb12833af..be7411edca6 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -8,7 +8,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "monitor/monitor.h" =20 void hmp_info_tlb(Monitor *mon, const QDict *qdict) diff --git a/target/ppc/monitor.c b/target/ppc/monitor.c index 776a76602ea..7c88e0e2bda 100644 --- a/target/ppc/monitor.c +++ b/target/ppc/monitor.c @@ -7,9 +7,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/ctype.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "cpu.h" =20 diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index 3898595a3cb..63806002417 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -25,7 +25,6 @@ #include "cpu_bits.h" #include "monitor/monitor.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "system/memory.h" #include "internals.h" =20 diff --git a/target/sh4/monitor.c b/target/sh4/monitor.c index 2da6a5426eb..50324d3600c 100644 --- a/target/sh4/monitor.c +++ b/target/sh4/monitor.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" =20 static void print_tlb(Monitor *mon, int idx, tlb_t *tlb) diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index a60671a60a4..99abddbf1e0 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" =20 =20 diff --git a/target/xtensa/monitor.c b/target/xtensa/monitor.c index fbf60d55530..2af84934f83 100644 --- a/target/xtensa/monitor.c +++ b/target/xtensa/monitor.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" =20 void hmp_info_tlb(Monitor *mon, const QDict *qdict) --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277493; cv=none; d=zohomail.com; s=zohoarc; b=PDgTMq9T4YlSCG3G9FTy6goI+e6gSK9YCMZYae3t8J2GEBdnqHRft7pMrby7d9nsZ7vUkmZkfMBKehfNnEvxRLpgBKlZbDqjPEX0FEGEk9m1PCRwmUIJ9wvdKnBkqf8qctXKbsbiIfPyCVDuaVkyXP1I+D4X+vKf8E8RRDtMb9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277493; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=/VyMpbZZBycD9uof5+Mpu9kfOlAUg4ZoswdMUmEvtEU=; b=XKso1PWPQu+ozvCwOBu5aD1+qFJYF2HImCQfDOumObThIl75czu8c69MySuwI7SH2P3y8ESgn6RibGP+gd4Klco4sJpUSXxXKWshIYOMF0BEePSeZcox9MIcV+h10J9pXQg9o1OyVKxd9sCFFHsyhZaX2mwayEcW02ekUV4T/P8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277493945526.2496084658956; Mon, 27 Apr 2026 01:11:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3F-0008LC-Lb; Mon, 27 Apr 2026 04:10:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH38-0007yR-58 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:39 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH35-0002b6-D0 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:36 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-48909558b3aso98958715e9.0 for ; Mon, 27 Apr 2026 01:10:33 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7bf7besm280894725e9.34.2026.04.27.01.10.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277432; x=1777882232; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/VyMpbZZBycD9uof5+Mpu9kfOlAUg4ZoswdMUmEvtEU=; b=vIpp4t7VkMzVW+R+oE4YRUXLC2z7owgFIl6fqZTccFUV0ljJux1pJYZhkWeJdeYLWw LzHxxD38E9TGEz7cm1Z4xQD8GmsOdH3djdTkaZ1KbmDUEquUVCCghocLhyISAZMf3RXD mjrbNxJcF2yvCiIr1vgkWav6sVC2sE8lnWP3wZ0BpM+jb/nC8NlaZIVWWcOu6AkKirLb ZaPs3+ADJF3vv0MbxyyAZWbqhn0mUyXgemxH/1oCrTQaFcttNqMKvHvrDRj/PmmpcVKM 28rZGIGoEOL6c9j2+zQntEyT3usbFAN00CdQjNem/ryVoMTv/C0mRJjZaGjI4kuvTsq/ 9YkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277432; x=1777882232; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=/VyMpbZZBycD9uof5+Mpu9kfOlAUg4ZoswdMUmEvtEU=; b=q8F+ybM3+gUqHw6MjvqM7Fvvyle2qCY5YWFl65B/VIGP1D2WntVCi0j0Usw2RN+y7t jFPdKbmZl1SZfP1DgyY+kAlnI1he4xxGwOJ9CTSnc5/8s3yfICsipZCe567DodqgFBr+ l7HGa4fJt06+O05nW8hMZZgwbaRJznIdMK7gC3cugOiX6OXs1RF0v6x/htfIUHtI3umO s+a+KTG/J5uyEKoKaIlxIC6FGaCvIUY20nsEQi3ETIf0rk0oiTvDOWYEswlkVfzeAez8 KxCCvqFdGrQHAbMm38DnxpPkVrYYnzQHaVTdBFO7bDafLvcCM6EuVlbfQvj5SGCrCuuz nZPw== X-Forwarded-Encrypted: i=1; AFNElJ8Jgb0tbXPOQJy57LqMj36Wq8tQNrDqH9+NU652+o13fO9sKB1JtrkS+StQY1fbU7IpT2hH6FQl6L62@nongnu.org X-Gm-Message-State: AOJu0Yxnag+owCtjG7/beDkr8ONhzPlPsRfctS38YILThW9Ju6po+XZT SFGagPjNgfT9QvIQXWoamkso5Q6KlNgKUHZKyPbFyU8qUrVlI6hC0SRHyIIFYNK/++g= X-Gm-Gg: AeBDiev/qbvI7bIQMfVm0FNbYN/cgJRIeB1YfIkkE4gT+IJdW+uwjAdLaZQ81VzzrnH NNjzvKdofAUvem/uNRmNBLI9dUz2ptL8dBkJf1TMQQVGZ5aFSSs1w3QsXXkC0pbdC+fM+eH4NMX 2m9pYb1w9w6GR2NkZdAx7gyUq5417k1WKMMTrWajcp3uqEnsF/y7KpPUDbFt8LkgKSwpa9uBIwu LHnWhdQ+/tiFeDpjK4Q49dpXaB/iA6LH35QlfsdPpXGOecY4BqfK6ggdtzLZ6CRlIOPuaxHidG/ M40cYhK+a/T0F6tqGH+VEFiMolvBlkpG9yImQFBYRXjp76Tf3MPh7srYi6YQqXHK0DtCnIZ/zTI sDe+Fqe7C/uMVnAvwDZqIqq3mTRGVTsNDF38f0V/c+rk4B2gSLA68maAA10ZESRX/wf6MDbstOy nXKPjAuLgwZJQJnJLDKjBZW+oDxY2lCxkYaLy4g2F8U5biiPZyLH77fsH3ZHjyWDT2G5IUK8JnD UTg9xmFitE= X-Received: by 2002:a05:600c:37c4:b0:48a:5501:7995 with SMTP id 5b1f17b1804b1-48a55017b71mr410419755e9.18.1777277431729; Mon, 27 Apr 2026 01:10:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 25/32] monitor: Forward-declare the MonitorDef type Date: Mon, 27 Apr 2026 10:07:31 +0200 Message-ID: <20260427080738.77138-26-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277494774158500 Rather than having core header forced to include "monitor/hmp.h" to get the MonitorDef type declaration, forward-declare it in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/monitor/hmp.h | 6 +++--- include/qemu/typedefs.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 8abe3168924..22784bd4c79 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -24,11 +24,11 @@ g_assert_not_reached(); \ } =20 -typedef struct MonitorDef { +struct MonitorDef { const char *name; int offset; - int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int of= fset); -} MonitorDef; + int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); +}; =20 const MonitorDef *target_monitor_defs(void); =20 diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 416a8c9acea..07f2ae7c9f1 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -72,6 +72,7 @@ typedef struct MemoryRegionSection MemoryRegionSection; typedef struct MigrationIncomingState MigrationIncomingState; typedef struct MigrationState MigrationState; typedef struct Monitor Monitor; +typedef struct MonitorDef MonitorDef; typedef struct MSIMessage MSIMessage; typedef struct NetClientState NetClientState; typedef struct NetFilterState NetFilterState; --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277492; cv=none; d=zohomail.com; s=zohoarc; b=PCFHb9uGNlk9NI+rAVVhGrwkNjbLeDt/mktDm/+AsyIK7eWXguGDWkQiKGluwwrcOgXuI02dfh8T4FHhFz5Eg2iJuY9Hv+JY7BM/9f//gjba6ENm/+F9ozPh6p7jHx1t95VEzd0vFkW7CBHZqTVXHaE4R9gy8ijBcnP4IeNaHYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277492; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=CX4HMtCLtaKxWP+CnhHEeurJGMT23nAqgS5xqErMf6U=; b=U3NarfM+AAmLCRaVe3v59Gyip3yKfcfiXNGbi3BIQSX9zg0mcbxGBxmBmzSW1lzAUGSrX+INmhAhZHnZmzusx1w1zY1qIkME4w1UY+9EDUwzYHqhI0I266BjFPmDmj4aQMj+yWrmM88deLpxnb83kzOkbh+EDRswqgXPcrYbYFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277492717434.8890547624553; Mon, 27 Apr 2026 01:11:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3F-0008OB-U7; Mon, 27 Apr 2026 04:10:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3C-00087g-0T for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:42 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3A-0002jQ-6U for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:41 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-488ad135063so90591685e9.0 for ; Mon, 27 Apr 2026 01:10:39 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc1cfbf2sm813858135e9.15.2026.04.27.01.10.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277439; x=1777882239; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CX4HMtCLtaKxWP+CnhHEeurJGMT23nAqgS5xqErMf6U=; b=kuNWx5cmwiMbTjs01Aw1rnjiR9pST/+QTRKfG09bJg4k/WdpVVs2fO7ysHitrWQ+CZ dOZZkCTA6pP8t0E5+ILpuc2H3VuV7ByNcdKPELmYbBD6fCWLp9/1shswT5qv55xBSfxd Eng3yIO5PzX8TzXX4tsbVXKiOL8qK7qbspoPWW6dc/fI/WPq+yEeTcp6ifvEwEXLujp5 NaV3y2/3fdryafGgIByJUaAWLAyU7PDNbiX8RY02bOMB3wEJ0SrbDwfwe7omNCeON6ID v3NQSZk6LfAue5ilus3utqVmFJkjfGCZotZ6+oG/pF6Ai7a86SPJyDZm29lwwrjIFEZd xz5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277439; x=1777882239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=CX4HMtCLtaKxWP+CnhHEeurJGMT23nAqgS5xqErMf6U=; b=HUMuO9/XxEFFi5VuACX1de8qTL8RdNDD4gTEEsoys0ZBOmr8YqHGxRuP9jS5wLxaT5 G4NauphGGs3oDBk77NjY4zwNrC8tMaY/8pjMUfZpmFsh/ZJRqmQiUWZHHppvNmGSf/do KSBOWLD+Sa9+IXDToFAdiVPkdMFeC+BgqNnWrxU75qPoITtSvezThBhrUXjI0mPuBevq v6m+cCZCTFf+Pi0gSX3UoAVVDJpjJ0M8fdXgjlbBCnbl02X+o28eDOWGDYy1NTjXOpu4 EFNxpWcVQYdKq33OSeSUGUsS4H3aNn/Q6isSS0nsfoJBNtNnr/l8l3gj4t9007ZRasfY SOAQ== X-Forwarded-Encrypted: i=1; AFNElJ+0UGHOzrn8fB2PxYG0chQ6UnRnzgqfPBEmedMGvSp46H1NGqbTv89aKzpXUS4Ui4sJK1ch8QVVWU8x@nongnu.org X-Gm-Message-State: AOJu0YzbBGshRg1vzoN5L7CHNu72cH9BjJaH4/H+bHo2w0NEQruEFdut f2WSywF3/kNQ8TiYiGz80g42aPEGF8M6eQM6Xr+FfuF8C4ztIBDyksEQoYKQSyQOUqGdk1GRubB ha8CgtfI= X-Gm-Gg: AeBDieveWLDv1u8pv48AiAemh2+qqpBZyf21G+wzdzXSku7T2j9gH7pWF8wo1ggZwDn BpLf/8h0Y2jTW1//LUt1R77s+1r9KcDq0PzEUowaq7mMG7fNlPgYIs6oOGpLCP0vUpKgUOjowPZ 9w5eqJvZelNKQD0GtW3m8nUuJbp3NAtTLDpiHT30mKAqrJvzvtCh79tbmOOxKPAByOJMPU5SFvr MrYcw4DFM5sNLSfqeUWUeUZHV2WoH0RwcchEoX5LF1VASsQPu/V8EbwiQTVVbxrn0guEFMIcvpx hoXJBFlw/isI3g0MR6yVS82vuTxlbaN6THBHCn6/oAvH5W3H32oxLsdJOrGM0uNtfbONKGHYKD2 FTJR5ERcrZVity8YaKIkXnYeFpuWQGgd2A+XWyLKyRGHL6PIWsRND66PuDYLRkwOlnZOOoI6JoF KT1MaUvRSwZ77UmXm31cGpKEAuRNF3NazP9+BSUr4lsgAKCXzZqVaMXMd1fIM6artRIpkEwUl38 i0anB1hcxZ7y+R1lMxGhg== X-Received: by 2002:a05:600c:4e4f:b0:488:ab37:b442 with SMTP id 5b1f17b1804b1-488fb793c6bmr605724035e9.28.1777277438510; Mon, 27 Apr 2026 01:10:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 26/32] cpus: Introduce SysemuCPUOps::monitor_defs hook Date: Mon, 27 Apr 2026 10:07:32 +0200 Message-ID: <20260427080738.77138-27-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277494794158500 Allow targets to register their legacy target_monitor_defs() in SysemuCPUOps; check it first in get_monitor_def() otherwise fall back to previous per-target helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/core/sysemu-cpu-ops.h | 6 ++++++ monitor/hmp.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 5b831393cf4..94e36ecdd18 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -93,6 +93,12 @@ typedef struct SysemuCPUOps { */ int (*monitor_get_register)(CPUState *cs, const char *name, int64_t *p= val); =20 + /** + * @monitor_defs: Array of MonitorDef entries. This field is legacy, + * use @gdb_core_xml_file to dump registers instead. + */ + const MonitorDef *monitor_defs; + /** * @legacy_vmsd: Legacy state for migration. * Do not use in new targets, use #DeviceClass::vmsd ins= tead. diff --git a/monitor/hmp.c b/monitor/hmp.c index d7b2f731def..70e5e5c2367 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1608,11 +1608,15 @@ void monitor_register_hmp_info_hrt(const char *name, */ static int get_monitor_def(Monitor *mon, int64_t *pval, const char *name) { - const MonitorDef *md =3D target_monitor_defs(); CPUState *cs =3D mon_get_cpu(mon); + const MonitorDef *md; void *ptr; =20 - if (cs =3D=3D NULL || md =3D=3D NULL) { + if (cs =3D=3D NULL) { + return -1; + } + md =3D cs->cc->sysemu_ops->monitor_defs ?: target_monitor_defs(); + if (md =3D=3D NULL) { return -1; } =20 --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277466; cv=none; d=zohomail.com; s=zohoarc; b=E8SHpRkyfU+2Qo2Yhsit4r+83tQIZHFKjaDegdpmU28K6aumNJ3CaFuKiMVXICSTgTVaQw/dHEKGfFOe7d/0Tw3pyO9oS9aENUESSBd4JzMzZ8zN2m7VbYvv18bmg8Fdw+GcnHEQrCPwbdoVc0SDIBkDwyHKjpOSDo8NIo/7C5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277466; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=5IB1vvAJbcMlRA4A8vxRuUp8fkqXSVJfJBJpe4/kUNg=; b=cZuWS+AJP2O1Se7eGzBgX8MRWDjuBcaWh/db0alPUPNIt93M8qdrwdcevt0h5vwj5aKVNgAt43I4P3QKrGyDiTAnBh+jlPQYxhTdvj40gj9RXSz6tJ96GnFI1pgnKJcloe7rykzgngzBeCOuLl/Xt3RyxC2jp/lx+xWxEh4kBgc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277466159872.3956686511075; Mon, 27 Apr 2026 01:11:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3N-0000bT-IC; Mon, 27 Apr 2026 04:10:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3J-0000RU-9K for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:49 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3H-0002ku-0m for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:48 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-43d73422431so9153233f8f.2 for ; Mon, 27 Apr 2026 01:10:46 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4412e36ff8bsm29899843f8f.26.2026.04.27.01.10.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277445; x=1777882245; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5IB1vvAJbcMlRA4A8vxRuUp8fkqXSVJfJBJpe4/kUNg=; b=ufqed5MRXbNEvkbLcavnZJHWqEeNoCUVkqtnVsV/7ku3Oa9JYDMzcDJnGw+QOiJdHa ItfG8xm8MJkEJmJ898lIn/W87A+3r2LNokHGhQsXyrgXXtCwg1Bg9eDr3UpvF7GsnE9a FVKeUjP1j9o3d/ZyEShoBZ3sjZXNseBotZpr6Bqa6YG3JjqFmYMP4yNNqtfDKWbzgZ6Q KFJMn8SYr0p6ExDO+WHxU/yFBfXN1u2AY9fBHQEixjFHgETlw1jjnioNdmYYXAf7WrBB RKbHoAfPmWni61bTqvaFp7uQHSVLQN8pOiBRlL8dEXakT2FPlfticS0fDQFci2VzrZN2 ZdFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277445; x=1777882245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=5IB1vvAJbcMlRA4A8vxRuUp8fkqXSVJfJBJpe4/kUNg=; b=X2GKYSXfo2Gx+DJji4GzCK3/Ih82n8zM2iZN5i9sWddBpOl695aWgNuOpv35nKPTtX sXfN9nZlRc/Ai5/EHTxMm/xkdifMjmvT4McMMT/KJyQ5TzSPAEerDOWZ46ea68d0IhjS KMvzcjD9gOWR94iOZ1XVANl2fwQkjs/6D/NW82mvw7kHQgfYcT1XdRAOzuikEu+G8xi/ c3OKn3Yg7RXudggWuVyx2ZqcyhWvqcmuX1L8nc8w4jJ0rqKOaB/4RUhVyeGS18kulGwh rAu2QADvdO/Q6IJU9hSHnl/pi5KVUrWTvs+Aiw0vp5/CL+Z6il8+HlopZTELzzOFtfps VYMg== X-Forwarded-Encrypted: i=1; AFNElJ+7CC70GOn1HpRRBRE9wal3N0NCpTNe0SW7tILu+Ush1mO3gzlPLj2hgOlyoZoP1GQ3DSEAeE5Hg0Kq@nongnu.org X-Gm-Message-State: AOJu0YyxRJDxgOnqJsZvxId9qdPzYmK3G0kQcfAH2NxWAOb7wN9bcaf4 7d8WaU1WWV0a8xwBlY60nv4MjDla6uwS5E4CbLSbozD8Hx6Zav+/p+dv0/MdB7qaGtDMoI7D8JH 4S+PdG7I= X-Gm-Gg: AeBDievpyfJAOjRs1TwXquIqYOM4vPTsJ/otrITQNjk9Pw+amJrA0ecfR6akAhQwQyv Vx3hfd+7pTlch/DZGDw27faLhR5OtnI0qq6pnhYkzoAuaNYPD87ebBd94EFjZ8IhJWrmK81+AgU 32zLlF4VfjW9RGGkZoa9/2I1hcdEzX1uQfIIRY20RcfDWDLulGs/XNWY+859bYfy5V3VqaWY5s2 yDdAe+xYKTQcpZ42ei0p5YxEFXG0RHuIA3DflHPYz5/u07Ig/OqFDnmHmSMC8jse0LiP5Px9z+k PE3ysY1TXeaXjnQN81icI57VZ4ApADjWTbAHl7W29H3AbNwcV6n1qwfm3fBJ4ZagcCORDrVBPOC tt6hZj5lvASUkMzEo5Vdb2Dtc4Nav23sRgNGZdNz8MjvvEfUtTs34vI5NP/LUZKxwZ13vIARIlw mNhIYw0MTKMlTQ3isIYApqMQ91xwdycmRM7HSmbTPiu3c5MBDwPpA1jWKWMJSr/OW/83Rvx2yi/ Ldtf++wGiI= X-Received: by 2002:a05:6000:18a5:b0:43c:ff58:35c3 with SMTP id ffacd0b85a97d-43fe3dc818fmr65953027f8f.10.1777277445162; Mon, 27 Apr 2026 01:10:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 27/32] target/i386: Replace target_monitor_defs -> SysemuCPUOps::monitor_defs Date: Mon, 27 Apr 2026 10:07:33 +0200 Message-ID: <20260427080738.77138-28-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277467121154100 Restrict x86_monitor_defs[] to cpu.c, register it as SysemuCPUOps::monitor_defs hook, allowing to remove the target_monitor_defs() method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/cpu.c | 29 +++++++++++++++++++++++++++++ target/i386/monitor.c | 30 ------------------------------ 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9d126600c05..d8e102dd1b9 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -39,6 +39,7 @@ #include "exec/watchpoint.h" #ifndef CONFIG_USER_ONLY #include "confidential-guest.h" +#include "monitor/hmp.h" #include "system/reset.h" #include "qapi/qapi-commands-machine.h" #include "system/address-spaces.h" @@ -10686,6 +10687,33 @@ static const Property x86_cpu_properties[] =3D { }; =20 #ifndef CONFIG_USER_ONLY + +static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md, + int offset) +{ + CPUArchState *env =3D mon_get_cpu_env(mon); + int64_t ret =3D env->eip + env->segs[R_CS].base; + + if (!(env->hflags & HF_CS64_MASK)) { + ret =3D (int32_t)ret; + } + return ret; +} + +static const MonitorDef x86_monitor_defs[] =3D { +#define SEG(name, seg) \ + { name ".limit", offsetof(CPUX86State, segs[seg].limit) }, + SEG("cs", R_CS) + SEG("ds", R_DS) + SEG("es", R_ES) + SEG("ss", R_SS) + SEG("fs", R_FS) + SEG("gs", R_GS) + { "pc", 0, monitor_get_pc, }, + { NULL }, +#undef SEG +}; + #include "hw/core/sysemu-cpu-ops.h" =20 static const struct SysemuCPUOps i386_sysemu_ops =3D { @@ -10699,6 +10727,7 @@ static const struct SysemuCPUOps i386_sysemu_ops = =3D { .write_elf64_note =3D x86_cpu_write_elf64_note, .write_elf32_qemunote =3D x86_cpu_write_elf32_qemunote, .write_elf64_qemunote =3D x86_cpu_write_elf64_qemunote, + .monitor_defs =3D x86_monitor_defs, .legacy_vmsd =3D &vmstate_x86_cpu, }; #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 1befb8ea824..a536712c755 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -591,33 +591,3 @@ void hmp_mce(Monitor *mon, const QDict *qdict) flags); } } - -static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md, - int offset) -{ - CPUArchState *env =3D mon_get_cpu_env(mon); - int64_t ret =3D env->eip + env->segs[R_CS].base; - - if (!(env->hflags & HF_CS64_MASK)) { - ret =3D (int32_t)ret; - } - return ret; -} - -const MonitorDef monitor_defs[] =3D { -#define SEG(name, seg) \ - { name ".limit", offsetof(CPUX86State, segs[seg].limit) }, - SEG("cs", R_CS) - SEG("ds", R_DS) - SEG("es", R_ES) - SEG("ss", R_SS) - SEG("fs", R_FS) - SEG("gs", R_GS) - { "pc", 0, monitor_get_pc, }, - { NULL }, -}; - -const MonitorDef *target_monitor_defs(void) -{ - return monitor_defs; -} --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277493; cv=none; d=zohomail.com; s=zohoarc; b=kHkfLcpHCrvvAs4gUgoSC1N0r5F+Kvq3NNVlrImtETxkzVrts0N5zlrvGm6aemWXYI+W9UB5S5jCS8+aj2HNSr/ThaVYNC5wYoHfch07zgHMrxoRqpMnSqix0As7/He1jUVPI5BEXCbK4OK8Yh56HkGON8ExY1jXeEec4PcBI9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277493; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=pWkinHow/eylS7JBe+fWXt/Nq4YrC48hyztEBorpfGw=; b=ETaezZNndQ/M5CmKfzPxOxBAz8Tmk3QxibHct1ifBDuHLVUkmJNE3jTU/pIR6QUnVKQb8ngvAIiXFsUfZg/YW6G6Qn/Iq9c8nlFfMnOxvt706rRo4MjfeUwtqZ3iytoM9lXpjLRlufSRII8GZxngGoz3IwP3B1Pgy7ek7ZDPU4g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17772774935981012.8846338121002; Mon, 27 Apr 2026 01:11:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3Z-0000t9-5o; Mon, 27 Apr 2026 04:11:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3P-0000kR-Rw for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:57 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3N-0002n6-IU for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:10:55 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-488ad135063so90594395e9.0 for ; Mon, 27 Apr 2026 01:10:53 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a5c4b9e8dsm113167865e9.7.2026.04.27.01.10.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277452; x=1777882252; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pWkinHow/eylS7JBe+fWXt/Nq4YrC48hyztEBorpfGw=; b=cs0qNY3z/xRPmuigO1xe6Epwlpll1VlMdM+Gla/DCkf+6dkNI051XFGKGKTEfC1Yqw BF3fosOGAa+nFRFWuZt5EpimPWnXnoxyROAx4vwZea5vKFALBXI+91RdiY4G6MHujsA8 GUDVwAnrtau2GJCZyinYT09PUI6koICc6ATkCrQQwpNwcuh5eYl4vW9xWNzjwEIzQXDv /D/vhrAmK3zEW9cSZ7SOtAalQ3toQJ6zDG15FVeajU7K9nt6dgXFtVm6gyob+JXmd/mE pYbGqTORNiIzMhufv8S9/r3hZMDZnWM4+HjEyrrOwNV6hkpsg1J0uDpO+e4NjG05EPyZ cCog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277452; x=1777882252; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=pWkinHow/eylS7JBe+fWXt/Nq4YrC48hyztEBorpfGw=; b=mT4/OnTWntSm49jvJLqGtY9dnNZI+4Dx7GrduxLdYWE82Zz6aydiYhMdbZTy1hzkgk Imrkt7xWBwmVVQv2/JRhTNl+0OYNvEBy/bqrQ302GpI87QgqBP+FWUCSaaBg1+TZztcg ULROiW/nOjMINP3yZzz1L3pgKa3EvzueRinfUueQWK/VcGX5pyKUfW6pTa6slplMjQwb EvBwArrcLNXQYrrExUaLKaD7gR3+gsN3N+XhtJGsv1i6dqlcRrwZeK945DFIsYVpB000 9p9OOFsXPrC3yF16oaZSkThrrR+BnGE9FBE/7O9A1JM5xbSkRoRw3bz0RXs4mVpaLFlq sI9Q== X-Forwarded-Encrypted: i=1; AFNElJ+dwTTjF7ZBII9ogt0b5/IzqxzAsTZ9Vqzu8MQ3UXxDbw7vvO8cTvE6jbh7LasVO08t12m54bFCW9fy@nongnu.org X-Gm-Message-State: AOJu0Yyjw7gNTCTdbdn1TAYVHygwcFNjhaDusbvgdBFZvvnOjwogJCN5 JYCJqmaLhkslwsASVR1WoPg8/O5swUROOgBL4NDND7dZYeQn7YrEIvS2WAmg6rdoaUc= X-Gm-Gg: AeBDievcJabqJQ5xP4oEO8H1mkVYQtvmoiLiq9DV5db7+nbFO+69u7Zfn4V4v3ZqfQ6 i29DfcOwNzx7ofi4C/eD15TeG1QjNN3PtPnDlYh/sP+BW6uZSb3pCwTIhj04wCuN2FOSsm9+BCz r5ORZ/dhakmJULjSogXwa0cmt6iTr8VA7N+NHtEBz5jZiE4LKy/ul0ZVmCWKFgFeekS+dhvioJP hcxZO/hFq7RkC9O99xxtAvc9yqKqcAELMCYFdX3eNYPVYh1XInrWeb0rZaODdfdGKEv9GcwfeiJ R9M2gU562ngM9pVP3AVtCs9xGGN2Y+yViLONVVdExZDQes74HJdLRLSONF3hdudG3LzPxIGxb4k TYc7WePqQnFRKssmvIaOrbNVyl6Bk8jSPI0lXACmoE//SeoqTJuCEoflNcPjPmoieoSDVo9XW+i as4Srk5ORnU+0NycEUsLquviy97meGYe7RzxUjH/nuAmSVyMhhxTJtL/msBJqKzySdbFPFNK+eV SIc67IsVak= X-Received: by 2002:a05:600c:c0c8:b0:471:700:f281 with SMTP id 5b1f17b1804b1-488fb78b8c5mr430143325e9.25.1777277451990; Mon, 27 Apr 2026 01:10:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 28/32] target/m68k: Replace target_monitor_defs -> SysemuCPUOps::monitor_defs Date: Mon, 27 Apr 2026 10:07:34 +0200 Message-ID: <20260427080738.77138-29-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277494791158500 Restrict m68k_monitor_defs[] to cpu.c, register it as SysemuCPUOps::monitor_defs hook, allowing to remove the target_monitor_defs() method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/m68k/cpu.c | 18 ++++++++++++++++++ target/m68k/monitor.c | 21 --------------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index d849a4a90fc..f704a6af613 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -25,6 +25,7 @@ =20 #ifndef CONFIG_USER_ONLY #include "migration/vmstate.h" +#include "monitor/hmp.h" #endif =20 #include "cpu.h" @@ -602,11 +603,28 @@ static const VMStateDescription vmstate_m68k_cpu =3D { }, }; =20 +static const MonitorDef m68k_monitor_defs[] =3D { + { "ssp", offsetof(CPUM68KState, sp[0]) }, + { "usp", offsetof(CPUM68KState, sp[1]) }, + { "isp", offsetof(CPUM68KState, sp[2]) }, + { "sfc", offsetof(CPUM68KState, sfc) }, + { "dfc", offsetof(CPUM68KState, dfc) }, + { "urp", offsetof(CPUM68KState, mmu.urp) }, + { "srp", offsetof(CPUM68KState, mmu.srp) }, + { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]) }, + { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]) }, + { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]) }, + { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]) }, + { "mmusr", offsetof(CPUM68KState, mmu.mmusr) }, + { NULL }, +}; + #include "hw/core/sysemu-cpu-ops.h" =20 static const struct SysemuCPUOps m68k_sysemu_ops =3D { .has_work =3D m68k_cpu_has_work, .get_phys_page_debug =3D m68k_cpu_get_phys_page_debug, + .monitor_defs =3D m68k_monitor_defs, }; #endif /* !CONFIG_USER_ONLY */ =20 diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index be7411edca6..3e0df40a6b8 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -21,24 +21,3 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) =20 dump_mmu(env1); } - -static const MonitorDef monitor_defs[] =3D { - { "ssp", offsetof(CPUM68KState, sp[0]) }, - { "usp", offsetof(CPUM68KState, sp[1]) }, - { "isp", offsetof(CPUM68KState, sp[2]) }, - { "sfc", offsetof(CPUM68KState, sfc) }, - { "dfc", offsetof(CPUM68KState, dfc) }, - { "urp", offsetof(CPUM68KState, mmu.urp) }, - { "srp", offsetof(CPUM68KState, mmu.srp) }, - { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]) }, - { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]) }, - { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]) }, - { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]) }, - { "mmusr", offsetof(CPUM68KState, mmu.mmusr) }, - { NULL }, -}; - -const MonitorDef *target_monitor_defs(void) -{ - return monitor_defs; -} --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277519; cv=none; d=zohomail.com; s=zohoarc; b=hqv5PlaIZTTufJy+Be3iQlQ+H3OxXldLfpnqCQMXjc+sqrAEVCQryR5Bdx3tPPnar3cQT62o/f7oLFIzkfxtICXCM6gdsvSgqNhnqOKpzkXFKWt2bAr5myx5gj9FNrLR2WRiHFEexR9ed9/lZdDThWHLNaQdUedDC2ag0WsvoQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277519; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=YR1bIQJaEN4irJmFXMTH708rYFQjSQ11tGcPtx2WYz4=; b=nCxPvu50SPZPEZPwX+QGtYE6TvwtWm/J0oIOT7U1mE4kSGAs6OQgg6r1feCY5jA7KXzTP8g0NA92e1Zn4cu1S+Q979lkuUBgFLAaNZwt8eIYVD5vtSsX2NhCtK/RaTR1VS+YXww4rtJQOoJkclNE9oo6tf+oyS3kX4Q3+iZSG/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277519552144.67502897027953; Mon, 27 Apr 2026 01:11:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3f-00019T-2f; Mon, 27 Apr 2026 04:11:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3X-0000uJ-1S for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:05 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3U-0002p3-Gf for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:02 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-488ab2db91aso140724925e9.3 for ; Mon, 27 Apr 2026 01:10:59 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc10777csm877418125e9.8.2026.04.27.01.10.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277459; x=1777882259; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=YR1bIQJaEN4irJmFXMTH708rYFQjSQ11tGcPtx2WYz4=; b=bvnnCjyHdAL2b6drpW1Ch8n0UAYyR7BDi9uRmMJxfuSzpzqJ7mUePtEFehDl3Rw+0Z FPEfL1Ni46Q1m3854+mz7aiepOJMg2ugDXNpcWO0irlAXJV6s5kW5/0isV7wtC2xJl9s o7AcCn7OEJvXiUMa7GbaIsv7sOM3OMecnbqCaPcxV3yfxgAhOZBWwS8mFgNQjMV8HNho xoPsrc1H7zCKMtcOlAaz8RsNgIhytfx++aOLYAcJsQeBpvC7aigO02t54AUAPW6TO6UP Js9QHSiobCuvTLP18ocwJ3oqIkN+fYG/zZjk9fu0uZHAucHm7/bwB2ZOcM4iXdKDHkhn 4WVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277459; x=1777882259; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=YR1bIQJaEN4irJmFXMTH708rYFQjSQ11tGcPtx2WYz4=; b=VmrAllFEtaDfmPFKCgJ9pd94Ysd2nfxNsY99x5yiJWY6mHOyrrrbGnuBF6U21z8xTy fXFpAigY638ayTeR0xznw4uhk1rxBfJHygt+vwTs0SMgJtEEvu0cSs1W3Ajq1e/tKmdv grNMfkdVY9raF9g5ccxqu/cWvYW3Mf4kTSUX4xFN+y1lJ7a7750+/asrmY+rVgTQxrbx VsrCHBr88N6beg0LCMy+gGa/ryhOYk6DycZF7swH3wBHaA21RHpSNKCIumx2a/tnO+7e Cs88HVj9Iag6oGSuuK+tAdfi0/MEBudLOhfJ9NaVIJW8Vg/BXXELt+hIFoK6xdNm1AW6 Tmjw== X-Forwarded-Encrypted: i=1; AFNElJ+QjRij0PCOIwCXfpt+bPNoZnRgqFlOnN96aEk+xiLumKYfsw2rGNOA/4QksFkIUttpdixgAKDjp/ov@nongnu.org X-Gm-Message-State: AOJu0Yw8EiRRZVxhDpFA43Q02qkFywklxRvm5tfiRh5wFe0xqS0WiK+A 5NJfrDp4lB8D0L7bfQikAt7hxZwk87SGPlONBiKiN64J7XSXXg7//NtphHxJVYNx14Sp1fW9uZX M9tPtLBg= X-Gm-Gg: AeBDiesgCPn9pw8zsWVLhtbsZNsIYzG6EWNlSzYGvL4BA3NT0INe5Aj8Q4oUgRLl+Yp zRtFcA2GwMKaDvi/TT6FzVkyiwd+RRaaFphNvG/dzV9ZKwB9MX8Av2dDD93ei6vgk04nAmi7qY6 oFoaW86tzyzLV6aPibpIa0ud9g8scX3Tusk75h0dbWRbuPsq7BsC4KcDFD5Gih3S+X0KqSmOBRr ior2MTGCassVLYRsg0pvXFKbzmF4v/FPPGekZi7MM8CDduMvkSq34FeSnS1Ev9TUdLJPgfcvr4y tfbI7Sx61cB9PJBtnUyqPKiphkPe3z5UYDSufeWWX6qiX8Sv/vVZTBHACMXPK4DJR4pEPZQYao0 lTHInWgiSWr018PhDU5gy493tpv2dxE4Q8PwsYA2GE81Vo7NQNSgElfv7hOBVO9rfSQ4tQBLSZh Ln3qWPa4L0/zKFRUG3ZG0hq/w5HFUKeX2uoVgfuvw9bRWvUU2dccsN9V+8dYfDThkz2Pf8Rey+Y y04dvgEKfg= X-Received: by 2002:a05:600c:4fd1:b0:488:78f2:6b0 with SMTP id 5b1f17b1804b1-488fb78ede0mr591820695e9.29.1777277458736; Mon, 27 Apr 2026 01:10:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 29/32] target/sparc: Replace target_monitor_defs -> SysemuCPUOps::monitor_defs Date: Mon, 27 Apr 2026 10:07:35 +0200 Message-ID: <20260427080738.77138-30-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277521982154100 Restrict sparc64_monitor_defs[] to cpu.c, register it as SysemuCPUOps::monitor_defs hook (taking care to not register it on 32-bit SPARC target), allowing to remove the target_monitor_defs() method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/sparc/cpu.c | 19 +++++++++++++++++++ target/sparc/monitor.c | 18 ------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 77046104284..c6989229da6 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -993,12 +993,31 @@ static const Property sparc_cpu_properties[] =3D { }; =20 #ifndef CONFIG_USER_ONLY + +#ifdef TARGET_SPARC64 +#include "monitor/hmp.h" + +static const MonitorDef sparc64_monitor_defs[] =3D { + { "asi", offsetof(CPUSPARCState, asi) }, + { "pstate", offsetof(CPUSPARCState, pstate) }, + { "cansave", offsetof(CPUSPARCState, cansave) }, + { "canrestore", offsetof(CPUSPARCState, canrestore) }, + { "otherwin", offsetof(CPUSPARCState, otherwin) }, + { "wstate", offsetof(CPUSPARCState, wstate) }, + { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, + { NULL }, +}; +#endif + #include "hw/core/sysemu-cpu-ops.h" =20 static const struct SysemuCPUOps sparc_sysemu_ops =3D { .has_work =3D sparc_cpu_has_work, .get_phys_page_debug =3D sparc_cpu_get_phys_page_debug, .legacy_vmsd =3D &vmstate_sparc_cpu, +#if defined(TARGET_SPARC64) + .monitor_defs =3D sparc64_monitor_defs, +#endif }; #endif =20 diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index 99abddbf1e0..36f3d8d58e9 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -37,21 +37,3 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) } dump_mmu(env1); } - -const MonitorDef monitor_defs[] =3D { -#ifdef TARGET_SPARC64 - { "asi", offsetof(CPUSPARCState, asi) }, - { "pstate", offsetof(CPUSPARCState, pstate) }, - { "cansave", offsetof(CPUSPARCState, cansave) }, - { "canrestore", offsetof(CPUSPARCState, canrestore) }, - { "otherwin", offsetof(CPUSPARCState, otherwin) }, - { "wstate", offsetof(CPUSPARCState, wstate) }, - { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, -#endif - { NULL }, -}; - -const MonitorDef *target_monitor_defs(void) -{ - return monitor_defs; -} --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277489; cv=none; d=zohomail.com; s=zohoarc; b=m/cpMcY0WbMhLTBzCmNXqysTrssh5S6VJ/w+xh8uW6YkWZrVeE3WGVFrSh5cnzAIk6k06sLdEUXBCREjoxjRaD03s8nl89ENsYEA3oWFHj3OCV5REuaqQ2hOMovykIoR1dC0RUbTJSYKk6fb1mzSpnni2g2mw94dcLLusdIlO8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277489; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=5jsZtofjbXJHOZasZf01XJnCpN2qoJicQAKP7JiukTk=; b=YQkNBwrEe6B//MY4xZO7MCMa/ldf2W+dN99i8ai1oDf3SqmUaF2isURwY05cYBKjfio+B1sGLG1sQav+pQd76YVR18x8lbEuijZECOY5TjWIP7cDLWCuw22S9S5tE0KOqKT3D/PgphMmQ38N6XxbaC8CnqoqengkrO8mnuSCt8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277488997952.0265544456171; Mon, 27 Apr 2026 01:11:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3g-0001Q3-H9; Mon, 27 Apr 2026 04:11:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3d-00011g-Rw for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:10 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3b-0002qd-Hn for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:08 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-43d43e09de5so5444920f8f.1 for ; Mon, 27 Apr 2026 01:11:06 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44123d23e0bsm38922744f8f.15.2026.04.27.01.11.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277466; x=1777882266; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5jsZtofjbXJHOZasZf01XJnCpN2qoJicQAKP7JiukTk=; b=ysV6eUVLlBSRJ7N3sg1r3YEsa49oaJCQqymSJHs6DwYLc0V54qPfiNBiDMvXlsSkz5 CVziqpOtGQU3p7XMG9nyymv6sUu1ZfQSEoAwctE/RdtXXPYiyCSScQDsgFRdYcMkdNzs OI0MQSW1UrGEY0DwyBEVIwkAONdFl55nSSj/Uyipeou12MPbkdyb8eKjT2e1TSZjhmKy wy1DfWFGKKojqBvcoz8TXOB4OQXuqb6h9uWdiJ9MGcb0ls2Cm8+MI/FnyJy7G/ZEUcLu He4EupYNKeAEtxCwAXgzaVb7h9CCTqsER4AfmrIlZ7Hc0zVZRgg+8yCVJC9/CUAJBUCx nZ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277466; x=1777882266; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=5jsZtofjbXJHOZasZf01XJnCpN2qoJicQAKP7JiukTk=; b=bCOqZ2iwLp3cTYcUMZNHWTYCGKkNO1mAaUWijZzhaZScgRNM9JjPyaxrmvzomipRDE 4/U00Qyx6Xj4cdiblz9EFZ1uY5F43CJJlUyPcky1Ulrw6atw+z4PI+BxFCB4XBZy+TVf Ms5OQM6YY4c46i5HFu7679BlExBrTHNMp8j873UGlI2FrB1hOh1CXNMOyZIqyP5FJisT EFzBvJyPFWxRyWrANaZJC+Ud1TVIJalb9nI2LWaw/flgIjWS56y07L6bhw1X4ZIcQeNm 5wAEFlzeNU0Ao/uNPqJMaYDHO4ieSR2TErNqadZfOrv8KVcPFnhevJqMiwskoz+erM9f To1A== X-Forwarded-Encrypted: i=1; AFNElJ9YF8iH0mZabf4fAZrnOUa476Pt5XgTYAALilnI31VTnfxGX/9mF+U8If3Vu1IPi/si/V2q29UdLUGo@nongnu.org X-Gm-Message-State: AOJu0YzTYp6QEuokwqhckK/j2majDFo5ZFvDER4T82e76TS8YEmu7YIj zGj3YbVNrzVrqqnfxMzpEfnSb4RVxkdFlIt8Hy/9SUFPnhRpi2wDfWBFuuF9gjh1tnn6ZQq2UZg 7M4OQiLA= X-Gm-Gg: AeBDieu/Nxv96KEhSiuR30AMRNEPTy9qvFUhQGgRurguJzd4vh2NM4Bq/+OJknIGvo8 FDNaazu1kmsKvl878c+4WfRCACxO4CQvptEIDBMw+1ysa99KOmud+PbA91GmoT4d5IU7g4mWi2O BZtxYQgcyuN9wTvsDv0tKpbGZ4VZ8VcKTNt+TJ476uTgoLZyZgcuCuTmI0nOS+JsO5vwIX9uh5N YjtCHXx5jDK9x2O17qQWr9CP1GrxZ/HGjbIsOEPIQjxmaQy94pAa5mHsNB2O/BvyrgJv4w7cG3+ PN+26y3Bk1C+nTN8/CHe8hTyXGoblHfmYGhDOJleFpyQNniSlONd4rGPLaAfgOAOlm8XPVq5mWc EWVJ7Cr48cMtem33zCGYB/eIsOLqIF94cUz6IOEj96J4uQq1aqz9/IHwZcKLr3TYb76YjkPphjm yIMVi1cnqVhwg+ourdX9K/GckCJdo2ZQlC4HtDPgmRtPECQInuJWioK1jxS8KWrg5oDJleSTdbA u0o+/s4NnNsWbadLZJKlQ== X-Received: by 2002:a5d:64e4:0:b0:43e:a69b:d810 with SMTP id ffacd0b85a97d-43fe3e0fe56mr64744060f8f.38.1777277465488; Mon, 27 Apr 2026 01:11:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 30/32] monitor: Remove target_monitor_defs() Date: Mon, 27 Apr 2026 10:07:36 +0200 Message-ID: <20260427080738.77138-31-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277490774158500 target_monitor_defs() is now only a dead stub. Remove as pointless. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/monitor/hmp.h | 2 -- monitor/hmp.c | 2 +- stubs/target-monitor-defs.c | 7 ------- stubs/meson.build | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 stubs/target-monitor-defs.c diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 22784bd4c79..c8ce8579424 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -30,8 +30,6 @@ struct MonitorDef { int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); }; =20 -const MonitorDef *target_monitor_defs(void); - CPUArchState *mon_get_cpu_env(Monitor *mon); CPUState *mon_get_cpu(Monitor *mon); =20 diff --git a/monitor/hmp.c b/monitor/hmp.c index 70e5e5c2367..6d0f5b251b9 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1615,7 +1615,7 @@ static int get_monitor_def(Monitor *mon, int64_t *pva= l, const char *name) if (cs =3D=3D NULL) { return -1; } - md =3D cs->cc->sysemu_ops->monitor_defs ?: target_monitor_defs(); + md =3D cs->cc->sysemu_ops->monitor_defs; if (md =3D=3D NULL) { return -1; } diff --git a/stubs/target-monitor-defs.c b/stubs/target-monitor-defs.c deleted file mode 100644 index 0dd4cdb34f6..00000000000 --- a/stubs/target-monitor-defs.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "qemu/osdep.h" -#include "monitor/hmp.h" - -const MonitorDef *target_monitor_defs(void) -{ - return NULL; -} diff --git a/stubs/meson.build b/stubs/meson.build index 3489b1f20dd..3b2f2680b19 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -75,7 +75,6 @@ if have_system stub_ss.add(files('igvm.c')) endif stub_ss.add(files('kvm.c')) - 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('qmp-arm-gic.c')) --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277519; cv=none; d=zohomail.com; s=zohoarc; b=BKLvaVLwA86zRxdSgQKrsLdQ2yydBC1RVr2EwCy0oFN3jtus/qxFiqAZmAniv6QNGj4agbTO+nkot2nPav4O4NrTVPUxdmEY16pD8u/vy95xvpq3kAJMpwKtuRQxBHzAWqQvFPL1plwooGj/T+jbMSymUND7EcaxGOZyvGEGG24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277519; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=GHuhl7sujEeEFbAkpoWph1gRfoj+IqsXXghTjX/XrLM=; b=ONDFvY41mzQ0dy7SjxGapDM55VAAyXc05bJR5DEW/Lbgrs7NMEIFNbFipar33nDA0fbllnHt7hbU3hxOIo9WcDeyvskCRIZY38ck8+0y1rCFFOyLwSC1tU4yoQ6vc6NXYTC7bluqeHjTEDv7QPqWy8q/r+YFUpTDfCu+rAbCWXg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277519591346.39158686868154; Mon, 27 Apr 2026 01:11:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3l-00024k-44; Mon, 27 Apr 2026 04:11:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3k-00020J-2b for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:16 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3i-0002zK-0F for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:15 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488ab2db91aso140727325e9.3 for ; Mon, 27 Apr 2026 01:11:13 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc0b4c85sm743195075e9.0.2026.04.27.01.11.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277472; x=1777882272; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GHuhl7sujEeEFbAkpoWph1gRfoj+IqsXXghTjX/XrLM=; b=JBgiN6YSc2lA2swjk1/9oj8zGMHykEcAe6Y70XToWBThwTzG8Tem/4piornqViu/lV 4aPpNZk/6LJePWK1ninZdYP8qkx1Y+IudMjVf+X5Ktw9zEEz4F5xR59rsUZN2HLfFQd/ oT6LujYqBvqifx1QWjZTdX+A/f8p34t3Ng92OmI+dNkJffVDSFgmLzGrMjkGlqMmiknc Q50z+tBN4czhoP69fBq5skVUmBlSe6cVaVbsB3mPMl0fjoj9jPERzy3FHEFDgZ1ndqS3 jBUGacu/ebXw4/crWKixmCNh8j5pb/R63E1/9IzcW6qJJ3ICHnGGHcpHr51JU6zYK1++ 2K9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277472; x=1777882272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=GHuhl7sujEeEFbAkpoWph1gRfoj+IqsXXghTjX/XrLM=; b=XfX9gk2QXkXYy7kQubIsgwV0T0YyZrVbQ3lmS78jOS95xwDwM/ZYz/MD2jsnCmRuIl /Yt07vMZj4VeDGaz3u/md1rW/JkGh/1WSLaiIaME/V4hHXhIRtd8ibhL9RJECixz/scz g7Lku7Ii5X6JWd1Gz2DTPjCs54jpmQ4axpoSct78VUHCTlZ1c9DZh4uU7+Og9nALeJ3n Ohp34zF31lIvGkOezdQa10NC6Z3ifTZfkfzwpJL2ZOJ5I0PrYxuCG3L2ckNEnUW+MgRA UPf4wpzpiM8uArQRhGI5BYCx8uLKIo5g9v1Ne0R8Pbazq/1AsL77JULsKvskcpbM/+n/ EUxg== X-Forwarded-Encrypted: i=1; AFNElJ8ktk3MUORrku48djNVUTQGu53ioWiIZeEWAGVHynYp4AlP2LRTfXyNkxvv5+8LRYeF6gdJhB3rYwip@nongnu.org X-Gm-Message-State: AOJu0YxtCxmwhssihVgTWwV2nTH/GsXLEt49vgWGXE3LCGxD3hqarD+J C0mGQSA/fNdvsgwhFiMAGE1dYdhyPfZp9jFIOfvIsATSIhrXjLoWTra9OrLRcDFmltALrAhjO8w g0VqPqvI= X-Gm-Gg: AeBDieuTiFUhXS3SYiel4pAWyhGT17gaHhR0HQbeDQrzH6si05hIi3iRJTT6Ay3aGuL 1aFpMUXujwgWTnC5jENG5u2TkCZLu8y4mbvbYu291FJw679g+49nbZhmmM6zUkzFv5kx+y2e+sw 4C7XDW+6ueidk6Gw5cK8pKUoT0YXryKBqz+YC5JzcSI+kByIedUdGsEBwKMF640FPKSUUaMKqlQ tyrDsAD0GqHQ01fxL9ZdeukXKFma1bHSDSoWqcyxc4+xrOYhMAa3bsWJOnf+InTlw3Dv861NyES eB3d0Be4eP3ljIq8fx1Q50ABx0rqbWT4tqGeI/GS5o3vG4Uxzm6OZFXlim3pVbd22H09esd0eJN iEBgq4EL1d0nhC/oVoxV4drMaTAyMbjiyWVPW4yE0t2SeIsZp27mqBCwQFlBERMHmXvb+BNIhZs PrMrAJQmdCXnN9qWc1hDuLfoGDGb6ujcLH1WszzV646sFeTOgTh820k58UjQzqA6TSrIwAG+kWK wVVA/DA1mY= X-Received: by 2002:a05:600c:3483:b0:486:fba7:b150 with SMTP id 5b1f17b1804b1-488fb7787d7mr583789875e9.15.1777277472211; Mon, 27 Apr 2026 01:11:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 31/32] monitor: Merge hmp-target.c code within hmp-cmds.c Date: Mon, 27 Apr 2026 10:07:37 +0200 Message-ID: <20260427080738.77138-32-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277520969158500 hmp-target.c doesn't contain any target-specific code anymore. Merge it within hmp-cmds.c (which is already built once). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 1 - monitor/hmp-cmds.c | 40 ++++++++++++++++++++++++ monitor/hmp-target.c | 74 -------------------------------------------- monitor/meson.build | 3 -- 4 files changed, 40 insertions(+), 78 deletions(-) delete mode 100644 monitor/hmp-target.c diff --git a/MAINTAINERS b/MAINTAINERS index 3e797b540d2..ea47dfd2cf8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3388,7 +3388,6 @@ Human Monitor (HMP) M: Dr. David Alan Gilbert S: Maintained F: monitor/monitor-internal.h -F: monitor/hmp-target.c F: monitor/monitor.c F: monitor/hmp* F: hmp.h diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index e81632f5551..409a1a9c701 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -14,6 +14,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/base-arch-defs.h" #include "system/address-spaces.h" #include "system/ioport.h" #include "exec/gdbstub.h" @@ -22,19 +23,58 @@ #include "monitor/hmp.h" #include "qemu/help_option.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor-internal.h" +#include "monitor/qdev.h" #include "qapi/error.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" +#include "block/block-hmp-cmds.h" #include "qobject/qdict.h" #include "qemu/cutils.h" #include "qemu/log.h" +#include "net/slirp.h" +#include "system/device_tree.h" #include "system/hw_accel.h" #include "system/memory.h" #include "system/system.h" #include "disas/disas.h" =20 +/* Please update hmp-commands.hx when adding or changing commands */ +static HMPCommand hmp_info_cmds[] =3D { +#include "hmp-commands-info.h" + { NULL, NULL, }, +}; + +/* hmp_cmds and hmp_info_cmds would be sorted at runtime */ +static HMPCommand hmp_cmds[] =3D { +#include "hmp-commands.h" + { NULL, NULL, }, +}; + +HMPCommand *hmp_cmds_for_target(bool info_command) +{ + return info_command ? hmp_info_cmds : hmp_cmds; +} + +static int +compare_mon_cmd(const void *a, const void *b) +{ + return strcmp(((const HMPCommand *)a)->name, + ((const HMPCommand *)b)->name); +} + +static void __attribute__((__constructor__)) sortcmdlist(void) +{ + qsort(hmp_cmds, ARRAY_SIZE(hmp_cmds) - 1, + sizeof(*hmp_cmds), + compare_mon_cmd); + qsort(hmp_info_cmds, ARRAY_SIZE(hmp_info_cmds) - 1, + sizeof(*hmp_info_cmds), + compare_mon_cmd); +} + bool hmp_handle_error(Monitor *mon, Error *err) { if (err) { diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c deleted file mode 100644 index 2739383607d..00000000000 --- a/monitor/hmp-target.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * QEMU monitor, target-dependent part - * - * Copyright (c) 2003-2004 Fabrice Bellard - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "qemu/base-arch-defs.h" -#include "monitor-internal.h" -#include "monitor/qdev.h" -#include "net/slirp.h" -#include "system/device_tree.h" -#include "monitor/hmp.h" -#include "monitor/hmp-completion.h" -#include "block/block-hmp-cmds.h" -#include "qapi/qapi-commands-control.h" -#include "qapi/qapi-commands-misc.h" -#include "qapi/qapi-commands-machine.h" -#include "hw/core/sysemu-cpu-ops.h" - -/* Make devices configuration available for use in hmp-commands*.hx templa= tes */ -#include CONFIG_DEVICES - -/* Please update hmp-commands.hx when adding or changing commands */ -static HMPCommand hmp_info_cmds[] =3D { -#include "hmp-commands-info.h" - { NULL, NULL, }, -}; - -/* hmp_cmds and hmp_info_cmds would be sorted at runtime */ -static HMPCommand hmp_cmds[] =3D { -#include "hmp-commands.h" - { NULL, NULL, }, -}; - -HMPCommand *hmp_cmds_for_target(bool info_command) -{ - return info_command ? hmp_info_cmds : hmp_cmds; -} - -static int -compare_mon_cmd(const void *a, const void *b) -{ - return strcmp(((const HMPCommand *)a)->name, - ((const HMPCommand *)b)->name); -} - -static void __attribute__((__constructor__)) sortcmdlist(void) -{ - qsort(hmp_cmds, ARRAY_SIZE(hmp_cmds) - 1, - sizeof(*hmp_cmds), - compare_mon_cmd); - qsort(hmp_info_cmds, ARRAY_SIZE(hmp_info_cmds) - 1, - sizeof(*hmp_info_cmds), - compare_mon_cmd); -} diff --git a/monitor/meson.build b/monitor/meson.build index 585251804e4..4c58dd148c0 100644 --- a/monitor/meson.build +++ b/monitor/meson.build @@ -7,6 +7,3 @@ system_ss.add(files( 'qemu-config-qmp.c', 'qmp-cmds.c', )) - -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', - if_true: [files('hmp-target.c')]) --=20 2.53.0 From nobody Thu Apr 30 01:49:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277497; cv=none; d=zohomail.com; s=zohoarc; b=ezwuUXD7c/PRdrEaSlKF9I8zgSA30k8JAq8tIuKPNFmqwXx5C98gA/D3Z+qnHN3/3G9seiMBWs2h1YvXDxxqRGHx1XV+2dxdIm/qYsJH3B2E0aTdb49byOCdl3EmSiboX0FAl2ExgcxY/Be3o3Mflcdi+xJjSHUEZbCL30e1zOI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277497; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=s+q06IceCN1KLToOU+ythjt+hQZ4+sEQyBGiYFrPOm8=; b=SJBju/4QbIPWNtSuPGTmhXJ0xgkh6LH5PFGddtDPxK35ve9L7FNLVqOi1tv6sajxiFuXzrtRR8nQOlHsKZ8P5YBP4IuR+ROGQn6/F2PPb+SCQFFUp5/+4dMHTXXwCB+6wtuHm+ZamPGHY29Q9ZudbxMH7TAT4eW2dqxRsRClmG0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177727749730829.17535043699968; Mon, 27 Apr 2026 01:11:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH3s-0002yv-2Y; Mon, 27 Apr 2026 04:11:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH3p-0002lk-TN for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:21 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH3o-000345-DZ for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:11:21 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488a14c31eeso80757325e9.0 for ; Mon, 27 Apr 2026 01:11:19 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4891df9e50asm470997225e9.0.2026.04.27.01.11.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277479; x=1777882279; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=s+q06IceCN1KLToOU+ythjt+hQZ4+sEQyBGiYFrPOm8=; b=GVFHTrfZCuf/zQciTR16JU7udSZ+92Tt4U1krGlYVV0HXXZgdUsqBXNYMQYTEBgWZW HLOMLu4gqMIuyQT5wxyd9eyS1GXq2HJhda8arTmj/X748OARBEVkm3U9rJVCYy2pmL88 1caLINaW85xOigi8BpWFTqoIXQVYpZp21NeAXokKnqdjJ4FlGqpf0Pp9i5cSDcrV4Wf/ F4M2+5hWUXnKO9MEuawBiUV0fuZ/0nbuNaYesXsTRiFbxhavKZpiMPHIaDcI5iTVf7A6 Kfxo7TbWahFGaqdtkHOHC4QQeR3tczyqXK1WNXS+60nGPYCTOL1bZLGDCPDfi9QDQPCP Pqug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277479; x=1777882279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=s+q06IceCN1KLToOU+ythjt+hQZ4+sEQyBGiYFrPOm8=; b=cBGQS8fB5VEdRPNiKwMVzSr3HCas3ex5Si3auWjQuBmKfkMgOGdPw3jKvQl7mftqny /XE1N7YKsNBgp22sKJn9dJor1qLXFcJwnIhwXegQrV3OHLSnCEZTL7v+2/8yeHpZI+IL 0oxd5gHSKhE+InM2omGOkYyheD4IwPMpj0s1IV+/ia/BYHhk+MCNTkci2PjZ4Iwn0zCw u6jMNnvOsGRbZG9CyaG0vbKhQ2ns82O8R5EGJticCT+6pPFt866JKMV2GHFLSj1M+k7b bBeThqVAr+rltqD7d6hWG0PWohCPu+zbJiyRdntpHyQOXwBY8MVXm/8r8hk6SpohcG/J uGxA== X-Forwarded-Encrypted: i=1; AFNElJ9bVLui7zxU6AQSRhf8xkqQKQpmvxwWQrucbXX8g2tbCUGN/Ms2mRmik8qO2OPRHTCV/PdG45wny2BQ@nongnu.org X-Gm-Message-State: AOJu0YxFKp0RdS4fSuD2Wiums/zENR3LOk/4sXhajmwi+kz990UhPF0F +hz64y93o5woJpl71hZEG7mxE8imEmP3HWVR/mA9x4BZBkXjyNurxCoOYQ1dkSAbEAc= X-Gm-Gg: AeBDiet9vpNpbXrVaJaf9687IFGMLGbDQnjyaVZs2GYao8Nvavtyc+YfdlvJ/e4dODH wJC7YSCuKtr3MkMMTwxfIWuMvJ7FYEhXMW0S1pAHcjgfQfcDEB/rVFXVNOVFMfD4vv0DcJkCS+B 80Ggp8IjqeiUnOapkkntDYEw3LYtgPGX0Zv5nBna+PxHqR1+syWdBuemcc4RVs6olAu5iPMIIEj Epv+8zLM5kLv99td5oZm9+DHYdDx+D0QR40LVfuE4CPM22ivMQStNltOm9icGvxWUrz0TsleuI+ wrS//RB4rFwXQ4uDo+Yg45n8YJWQ7YN/IweeMi2qxir9nY0UWhmgKIGvylg8PXsP2z1u9VBwske hVUsmLm2MfOOuaY8G92yVTqdPfLsF5P4sz/9dZ7OG0W9ioTFPBmqVUdmKUO4amc/TUnM/jfZplj UlO34TwLwFQNus6nEPtwcec5Ddk/PDT4lqWthv7FXJub3SsDbvQxqmIG9YDlJKTbgfw6dYeeNsJ i1WKYJB65A= X-Received: by 2002:a05:600c:a31a:b0:488:b239:77ec with SMTP id 5b1f17b1804b1-488fb778db4mr467279995e9.17.1777277478770; Mon, 27 Apr 2026 01:11:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 32/32] monitor: Remove hmp_info_pic() left-over declaration Date: Mon, 27 Apr 2026 10:07:38 +0200 Message-ID: <20260427080738.77138-33-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277499587154100 When converting 'info pic' to QMP in commit 795eaa62fa6 ("hw/intc: Introduce x-query-interrupt-controllers QMP command"), we forgot to remove the hmp_info_pic() declaration. Do it now. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/monitor/hmp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index c8ce8579424..f9b4c4e2982 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -52,7 +52,6 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict); void hmp_info_vnc(Monitor *mon, const QDict *qdict); void hmp_info_spice(Monitor *mon, const QDict *qdict); void hmp_info_balloon(Monitor *mon, const QDict *qdict); -void hmp_info_pic(Monitor *mon, const QDict *qdict); void hmp_info_pci(Monitor *mon, const QDict *qdict); void hmp_info_tpm(Monitor *mon, const QDict *qdict); void hmp_info_iothreads(Monitor *mon, const QDict *qdict); --=20 2.53.0