From nobody Sat Apr 11 17:09:01 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=1775850907; cv=none; d=zohomail.com; s=zohoarc; b=LNKZAxEbrMI03qulFpuOtoXkewAHC0vlNgkvTG+kccSby5hOnf+qlGSnNHec+CwZ/FtejF11eOYIWZPbNCsmUvkwtTQUjXStJVpnfmFoepDszk6fA2Zvdnmry0biUv6eF8W8K+ZVKWe6tnlsvX08T8G4VQdnhl0XW7AiwfPXdgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850907; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=vgSDBpX5CLw08pNI+SPMIuoznTVCeN74IG0qPtzmxwM=; b=OTvBpKkAwX8ZXRWKSMJJziRGc/H2wI9kHXwq9l/r+7r3VfJFSuVvrRM0C7NG8OcaFlQb7sA1i94PP+WB4DgZDfQ7pmE4p0CVUCco7qgqCpMFvv7CUYvWbASKWDASWejaHROSjo8vGztTfyS5uTMqqOaX5wbmsmNH7jxBRcxiE9g= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850907414965.6768626663328; Fri, 10 Apr 2026 12:55:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHv8-0008T1-97; Fri, 10 Apr 2026 15:53:38 -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 1wBHv6-0008Rt-DX for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:36 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHv4-0000Sv-Oe for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:36 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-43cfce3a195so1524423f8f.2 for ; Fri, 10 Apr 2026 12:53:34 -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-43d63deba9esm10266885f8f.10.2026.04.10.12.53.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850813; x=1776455613; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vgSDBpX5CLw08pNI+SPMIuoznTVCeN74IG0qPtzmxwM=; b=UWTA0ZCwd6DkBI7Zcydv37n/mKXNdg2B1rN/GlFMe7RfqsegtD3T1BeoVP+Jp0/Btj oCKybYrkdpcXq/zvXJIDRMm6Ydz7zZbwHU5vz0WuPPDlFgB8fi63uRgosx1kTcFqTclO Lua5hoSiF9WsmN3Nr+sfm7o/TFGiTUtzE+t9r0UUhvy860OrwPfB2HfPlH7brYznlH+m zflt0RQ+vlm7gbb3V7jBoMtaHN/3VwVeK9kht/4y2o94HwCH7jnNUc8DD6vY6kuVai5e WG4Yhwdc0iTDkZW3ItMv117AA5zTF5iJje8oeyXCGshVR9KKq9HaOVb5USQOvapzifTz NLIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850813; x=1776455613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vgSDBpX5CLw08pNI+SPMIuoznTVCeN74IG0qPtzmxwM=; b=BNRth/7aBprNuEY+cUSbxJMe2JpjgtdughfZaknn1/wFUD1C959uNu/muFiZnxWl1y G+zwgSMGVtF1HpDzX4AdVa61CV6T78s9sz+ERrbL+wna105ayduo2//wlWXxb176p5Hb KnjKXzg2es1EAmaOnVohWEor1EpPRnLJeZbFCTY5fc3Ti/LB8nywj8SfOgNaZE5lxjFz XnW4bwFpNjGDpc+PsZM5bB2LGLhXbpO8Bgw2tH035aNqCACmlqlD1klfRZ6uybDQZvkS alfqZZAizVyW04AwruQn1l7mlGgh1HmkmGPiQLxgz8ti3XXzro9PCW5nAOaix3n/Zp7+ nYnQ== X-Gm-Message-State: AOJu0Yx7PB/F5gog+1gthmXHAc2R+997fBeoz8dgWmRlPMlYjpZp0H2i 68x5V507m3CP4MsyYR9Etb1/glKFe8vHOzxn6tjpcsgpR2PAe/FazjLgG5DeDiPJ542wDVwcHNT GOFGGz4E= X-Gm-Gg: AeBDieuI49eo0CGczHh0Xe/h/pdx8PPrNwmedm4b1wR1XLFYozfL4pNJR0JQhiTWVqZ k+b/uzZytmsQL5sS6EUoelw1141K2wFFvXWh0oaMRwHBR/NlgZUuGJuX1DQsfmKx9yvilB/VW7t 7xemt88nBhsAVzDnqCsKfZe8VGVG4WHhk0GjqTDpX0XoXnqFaLOzNfEiyNW8wVlphG06ugwW5o/ hiOIyk+Lmggapk/rY5NXCRkSQqrZnQscvshb58spWePLACSfiaObC1AiGTrGTlSIZGID9qgFGiJ ov1MbeSbE4EKPfylE89fff1jmR2BEVyzDdzlYfdrkaL0rtEgngKeaV4evnvyvLIb/E8506TPEH5 DCJ+2MTUSqnKcB/hqFG6TJw8Jahx6ZjTPsxV+HYSsLEYDc8BMo6R7zdaRrbm2MtdRiZJKE8ar63 FhXQcOVXEJoqpgWwGXs2f+bvtJsu13rXCpcQ78+TcXdjPGDHldn5jvWUAXJ1p8UlvKW9mT6WxV X-Received: by 2002:a05:6000:420b:b0:43c:fd18:a30e with SMTP id ffacd0b85a97d-43d642b4653mr6664483f8f.35.1775850812787; Fri, 10 Apr 2026 12:53:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu Subject: [PATCH v2 01/27] monitor: Have MonitorDef::get_value() always return int64_t type Date: Fri, 10 Apr 2026 21:52:55 +0200 Message-ID: <20260410195323.17937-2-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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=unavailable 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: 1775850910207154100 Simplify MonitorDef::get_value() handler by having it always return a int64_t type. Truncate to 32-bit in the single caller. Note, this handler is only implemented once for the x86 targets. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/monitor/hmp-target.h | 6 +----- monitor/hmp-target.c | 4 +++- target/i386/monitor.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index ce0bb1983cc..6364c94edf8 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 struct MonitorDef *md, int of= fset); }; -#endif =20 const MonitorDef *target_monitor_defs(void); int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index da7dd7f31f2..812714ada01 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -79,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const ch= ar *name) 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); + int64_t val =3D md->get_value(mon, md, md->offset); + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)val : va= l; } else { CPUArchState *env =3D mon_get_cpu_env(mon); ptr =3D (uint8_t *)env + md->offset; diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 977f65fe16c..b128334e571 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -593,8 +593,8 @@ 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; --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775850895; cv=none; d=zohomail.com; s=zohoarc; b=HY+dS34YZZDj3lze13msmBKOXYABDKRJ9kt/BNYcAcXjJbxuH1uMY1bQ6Uev7OP1E2U4wAFj5vZmSrxbZmldIxGB3O4vL7HoaCzHB3KHsAuMJbZ7l0Kg3U7iHfPfdFfhcBJD/idd5KAeSxdtHLCecK0fsNPhnlLf/t9t8d7XRVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850895; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=K2WKZF4iKqMlnmispjyJNMuthrudidPMtbX4QHH6Sz4=; b=iaigQsh0cUsoeP6h+8nw46zyhBl+BG2y3/eGJrSuBWKVGcwW3zno4Q37eSrvRolG87aiY9eSDxTe5wfvYmn30R5cgmFWp0B/ujPxiFcap0FoJk6zDUHDoiBKzmevawNg4t2uNRd4mNQpDNZPaw1+ssGnP7X9UZ/av/ndu4nh3eY= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850895916152.6198504871478; Fri, 10 Apr 2026 12:54:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHvG-0008WF-Bv; Fri, 10 Apr 2026 15:53: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 1wBHvE-0008VE-O1 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:44 -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 1wBHvC-0000VV-84 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:44 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-488aa77a06eso38602325e9.0 for ; Fri, 10 Apr 2026 12:53:41 -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-488d531f229sm129524635e9.3.2026.04.10.12.53.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850820; x=1776455620; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K2WKZF4iKqMlnmispjyJNMuthrudidPMtbX4QHH6Sz4=; b=gGYa66MFTvuuuK+1jFpvswZoWsV91IpKk0TVhL4SwiHMpcbnbT4oB3mPFjuTBhYsjG zwhR3MflKRvizymOE6tCK1FCm36PUvEnpbLWZAucsfKKB6VtSRPxpS378PzMSDoNkTQG hLuKP+L2345g5od/2d3Tab345D5e3c2V3+sejpqkLdJ8HVu1Zf4hk607qDQtIbQMqMdU kEkyl3fOeDRtF5qb5jSPnvi0BYUzh+je15Eghgm0DX/8otZGnkbNECPo8rBv1x1KYx1U i6Z9w3t/OXaqDWoKuaypzM8J7k8OVAiI7tDMCzj/g1fM5+A07rz6PXe5EfS4HLHDr1hN CQQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850820; x=1776455620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=K2WKZF4iKqMlnmispjyJNMuthrudidPMtbX4QHH6Sz4=; b=ftN+VKo3c6Mi5YwoeYDofLqKa3CYdheR3bON3g/nmpCzid8+Pt5niK2DZEa7wjcQVO KqvAIHZKdSbYVgqk2OYL03AiPFnG8RiiAZUAZt6KsEJKq2g3Cb33a08Nw/hXPbUYAW1s NtycZILHfE6PI8VuEkqneZ9dDxO217hy7J+X9GQDT1zwKTkeQbKn+RnWDELmzi10g+Ee aBWc1PCP28LfBEf6k4Q6D/xDnjzObojJj+v+7VNi+QGVUW2QHQJKaGqsYRLKPCgYU9c8 WskIk6sexua3o+RpqUiflrcl5DLfCIUv3cloIQQfnfVvQj0JWjgAkCnXWceEG/rDCCnq unHg== X-Gm-Message-State: AOJu0Yx7oqncy+PY/Iu5J1BKBfK7r97GzuNTN3jf/v5NUdDJADslAp2B bBuH6HKzQ7aFwr1rgtD69Pj0eMzWVmT6Mkq73mE74aGvWYgZZwaPWQt4SjE8XlEAVcYBm1LK5cp FPeTHVXU= X-Gm-Gg: AeBDietrSrIPKvzpxW8TJLfSU7zrl4Jd9WPjDrOdeoypntSwUGmOi5jPRwVfYfzCF4n KhmJrQNjUjghd2eU1q6vT1RZc0bEJpw9BpnfoJt/elmn9seia4z2e5p/6XVPqD89xanELTsujHN mT0zfvX4q0sHxIwxkCvhzukbaZvyhCUYxp1Hpy17uOx9cNgmvqJg4FgXwK5RuC0gqNKFybHddqR pi3JEM9cOVld6NXwb2VxgAFe02blDsrQL0sj7aL8J2aRD0ElUNYSkxDTTIKYC0DfuOmU7LnLiti h7DCto4t4s6IuM/3BODBRmqfijRCSSbiRFqX1GSoAg4ggCRbFALab3sKIHADwzxRrsaTujC9u9b H8Lx1y3gSOG3c/xSQXDANJWozbhajh6iYEsADzWyczXhBMfn1XouL64kP3t7yeSu+IvuJQt/N9h fZCFy5GlfELYttXYGf9F31K5koJZkZZNzkpljLetEP7gIG9LTGU7OU4EWv9YOc3zatDPDNBYJR X-Received: by 2002:a05:600c:a408:b0:488:8b99:54a1 with SMTP id 5b1f17b1804b1-488d68865f6mr46720645e9.28.1775850819896; Fri, 10 Apr 2026 12:53:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 02/27] monitor: Remove target_long use in get_monitor_def() Date: Fri, 10 Apr 2026 21:52:56 +0200 Message-ID: <20260410195323.17937-3-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850896439158500 Truncate manually, removing the need of target-specific code in get_monitor_def(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- monitor/hmp-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 812714ada01..b9b79e8e927 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -93,7 +93,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const ch= ar *name) =20 ret =3D target_get_monitor_def(cs, name, &tmp); if (!ret) { - *pval =3D (target_long) tmp; + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; } =20 return ret; --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775850895; cv=none; d=zohomail.com; s=zohoarc; b=MzJ9rPtBUz7tGznM7B1xNkHRGcYiJxCyp8Qpw2pYWzXXi2czg686x2P82EeyBunBSBW+czPXkQgGNITinm97b3spD0kdUqNPzGj4abSeRpU0VvpS1B0mYsb85jee2RamPpTxVCX7BkTtbeoFY8MyMAodJ1jAkcirWSIUhgEfQG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850895; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=laXD0bHOFLR+f7DqrbhiNwPQxGkoCRCAaO6RrZRP8L8=; b=mTd5gFsPV2WXdQsjwNLKIrC7Kx4fCAwtJQo52maSfhiwWtOi2LmvhAjc+hOqAdaaXWOJi7OTxBoAXxoJB0wR953lhGtKwTfN1emgL4fzFHuTvfmZg7rGMv4g3LdzotwmbnqB8MfHANk5ZaRrsIz7w26mZBVmyMIALpQAeUHOjN0= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850895626208.79974608352347; Fri, 10 Apr 2026 12:54:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHvO-000089-HE; Fri, 10 Apr 2026 15:53:54 -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 1wBHvM-00006X-K2 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:52 -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 1wBHvJ-0000l0-Dh for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:52 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-488d2079582so21379415e9.2 for ; Fri, 10 Apr 2026 12:53:49 -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-488d681ea59sm28031745e9.14.2026.04.10.12.53.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850828; x=1776455628; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=laXD0bHOFLR+f7DqrbhiNwPQxGkoCRCAaO6RrZRP8L8=; b=GUMEgppa47NcUYh8fYDR+6RaXR238rb5oZB6jvJP+/1v0jP9xHu+OWIfyBdRHJ6KPJ Nb14n72Wjqhc00P1w23KgGAHtBC8NCRyczBfrnKIMonrJbW/+gwlpnQIXfAASAoWa74p i7IRhTICx/UMPFIdaA21DPA2aMtjn3XVpgQb8GY5O36uEXhJCEjoiiaq6XuQ2XcjleKl Et9Uu8luGD1rGWSTsJJKPvzzOWefkk+26RCKRGLDHroHhGK8lpWw/+PguBW5RNukpn+M 25ovuQZ5m2ulGnXJCYMiIkaNwojtiiYoFAqI95VC3DAnN5mGLjzcghRXVk+VXUCZT5Mm ajsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850828; x=1776455628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=laXD0bHOFLR+f7DqrbhiNwPQxGkoCRCAaO6RrZRP8L8=; b=efRj5yX+0lBIAgC9FO/SOsfVACEDpughCi3M2lMA7d6cet/ATMoQ75ozH9y5Xh3kAa FqruDvbTIwcky++qII/91+xJnqzkWrrHz78U+fGQRLvULu3EPkrBHIh/KPOeRBKenOHU xo6CXDvSVtp8B2XFCRcMEJnazd2CY3VLS1ecasPNbq5KQUVMveR2xLb54CgxZcWofS5F btsi+J5OKEiJ/D/mZsV3MMVsLJHhWbvvwFWpWaaUhmD+8TOMV4VzvGXWMxGZibFhyPaQ rN+4wRakIh5w87kZgxBbVSZDpCrQqPSdjvhFvKj7gwOrCP8bUQAZTFjzMpoK0VPudd0U s2aA== X-Gm-Message-State: AOJu0YxaWvLTn/5oQ6WHWF5qvItqX4OyGTA4WOMC7P4q/WbjogwhL1Kq 0+yvU7qzqd5tuf15bY2isw13xmih+I49MRIPHPgayawFpFz4xNUKr+4pc6cGz2c5BRVm+NMUS3y iMFZGqzU= X-Gm-Gg: AeBDieuBv6yrBMvw/ULw08fjgoWBRGb41gbvImFkQoqJrArEo0lFg52rR913FmRVfG7 anTXHum1LQkGhFTmFYWW9DG7ULk3SUVVFhVr5xRa3Z4LC9vM2wpLNo58wBJkh0HZKCuTICowDOR jQOA63JvmRPRky0D7rW6AlmxsphCB0uN3gF51wLLcuCvdOdgCOm8qfZ2G1P31yC8FUDbuUOvWrm r0o4/3tQw5NAaSBkDcb5laJbr0nkOHiu1mkPcf+NoDhXemKWhDXCef1O4rjZx9CgBN0co66tLqA 8dqIjxsvoCUW/uc37SKNnxkitEvMk3BGu+dlKzUelZLlKj5KBOHPaEgLgAJBGITAm8+3re5Knje aHgR4Asnsf+R52LqCQPNu99FOaqBzjtGzMaCTqTa0l/6pXmRjzv1Q9fFPJw23AcI5uJmQuGS2zD C1xUpMgEMVdc3sy91FaHVoTn8t1fM1MGc1XCNDKA+p1b6Cz6ZChSZ1nopz/8H+P1T7J33fYKTk X-Received: by 2002:a05:600c:a411:b0:488:af48:af11 with SMTP id 5b1f17b1804b1-488d67c749emr47503115e9.1.1775850827230; Fri, 10 Apr 2026 12:53:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/27] monitor: Reduce target-specific methods further Date: Fri, 10 Apr 2026 21:52:57 +0200 Message-ID: <20260410195323.17937-4-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850898550154100 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 --- monitor/monitor-internal.h | 1 - monitor/hmp-target.c | 39 ------------------------------------- monitor/hmp.c | 40 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index feca111ae31..3ecd394ecf6 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -181,7 +181,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 b9b79e8e927..c840ae5f0a2 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/target-info.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -61,44 +60,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; - uint64_t tmp =3D 0; - int ret; - - 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) { - int64_t val =3D md->get_value(mon, md, md->offset); - *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)val : va= l; - } else { - CPUArchState *env =3D mon_get_cpu_env(mon); - ptr =3D (uint8_t *)env + md->offset; - *pval =3D *(int32_t *)ptr; - } - return 0; - } - } - - ret =3D target_get_monitor_def(cs, name, &tmp); - if (!ret) { - *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; - } - - return ret; -} - static int compare_mon_cmd(const void *a, const void *b) { diff --git a/monitor/hmp.c b/monitor/hmp.c index 0e5913fabb1..20ba1e62988 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -355,6 +355,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, ...) { @@ -1595,3 +1597,41 @@ 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; + uint64_t tmp =3D 0; + int ret; + + 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) { + int64_t val =3D md->get_value(mon, md, md->offset); + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)val : va= l; + } else { + CPUArchState *env =3D mon_get_cpu_env(mon); + ptr =3D (uint8_t *)env + md->offset; + *pval =3D *(int32_t *)ptr; + } + return 0; + } + } + + ret =3D target_get_monitor_def(cs, name, &tmp); + if (!ret) { + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; + } + + return ret; +} --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775850976; cv=none; d=zohomail.com; s=zohoarc; b=EgzO96K0yh0X8tCD67I6dgRs6JMc0yooqSIYkgk6lSjR6TKiKqnl0EDT/Vb5aFBvj0oBkYo4a/BZ2wKKBs0pwET9IfnnXMPLpfavg7aICvbM0IOPh8HHSL/oOLnQbCdRLwGAOWfawxborTuYcio6abq0rgV4VrRog1PWi3oSEDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850976; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=Lliv5w5ANZiNvmNx2mtJSUDbcwDuEoJ/CNkgnVy9fPs=; b=UE18OYpozdH6mcI6fVdH37gnu8Bd9eFwuntGlCCUeWAqRewMNXpV+eKWqEcBcxzeK6HBauN/JWPihAUyCgyXvXe/Ii4zMvNOjgLDkyOEIj6DaFXTBiG2HHvYmphqlp94G0hpfijMwi1cx77BF7/aZzmgYfUrZY9k3AMZD1qaMqY= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850976450725.9070697709695; Fri, 10 Apr 2026 12:56:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHvW-0000GF-1x; Fri, 10 Apr 2026 15:54:02 -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 1wBHvU-0000Eg-3v for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:00 -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 1wBHvR-00014n-1x for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:53:59 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4887f49ec5aso29125335e9.1 for ; Fri, 10 Apr 2026 12:53:56 -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-488d531f229sm129543465e9.3.2026.04.10.12.53.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850835; x=1776455635; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Lliv5w5ANZiNvmNx2mtJSUDbcwDuEoJ/CNkgnVy9fPs=; b=fgyVmgI1RvlQ1qYMMLWJpmisAm1e/D21uIVfDjWVq45RvKrYo9MjNzxCqzEXHG5mO4 7cGUXgtESEyw7oQs6EMm+eqcqC6rUYTl/4u4XB+q36srcQwzCRj1UYNwVISEQBaCWWR/ g4+5y7t7QXVJI2KAvX6AFdMUG/joRGl7Rme1S8MqA63OWEkIErpUleXGFSpZgm5laeOI tWyyqCuh1ifwGFgnm9Sjpv82+bVuoHcCXLmTLhcIXXYTw7kopl/e0vboNOpB+6gOQjBh ohSayI0oXAeUWTNMnR7qjY7/aKxeRxp2XQQ1VgTP5GvXxlEO1n0PcKwQN3gOgiKFaMM6 rz0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850835; x=1776455635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Lliv5w5ANZiNvmNx2mtJSUDbcwDuEoJ/CNkgnVy9fPs=; b=SxYIJyZCbF2ve48mumHG7lYvL/b6TLY0rEzGFtXu5gV4Mj7ksg6qEz4fmOXvz1Y+wt Wl2JIrgbroWvwbjTW50ygvTAKUNdSWei6GexkaM/ITAvV4SXmIIAQSKVE7qxLif/TI3u zT4aKssGixGgSIcTt4Ix9iImzxVDfafCOnHdSnnDriHtLQRWowyn6hITnDY095tKyJha +Av7eOfrv6QWlEGXFcdS5XmtEuKEUm9Qmf6RDS3M8B1+NyNm1GzSXtZ81nNPnfjjiLJw Ezthm6QIYIAsy+1Aivm1PsKgV3sA82feGaQMDWT7mOpYqtG/vf4xt/ItKDdctAzJxMGi jm6A== X-Gm-Message-State: AOJu0YzE+tIQP0pH2Be+aV+brBX0tdoBBKSzXdFeLQ8mtj6HEzclGyVN QlvhpLCyx+RT4NMGdurQWXy6135KPWOYl9TgVXuNuJD2Qjj50ZsFHyAQErE7NesAIfVXuBo6UCb xOlwfYkE= X-Gm-Gg: AeBDiesCeB7/+XWPI9wv1qcN14VObZ0PaMzF9jz16OToeGOyZ8uLbsgeuDzqYgfnivV GWtMheudAwKyiaZ01CKuaQpLFTTRG424v+nbyy/mnsCGjFXoDdgxzqBrXlvr+4Q9xACWmwo065i 7wE5kg0hm1/kpTROcxqKaw/65qvFZPNy/Vn+TXn7I5b0r6FcgKolKjznXVPiC4X0ivTFuQ7K2Ik 88ZIncSu0ccRtdRXSCxPHzGs3jOE1CcgFrRMXOqvAiGbqvdoUeBaJ0o39cK8WQ5VDtTixeMXsTs 9iqxaHsmooPk7A4frK3a0qg8FuRefo0++i646Oc+zha9PUkJYkOw/cZlGq9tpF7nfjZxMedriQc kgLH0nra80hgb/CbY7d88flnokpCUMdcNXQyI1/3WUfS3VFWtautM9G5EGPR5HzL7/ECTTZyoi4 1rfxa45sfylPoMJSU4J/DCuVxjcpgY5QywFRDon9sLEQJiUTSdQ+OZSBwLGirICWqF43ZAoCvq4 vwG5c74AUw= X-Received: by 2002:a05:600c:8b30:b0:488:b14f:b8ed with SMTP id 5b1f17b1804b1-488d6657928mr61369125e9.0.1775850835153; Fri, 10 Apr 2026 12:53:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , "Michael S. Tsirkin" , Marcel Apfelbaum , Zhao Liu , Laurent Vivier , Nicholas Piggin , Chinmay Rath , Glenn Miles , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , Yoshinori Sato , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH v2 04/27] monitor: Remove 'monitor/hmp-target.h' header Date: Fri, 10 Apr 2026 21:52:58 +0200 Message-ID: <20260410195323.17937-5-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850979413154100 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 --- MAINTAINERS | 1 - include/monitor/hmp-target.h | 42 ----------------------------------- include/monitor/hmp.h | 12 ++++++++++ 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, 13 insertions(+), 60 deletions(-) delete mode 100644 include/monitor/hmp-target.h diff --git a/MAINTAINERS b/MAINTAINERS index 535d1d3398e..edbbd544d62 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3411,7 +3411,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 6364c94edf8..00000000000 --- a/include/monitor/hmp-target.h +++ /dev/null @@ -1,42 +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 struct MonitorDef *md, int of= fset); -}; - -const MonitorDef *target_monitor_defs(void); -int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); - -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 9c2330205fc..f17a50a3fed 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -17,6 +17,18 @@ #include "qemu/readline.h" #include "qapi/qapi-types-common.h" =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); +int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); + +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 1dd8d9afbfa..6e82773a86d 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 c840ae5f0a2..d07e545ef7e 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -27,7 +27,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 20ba1e62988..983048db1b9 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -27,7 +27,6 @@ #include "hw/core/qdev.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 b128334e571..ddc666d3451 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 fb84aee94d2..f799a338d60 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 9dde972c118..97e745f27c4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -39,7 +39,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 a9d31114442..3f206b9fca5 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" =20 #ifdef TARGET_RISCV64 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 Sat Apr 11 17:09:01 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=1775850991; cv=none; d=zohomail.com; s=zohoarc; b=c13NbMfKDknRz4lHKvvP422hsG32cYq4UMUr17/ibWLBacOdJOtZzx2qh9jE9NFPQsjKu/oauZC+iGIWr23HHXJaoND79IUDNxS7+ONXUzCAvI7XBiNaTQgkWnv3KO+2Q9kwnU/b3iGKFrvybtLSbjPra4oYH+r5cBd4ut7cd18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850991; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=MpWqUPwhfS1fPWpJ/GJCnH26mtliLzp4q5CtM+NZCuc=; b=BUnOn0HgCxn68H3WFw0DZ9iTQ/J1Bn8fqwBIbAwkLb+rJFl19OfTvcukphnFx4iML9/ddzl0/TqZr48HYSJZRVKRaXVTy4XhrjKxF+69bmoFqEyvITE0SVEeo/8d+cMVmemiJXuGGlppWsqlWcOYRdRHEiR2M9ZPl9ORyCTfQYE= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850991892627.1177848077585; Fri, 10 Apr 2026 12:56:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHvf-0000OM-Jq; Fri, 10 Apr 2026 15:54: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 1wBHvc-0000Lh-4y for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:08 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHvY-0001KA-EQ for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:06 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-43d01d6b50cso2410703f8f.1 for ; Fri, 10 Apr 2026 12:54: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-43d63e5d85fsm8599729f8f.36.2026.04.10.12.54.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850843; x=1776455643; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MpWqUPwhfS1fPWpJ/GJCnH26mtliLzp4q5CtM+NZCuc=; b=WwdiUehhqkEgYKiB6GX9PB40bOmomgckc5Ox79zUr83e3rK06b8MPRIer9Wq3CJFZs vPOTC4xQaTKaj0UZsueukJPb/ZJdfvUflvE0IixKcLSckN6fiwH1RESJVj7xggkCBi8a 8mNUntJ5ZC/gFGiKHoswDN2STq0utP8c7RsFpM0DiU1esOBdNAfM53wYdVCkW8ktnPQq 6UMo/LBTBouc4TklQjW5m4vEbcAK29f7ftqNSYHPi91chJ3+3LJ3WBs+2yHEHXhtik+V gmuFFSfh6o32LWO9BAfunxNtWuEdK7OkwQkaoygE3Y8eLNsu6zGw8cKKOm8U58m2DUEO cL7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850843; x=1776455643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MpWqUPwhfS1fPWpJ/GJCnH26mtliLzp4q5CtM+NZCuc=; b=ncPp+pL05IYdD8K2o3ElSLEQWbg7VgrHAyNrLqoWZVsHFWVhfJy2HV47YoKSt+e08F aMJgUnZcTsnH5dzjfEAxNdDOQo7UGr//lWIzf9vBtEb69fCYvvON5MQ5LgYisZqvjsYC 5gb2A8phdvj0BTKrsVXuD65t1/jWwlDzcBoO2X0Isdt48mNZJ+06Vi362abmBNnA2uld HoVliXI+EYzuanUM30L1wH6SAS5w27R38n5UCFzTi+qioYERk4y8fTkvCD/wj6UbT9AW 2pPO79lR9wATI8TqI0XtWia6TitrY99vhKCsPwT8n/DnO5oE6x2KG9d2gDcQpa6ICKfr ZGNw== X-Gm-Message-State: AOJu0YzYVjYICMy/8vEo/HlNTGuqwis8AxGSkQ1RK/3D6Ol9Hng5r9hM KFC5xhcBWC8KM/E5dhUO2srbTKpWYyXoPGFdRkgarqkv50K7OT4amFpuc0s+g8XVx8nLvswFbUl hmYqFEWo= X-Gm-Gg: AeBDieuzXqJs9Uxwra+WqRYe49Lk5DfErSxeD3+odkWyDdT1CMOIooVuxN9mmyJi69U EJVHTuNtPmO6XLL7tnSpU0UTAuRkURq5Jde3dKVgJHyFsOTC9sEHXhEyD8vNQoz0L/nvcMvFYHW o2SFypNrbTfqqWAl6V25Vm8V3tjhqVkp4Dm/2OMLnHSVv4yT/mkumcBB7AoaRIyz2BpIvYAMuYc TeX0yPZMCawA8JnGtk518DJmh2bfBa7kXQq+EcJxIz4t5Cj4qnwTPAKz0M4NcFEdF6AlZOV6jvs 25iuOYizwlc5FvbL8GK21S01roU5duAsylUthTAk753uO/uybfyMjdR0DadGaOKWxiHhqaRXrUT wm0qxom+ulekHJll9iFFv928W0SVZUuoARxg27r+BhHfUIbBJ6ifpAbxyFBox1G3e5sz+a8Sgi1 pofTsvWiKHaATlI9rLHpU+QWe2BMyKIAHRyZ+PUgqnrtI1IHanTric+U/M0vh3CHUURrMfhmOf X-Received: by 2002:a05:6000:2886:b0:43b:7ff5:fdf7 with SMTP id ffacd0b85a97d-43d642c8664mr6778189f8f.29.1775850842547; Fri, 10 Apr 2026 12:54:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 05/27] monitor: Forward-declare the MonitorDef type Date: Fri, 10 Apr 2026 21:52:59 +0200 Message-ID: <20260410195323.17937-6-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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=unavailable 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: 1775850993432154100 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 --- 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 f17a50a3fed..516089eb5c6 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -17,11 +17,11 @@ #include "qemu/readline.h" #include "qapi/qapi-types-common.h" =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); int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); 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 Sat Apr 11 17:09:01 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=1775850945; cv=none; d=zohomail.com; s=zohoarc; b=D1JgzfrCqdAes04L1bMzHO0+nyWHhLFpLFIUE+HU8bsrPztqm7JqTc1fhEl8Ns1T+CfYMquOuHEUGNawGvq3vU/QhOQOIMf+iKbjuk9/AZea1cHAwsdimEMktIGx9rrO3bUQHc34bpd4C0LJE0OLOH/eSi/fFlhNH3ylX72/I94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850945; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=1eA3XKlB2Issg1dkYmP2jSa4cjzBFSxxUi2nhDXWoMo=; b=anmhdp3tWv/L1M8qoD2nMf35hI12fcT3FEMocdNC/9Bs0LAMKkzZXcKE1mLuBHuZOYNz5PIBdMOGovnrLDq6PL06mpPZWuUVdMysi+fttWnbqBtDaVkNK17Izg8InqqcOJmcF7QQ/cXwAcCM0qivjLyjKQgnQJW1P78rr6dJtuQ= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850945059803.6635055870348; Fri, 10 Apr 2026 12:55:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHvm-0000ai-E4; Fri, 10 Apr 2026 15:54:18 -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 1wBHvj-0000VW-Bh for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:15 -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 1wBHvf-0001Ms-Dt for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:14 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-43b983bb07eso1554144f8f.0 for ; Fri, 10 Apr 2026 12:54:11 -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-43d63dec28asm10125307f8f.15.2026.04.10.12.54.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850850; x=1776455650; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1eA3XKlB2Issg1dkYmP2jSa4cjzBFSxxUi2nhDXWoMo=; b=dYfu5rghv18AVZXa0Jkeg1dTcpK2UYN0b4DWmJjfSrVytkKDS6S6uOyCZPebtcdv7f NKyquf/+f4+VGywiOG3DZXvSayKuZhY1YIniNqKOfiqTNfB6uX0RfJv/BmHEuYcAjM5b 7tCW0ERDu43UGQuQFkpgH1Arqausiy/esmrn0DnK68JSafCvygfQwe5SxSt7XRK6tYUU EMvapI7lNLU4wcLxy5rNsiMV1N0LUEJZUobCU+gbaLfcotprXORGB8wf6k5qffcbvK30 tmpRrLLrL49UE0EJBDfw6+Zobsc9ys+OeALlJrElm+iyW3mTmzcOphQFDD+NPdVJqErS EOkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850850; x=1776455650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1eA3XKlB2Issg1dkYmP2jSa4cjzBFSxxUi2nhDXWoMo=; b=q1VSdXlE8597uQP9Y1lsg+4pSRDldVsg5dJXEkhWCleiJGM5eRa1f0Pk5sX+dCvsmK yXiAWWPTlG/qboXnJSxVi15wPEW9j31K7d8hg6odMVZODbrTMFLXOAQfYxo+FlA686/6 cCI6+viMTiL0sHH6Aa32DmDw2dOe9dU/gKCRJSPMhLdXAb7ChO8dbu3JRZU9kO8C8nAL YYxqDeMapjwzCd4MZKR3fOLB8BCNfWqozmaXAIVYzqdpSy9/NbDrSxC4cajUeP8BRdOV 4vtzptou/SFgugepW0OyB8beDXaOBvgbvz/r9H6UoVqNwiRglHExcbK8liZBW78X+n/3 RJEg== X-Gm-Message-State: AOJu0Ywgo04RVQuIK/PJVXLI1t/XFn52Zk/yQKSFbrmrxPdOyQNUw/y2 2XR6vKs7wggfQ8CbmCIpFguOU4zrssQ5MTrray6MAASXbAaFL9y29v5ueiBNVDNAIAjT1Txavv6 9ed5/XNA= X-Gm-Gg: AeBDievIZlE6FiK2f98+j7nVsrcS8N1agNJKWYFyfFDJWSsO5IQBEcEBp/Cy0pSPAq5 Or32tolePr69tKlSgx+ae/RHdqNhX/hHHokUgdGjm5QE82jDE/Z2RuneipD488R9Tu1ntPMulNv aFy2i4HdUEXYuD8E4cr74CcUvW7HzyMrUeZ/nebXwp14tXhd+lA9JTvFLgrdnUTTFI2ycYy52l0 opSswyu9RlmbWYCoThsxYHnxlzUo3rW+vBNa7HFBfj/CZ0KMZiFZGyzJv7KkfH1j1LoGwNV3GMZ +IxpgohBODJBrkfP76ERt77YlzC9/Gaz6dRvKsoeDcJ5zFwUjJr0ZOQ5lK8Z9ugysagrf3ozvLq uQMbDCEWsEEFoSSCIvTP/R+8WmJfc3BOzhdok95LiJjU1JT3jF5y8L6oRNK0e6ZL8DxDhvk60fv M/roV7PMvc2L1JucDuE8kqnH8nhQJChA5rZmp3cxjVUnQOU4YVMAfoB+4lgPglFBA9heZgSsuf X-Received: by 2002:a05:6000:220b:b0:43c:fdd:ea96 with SMTP id ffacd0b85a97d-43d642b6e75mr6383617f8f.26.1775850849621; Fri, 10 Apr 2026 12:54:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 06/27] cpus: Introduce SysemuCPUOps::monitor_defs hook Date: Fri, 10 Apr 2026 21:53:00 +0200 Message-ID: <20260410195323.17937-7-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850946803154100 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 --- include/hw/core/sysemu-cpu-ops.h | 5 +++++ monitor/hmp.c | 9 +++++++-- 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 7b2d2d2610f..a96f4907d05 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -85,6 +85,11 @@ typedef struct SysemuCPUOps { */ bool (*internal_is_big_endian)(CPUState *cpu); =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 983048db1b9..6cf2f3e65ff 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 "qobject/qdict.h" @@ -1603,13 +1604,17 @@ 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; uint64_t tmp =3D 0; int ret; =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 Sat Apr 11 17:09:01 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=1775850927; cv=none; d=zohomail.com; s=zohoarc; b=iNRZ0nXWU0cE0MYz4YQb2j4DCPnyR03ZWR7BNCyuqhAeuP7TZs3aaHohK+JwG1vUBDMzMUimQoiee8KW460AlkL1G3gvHtiKr6KqVwvmofEEz0Ygw4cPyLFibSRt5xk9CMkrtAyBGtk6OaWix2/ZeZ8GYXgjWWegrxmBW6S4E/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850927; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=5s/GIt0tTjsOfb6v9VaN6RJdqFFBKJGIkUaXvnC2hp0=; b=HMdJLoayECmLY1RP/szRXWZvW2Fhp/CnWuyQklnJ6TLasGM8N3syWylLTXYKM2uotXNr1xI+uAssqxvCL25Ox4t6YrU1fYIwLJuJEKZlar0bbg1Zf/U6STqF2fSz6B6kGvsFsOs+X1XBya5XyZhC2JjzVtOdIvy/Rq9ECZaEMsQ= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17758509277341008.7772159038162; Fri, 10 Apr 2026 12:55:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHvv-0000iz-JN; Fri, 10 Apr 2026 15:54: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 1wBHvp-0000eH-OB for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:22 -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 1wBHvm-0001Qt-LU for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:20 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-43cf8fe9c2aso1606360f8f.2 for ; Fri, 10 Apr 2026 12:54:18 -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-43d63e469ddsm9737710f8f.17.2026.04.10.12.54.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850857; x=1776455657; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5s/GIt0tTjsOfb6v9VaN6RJdqFFBKJGIkUaXvnC2hp0=; b=HsD9cOWagg8s0L96aQLSMgGu/flt1alHypu44f9dxNgzxWQCPFZBnoDPda05gqhMh1 Yv3/pKuyBYrFRDFWI0FdkTUMrBcm+95ul8Gcke6OzEGk1DEZFOqFzKgmj6mBHeKuW8N8 RqH2sOQbcKn86y8CexHoItP/AaDyeTCLEe6IBwx41deAHmXhV06JXfvO8FkiQ2mo5Rn2 RjyEq4uP1NUeIJ6prToppFwTOlOZf2wnQQk1+4jExobPte8xclh2KDMKT1Z/uduvVK9K tJm3+uw+2XBzLZrW5mjYLtp8ZM/PSjSztiJSz58TuHQPpEMNVNEBfGvfHA40yUAu4XfS HJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850857; x=1776455657; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5s/GIt0tTjsOfb6v9VaN6RJdqFFBKJGIkUaXvnC2hp0=; b=cfTgpV5HFt6tPA+beKN95T4GdMqDH7lyz6WIr0sjXuPd0E9SOzuIIt8416G3RCZNrS pbFGbZDi7OWoyyjbJw3cRfEPuq+V8NVaXeobZHBu+nI64vBas8lG0osWx52GkV+j+dVs fhPYUCSbLe8iM0HWiO7KusksR54C/Mbn8dFSLsJqZQlLBEGQc0jRpFPLd36i32Y3WLLE sn0kaNiDuF06la5gPz5c7776bTnqH1G5o4WdOTMXldZZvlHPfYjhk5xJPwiPsuWnTlNe 9W8jmrk5wzR6hAa4MiLUYmR7hXb+F1VwDlE8HA7UjH7K2uA0IkKBPJhuyuqR7ZTkD2U+ wsUw== X-Gm-Message-State: AOJu0YyF109HeSywZQfLmk9TaJnjiTjiFiMLWFm+/L4Hg1PCQqguEHfr pdDOeSeqgU9DZLsfkNmoufQ7LZ4Qm7se/vOEh6YZ+1e2mECImjwD7LGVkSG/6rVLgnOk1c4enZ7 qa6xQy/k= X-Gm-Gg: AeBDiesVN5bLLXw9NlwKwNFD7jtoI+s56imQcKVPpu476554sEH8R03XwmaCf2tuOHt 4BO1i3XUpCnRgYDsPsgst9Zpfd9+28X9Q9tGpx5Vcuzx/8E0xsRQL1dnpxX45x2DN+SVse3UTvC ju+Wx3tX95UxWQgOYdT6jNk2sB0NZ3QG24E3pg+ZkkPj4XmROyUIfvy5lrI0Rw8voUTJ0Wnpmkq MMpL+kfJ5BshtcWkf5ywWwetPVmtaXWKfgbkn3xax9/PIpjj6+u9ys+sJF6iM/ZVcY8qt188crJ 2V2ewwb8HmfvXCGG4TaSJFfDAMwGiyqoRAZGCsGieneVCrH4XOz/xxrh256GKlqojTzhvM/lHpc nx2AkX0+dlSDAMHhK0l52ulsA1BNDIEfKXyWfN+0Qk/rR6BzhNhZrs9eMkGyFrb2ILf4d9hXHDW +FIkn4yiGkghOISC4c4SeZJsoQ3sKnET6ujn/5Jm/Guw3/5ni2JEtrASUGF6B76Zb84wycmUqY X-Received: by 2002:a5d:5f92:0:b0:43b:60f7:2283 with SMTP id ffacd0b85a97d-43d64289753mr6876436f8f.22.1775850856829; Fri, 10 Apr 2026 12:54:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu Subject: [PATCH v2 07/27] target/i386: Replace target_monitor_defs -> SysemuCPUOps::monitor_defs Date: Fri, 10 Apr 2026 21:53:01 +0200 Message-ID: <20260410195323.17937-8-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850930519154100 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 --- target/i386/cpu.c | 24 ++++++++++++++++++++++++ target/i386/monitor.c | 25 ------------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c6fd1dc00eb..968414e7215 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" @@ -10685,6 +10686,28 @@ 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); + return env->eip + env->segs[R_CS].base; +} + +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 { @@ -10698,6 +10721,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 ddc666d3451..a536712c755 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -591,28 +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); - return env->eip + env->segs[R_CS].base; -} - -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 Sat Apr 11 17:09:01 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=1775851054; cv=none; d=zohomail.com; s=zohoarc; b=CqeewaRkxQ+evJ6cPzedytqCKkm2+z5VMpyuOCTOUf01Fa1dFKkmvQ3Yr24GSrsvWYE4n776vMtwLuLBCDybwviXX4EnVXmnhj1MS3NfeZpmRXu6DY9Pe/J95uXd6RPLofPop9qm1Ei0QbnzjeqtCBw3668x7gYoz9PZlLSeeNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851054; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=EuoKZZrJIA/hKCIvNS2NFNqHU7220n1eLUSWyy7IvJI=; b=GHJ4XSnlqjPwOLEUB7FMd43QbNSEndxHaD/PcoxEHZu3VEJAPURDB7FsE0FxyKkTHQmSugWR59HhHECKjIGgo3dKpLaGSeyGFcMVKm0RZ7076yfn/ZfvfwVzhOFns2GS5unVm1d0oTHuBVSk7aIxSXb5z9FuIJ5oLOYWLtFzhJs= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851054925437.80827356222255; Fri, 10 Apr 2026 12:57:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHw0-0000ry-Hk; Fri, 10 Apr 2026 15:54: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 1wBHvy-0000pv-Se for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:30 -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 1wBHvv-0001US-I6 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:30 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso28740705e9.2 for ; Fri, 10 Apr 2026 12:54: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 5b1f17b1804b1-488d683e54fsm26145515e9.23.2026.04.10.12.54.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850864; x=1776455664; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EuoKZZrJIA/hKCIvNS2NFNqHU7220n1eLUSWyy7IvJI=; b=ojN2lMcenJRrbVuHebxt77o/Zn5ZVKZBHEVBGJKGFrAsQ7YLks9c02YOEQuzU1hjFL G6CP6F11HbakOLwDwlCzDvzamzNVMEtXIDUFuVMpn/MUERdZ30x4OS2sZld7rry3JJRJ +84Nu2FFrgsDxc/tIRJ8l6uWL4z5WUzGIvMzs4yCzQbOf+v4k9telaJaI4EIC9C6fIxD sw9pTAA5Xcy81MAjChhSCfc90WLGrrc/yB38o0YN+EyokhGGh0VsUmS3r4cbkmsXFkpK k9OlrtrPTlRdZ+zcj4WyfBBQ99YtOlTZc2awY46YP3x1hkOISZ3xMVElyTuVq8foo3mA 396w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850864; x=1776455664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EuoKZZrJIA/hKCIvNS2NFNqHU7220n1eLUSWyy7IvJI=; b=smFeGNIbMEcOJPE6PqTSG40GGJHyVoZJPPCjgr2TrDX4rZcWe8J12rjB4uC8FCMz73 EZk/8Oc+O5KuLVij35NQp66ipAfMfJPzjqS44/g6asCB6LlGfkcXH7P+lq7FDha59u95 bAoM0L6xgaN7HXtUQ/p0Vvpnjg7AKevwtUV+IFHJpGG2ocGS9ETM8AQrHYiTmdYRQBfD Ckm/YM0kv6/P9ztNhbYnXc49hVrPDu0e258TOC/ylbIPEw7p6FV+IEijNYhVxi9n7CHD CGE8NWNGFy0L9J5xo019pNV92WObTua76URY6CLJC/THgIfIdcwqzUak7ojO2SuhVAT3 QHvw== X-Gm-Message-State: AOJu0YxYhUSWpxWXt29OCuRsKu25cFU6xJtITVkrDV7zuG4WPeUZ6sKt RKILGTDWmShV3DMz4PJ2TrA0zPulseUqzzsfULtwRC5qXUf+DLrtEuIhKFTY4opd5pTVDWqKarT SE41tLQI= X-Gm-Gg: AeBDieujGLiF0rCmJzxvearRwbO9/FK6b40r0LtcDjVMl1EuVQKnIoKh2T0jAGGWaWs a0ZGJIWgMx+OCxoRoHQ0y4Ib18YTsuHuBlyEovccmBDVSbAUrbu24WSuhmwqF8Fi9yiDU0xQ7TS 9K9uSvDdcLgK0V5N8JkPR4PnLk4Caf4I266iY0xqEfMZxPVEV5HN1eAr7GHdlJ9eKWfnDLoB+9v t0AGIl9omMMONQ63CEPZCpomNQJ4E8JXSVIP3aY8RofGqGkzmZBV9oa31Z2uF18KenZnkMqKuVV aHo0TJzTVulpFmjr35xm9/nUZsJkButxMmqOYHV0cWaPEXzAqTByO2B0ttD4Pmb0dhNTaBsegeQ +nQVMAVqXd13ouzCgthFh0mJKOXOeiKTmLsFhNmkPo8dMg4XvXVJnG5DCwmuxnT9smYmomqEpLw 2n3K/NczIgMwOotM6XyH7ikS/rcFVeEsWotD+NcgtfftqiSRlDzjtLI1ruHDjrA9BxJSrCGjQX X-Received: by 2002:a05:600c:a109:b0:488:a977:8de with SMTP id 5b1f17b1804b1-488d6839866mr43608325e9.16.1775850863956; Fri, 10 Apr 2026 12:54:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PATCH v2 08/27] target/m68k: Replace target_monitor_defs -> SysemuCPUOps::monitor_defs Date: Fri, 10 Apr 2026 21:53:02 +0200 Message-ID: <20260410195323.17937-9-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851056455154100 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 --- 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 Sat Apr 11 17:09:01 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=1775850962; cv=none; d=zohomail.com; s=zohoarc; b=CcKYO01OGPyW6V8BcFqsiPSkKeu1Lxq2EyhERw3FERo14RnNqnvn3U0XlqFAn/X6XiEemKBSNzZD3oE6oEzo4R5SeX3UbD5a1I/IMpfWzUSS6sIxcEab0p+m8S+OzFbhQ9OnrXZ2/Le8d5qbtgtOWcADdvvqUuLeiACLh1yOYgg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850962; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=dQcummkxUOYYVBuFGYQ78NMsb9ycB7/JcbKGuZBFsZk=; b=nAGEkVzPjfI4mhWjakeR1KFNi2y3uJYS+rbbCP7g1VFfAs6b28WWSZQn9EJG7kWWSQrAq20yapHAXc9ozQGXOwckBea6Y4jER6LVYOMfp2fPbzAgj4vXF8YWJcaH4agS3ZzgoW7Gg1eYkNXAcLfPKG0OGewC30LUf6FpYWqxbfE= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850962617483.8078822267255; Fri, 10 Apr 2026 12:56:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHw8-0000yM-AK; Fri, 10 Apr 2026 15:54:40 -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 1wBHw3-0000up-9f for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:35 -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 1wBHw1-0001Wj-3t for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:35 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-43d17bb1c65so1645347f8f.0 for ; Fri, 10 Apr 2026 12:54: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-43d63e5d85fsm8603605f8f.36.2026.04.10.12.54.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850871; x=1776455671; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dQcummkxUOYYVBuFGYQ78NMsb9ycB7/JcbKGuZBFsZk=; b=kDnSkJhUbdGGH0YeXAdmyMRvkxlfwU5iDk+NAEZfHBiZ7TqiIVa5ptkvVMe9gunV7h ggQQ1G/McIXUZDiK7cMsysga0OeY3LTiofa654dRZpkL0/ruzDfQiGRH/guoeXOdZDo4 SHwycANaiWd8vHyMhVQc2FeJgLwmjC/RgMWwL5o8qUcOjBt3oJWcn1qJ7X8/YWPueBeS HoPgBbg8BXYFApTOaqi11KrrdcKIck3OvxpT7jmkBoPX1mgJ2Z2UcU3PQ5kTxVmYXNKN NUrGFMBfUPzLbn3uCc1R1aeUPmXPNuNJYpMy5/PBUBZWwkcT/IhmY+BdP4+xmcmaqHtp oexQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850871; x=1776455671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dQcummkxUOYYVBuFGYQ78NMsb9ycB7/JcbKGuZBFsZk=; b=D3P+DREtlttL9JXwFW7ZtvFhbkY7g3JpnH4bkvrW0x0csHKqetiHjetfbBgrq8oakE tGv6FzK/sCrFX1NLpwjbyXZ7lsY2NfqyOxrf6R5D7lmS3mnpejvBmH4OdHHq+o6PoLqw 3X9XThGvby3Jq/HF/zsXvtPWwHppSUhJqUiRvtd2upItkbAt+f9BMmpTfEo6c9lmBeq9 U7tLzMlwxsWGZMS+GjTIVevxpsEDy4TSWc6VYmc0YtS+93yHYqVLgNMhnk27RVS3ci0p MDChqKwzvp1kFb/0dwc9vYM5QG/4qnZZZNzlp0t1pT4BlYuGG74f5ArD10TDiUY5EzCb oMQQ== X-Gm-Message-State: AOJu0YyZjplReKYbqM4oeA/WOEavAKji5WMgXVP3dJNRwOTltFq0W06H O4aguf3SzWjXb5/0Ja4wgSVqJzNv1KRDQhOJV/82WAg+nwfZyEPQUl2mCRZXimptRj4Krxn1Owh kVHehMgM= X-Gm-Gg: AeBDiesMbQFI/HE2boGCNMQ8FwWvWTB95px4C0mWBm9fkIE08FON2waEgnMHUxvBZXL dld8n0pbWkpb6mpVwddW8/iOB5esZ12rMyt/NqIlsYbmcbs5iX/XE5e632RfhfRAnUvhLwACKmi 56TDJqrfCQ4AoI54kqiu+WI7mSBxsE2rRM1zPdjL2ysxdWTWJW64tzVyAN2mrEJKkyeO9Li5fj7 fCh9UX/A5CpmIXhhjrG01qm1f55bAne1MZEFUs/hKMclVs6KCqM8/Sm4Sr2iVpMDz796cI6B6eF 4OgBdN25iGZkjbJwCWUN+eIdyGoHBW2NVKsgSeDzLtH1VrwitcDARqi8W7YKQymS3v0KjDY2bQW fMhRsui1B7+xbKHJ5o7aK4nxzqA27UCxSDq+H012P3B4B0i6cNlK7/5Zzea0gLKOqulkzaZzK5M CLEH2AdXuUVdfCXokSfPKID5nZASI14HU0E0aZjzyJjlKoaSGGyH8vHHKkcckIPooLo1Y7RpJA X-Received: by 2002:a05:6000:1a8f:b0:43b:a21e:9c19 with SMTP id ffacd0b85a97d-43d642c080amr6854206f8f.38.1775850871272; Fri, 10 Apr 2026 12:54:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH v2 09/27] target/sparc: Replace target_monitor_defs -> SysemuCPUOps::monitor_defs Date: Fri, 10 Apr 2026 21:53:03 +0200 Message-ID: <20260410195323.17937-10-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850965058154100 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 --- 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 1493336e7a2..9c5175aca34 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 Sat Apr 11 17:09:01 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=1775850933; cv=none; d=zohomail.com; s=zohoarc; b=K6Eef4xzchTyPokjl60gz9bbVgvTsbdW2tAg8Si78x+jsHN1sDOhrqOor1sSJ/nByqyh1EeK/tTXU0jvNbnINHIFtlc0bBFu/9bPA1+SzW8QQmpsNo8R8G3KbyoZKBdlkXtj+13vS5Uy6JJuRVldJ6eUroT+Lo8fHxMgl5CGF48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850933; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=NZ5l/yASQ24ZYUVrEW0W1fOfIxn1pYjbKa7VNjc5dpE=; b=e+ydxaEAel+9NMdztWAtZHyntVrv6eOB/zwgJx2AiztAJ7x8WP4L9vajw3ANMxqGnvb4NhFMOdb85OX9PUp99ST4QEOruaQhAM4m6SIEcuSJlwgwnXfdMFu9nNedJ+T9qiJgvWyEv4BtkaLn3/itdm+kaS/NYDKJ9zXvrCE6b60= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850933943300.7805081525971; Fri, 10 Apr 2026 12:55:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwK-0001J2-C8; Fri, 10 Apr 2026 15:54:52 -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 1wBHwB-00016Z-V7 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:44 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHwA-0001aZ-80 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:43 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-43d23305225so1667229f8f.2 for ; Fri, 10 Apr 2026 12:54:40 -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-43d63de2a48sm10271471f8f.7.2026.04.10.12.54.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850878; x=1776455678; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NZ5l/yASQ24ZYUVrEW0W1fOfIxn1pYjbKa7VNjc5dpE=; b=TxmTe6/UYCq9VPOZRRjhbAtXi5iamWZtPB5x07RlqrB9UFtuAXwCupkL/MtmofcLSj L6Sct+Vi+1kYmkAaXX9CvvUalEGf0Z5wivBKl8IdWdDFT/sLIKNpvaSqOyOgOUqVuyP9 CLHUgQL7lh03SEPqghcaqOuvzAnOoXq1lB4va9l1lgZZdm9/GYbQX6zDsBad1nwuGKi1 c41GKBKCEQqvx0IQYb3uiA6bxw7/RQ2RNyASFtqOIaf+R7xyDnaV1MWGIWQJWeN0m574 bo19GhCFkPLMOHUta+eIg+BkaOSybnhFfRvJwsqt30Y6L5yLfNdXByr12JWgBl8sNBp+ /TgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850878; x=1776455678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NZ5l/yASQ24ZYUVrEW0W1fOfIxn1pYjbKa7VNjc5dpE=; b=EtC51/AolYsdCyX5aDBMVdMn36YkoCPCDAhMjyHgNiU3MNRJi3rTbTMElCIITy1u1Q g/fIBhTazEBoVYzwTRYNxpkKQ0s9L9EHCb3B6/vtm75wGArX5vRFsc7J4l4fMafmtYiM oJ7hOg7N3zb5SvjziY2MPL8vYcr9cU06GuGN8qFZNaEYZqRGIZy7GXI4mr2BZkv7LX2Z dDhbSBy7ZVf2YypACgWqNbC9ZWJ2BBQVpScmR8hvhbxQ29AxrRTYmImV77BKgELh8e24 Wbfvv/5lQyzR9RGsrUyPgGpKBUnBRgflpeYc2OvkBdcGGjxuy5+Dio4EyIPDEchhoy4x MWSw== X-Gm-Message-State: AOJu0YxvwXMwih3wB2NOMTZ5RjgrProEshx1Od1EP52BdVRbKiMGjsAV rn1wPxxPv7s1s0X34tWRjrNUxprs5iFBl2msFMpGsaGgZ3pMPM+2laIsyrLg8NvlT2/JJjJd98O JwFZxEMA= X-Gm-Gg: AeBDieuZ1edtGySxIp1HIb4E1FS5rtoX2dUA3t8/pPk/pBo81TwMoI+p1eQQrmD3Ol5 jOVEfjFxvDEjLtETjsQVHcTuRRrz9G4FfnvEqhLFURxFO+z4tyaznc0Z7HqgQGEDnsU3cCAZjrT RvXvn3BBy5BUyP7VKWmrjZZk1G5KuySGcU/75OPHM2Em6x2RJ+97rvrUKeG+m2KLxwIAWgXCdi4 mYLiwY1mQ7R5K8Kv1H6tMdKG4w+aUAwZnl5kWpS35xcyaj0o6Cr4WRdmF3/9uSvXI4pKhA9eRfk lm2xHx5z7AdBWadXoENHenydnBtga7dhZ9xhUMutyVH+LX/LeRaK2NU3Qmd0ZT4xZoT+2LWFmG0 8ktGW6FyDQBe2c6qJP/zxgspmLyjw5AQAvRRJBU8kINWSUVXAdICq/IBFtrlkv3Z/uTnJA255Dx VA+O4OZ9wroUFFrEVf2sQ1iCQVGqHKrMIZoaBHIojdlN2pLYrc5Uf1yqer3sucyE2zcEl9BBLM X-Received: by 2002:a5d:64c7:0:b0:43d:500a:1e5b with SMTP id ffacd0b85a97d-43d642da9e2mr7199206f8f.27.1775850878373; Fri, 10 Apr 2026 12:54:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 10/27] monitor: Remove target_monitor_defs() Date: Fri, 10 Apr 2026 21:53:04 +0200 Message-ID: <20260410195323.17937-11-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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=unavailable 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: 1775850934532158500 target_monitor_defs() is now only a dead stub. Remove as pointless. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/monitor/hmp.h | 1 - monitor/hmp.c | 2 +- stubs/target-monitor-defs.c | 7 ------- stubs/meson.build | 1 - 4 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 stubs/target-monitor-defs.c diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 516089eb5c6..cabb2c55f8e 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -23,7 +23,6 @@ struct MonitorDef { int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); }; =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); diff --git a/monitor/hmp.c b/monitor/hmp.c index 6cf2f3e65ff..3d812ea3068 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1613,7 +1613,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 7189ff63ed5..10eb68ab55e 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -75,7 +75,6 @@ if have_system 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')) stub_ss.add(files('monitor-arm-gic.c')) --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775850925; cv=none; d=zohomail.com; s=zohoarc; b=CY3nXz4X9eP5g9U4qNrIpcOEFfKDXdvJVhB8Lyxo1qSI1u7duKGxiJfD0JUT0V4Szcw0WRggaGgrBDnIsK231xMrUPBGkjhui4cc08W/eQSPNZomFE11K8QXpJTfsS13kW5oPYWct4rMqQvhWNV29qpkfFVArktNnrKiRmlVb8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850925; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=m5TS34D7gzjspZxEtF9wQrQfCaZf1oD4hCg5mbcwpKM=; b=SJ1QInZsx3aQVH6Y5SjAcxWhWs9ooQnNUfrr/wlhijnPGGMcn7E6dsgqzzLT7cVrkGpel46v9EDIN+c61gfov+izLbhBKBIdjOZI3Ujcu+vzxafp77aCsjIaMgdDsxSDfSdQjxSowBGAQiwvQrHSx518s4XaUWa3Knk6yGss47s= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850925583682.8964558933537; Fri, 10 Apr 2026 12:55:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwM-0001XH-CW; Fri, 10 Apr 2026 15:54:54 -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 1wBHwI-0001BW-2X for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:50 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHwF-0001dL-Kx for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:49 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-488b3f8fa2bso28951115e9.1 for ; Fri, 10 Apr 2026 12:54:47 -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-488d533e596sm100071985e9.6.2026.04.10.12.54.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850886; x=1776455686; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m5TS34D7gzjspZxEtF9wQrQfCaZf1oD4hCg5mbcwpKM=; b=D4cVZwWg5G6vikaYtnqJ0velvbp665UIoB5AuV8a+MVz2g7VFRsf1hUgVkbc94Mcl2 1wpevKHk9VpZ/FJrZV8HPskaNRk1ZEuR/MP5NTtAxaAkM0ey74oCyJorQ97pjlyXNLwJ f7xOKnMuBn/mdLg53gO2ipdu309UupGlO9cYGs3Deck6Hx99JcIOuuBkkBRziqP1Bhnb 04jSYZYAVRm/oKsR6iO0QYf0I+Zmp08gf0YflPNKC9Mk1PSebWBJvsXBN0Iuf5vPv1+G HPdExj5nuhG7x3adFADM/OYvPG7edQi3KJsEtH+1wk65qqs1XOkqOsD5a/LA/pV8xsSj 8wrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850886; x=1776455686; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=m5TS34D7gzjspZxEtF9wQrQfCaZf1oD4hCg5mbcwpKM=; b=QPxPzIs+srql0aLSRh7ukE8lOwAtm7eWozdV8q5c1cB0pr5aCfreGiqtTxIPCAEPlJ KbjqG97WhO+Fu/G4e/mTeBvr58d1/g9uUqSMrzgTQEA0r8S9z8ucP7qZ6gFmwLEVyVuU e+kgxjgUl2P6GNDFkfs174iselaevxKuEQyOLDPNsYs8ODWM7T8Wq2GKfGkPdI6J5s+T l6NGBxZD0NtTtIge0lgQgdxP1oDmSVljr4H6cbJDrxS/GdbFQbqxwGUNQpocQ8uweyaX uk9YJ4kMqazm1GBRSBONELbVEttCGk4fkScdTkRnNFDnXE70y0hiXP2UviEca/9LeUUQ oy4A== X-Gm-Message-State: AOJu0YxdQCjatj1A20qMnQsIIi89mHVpbwPTGbp+ore4lbNcjK8KzIo2 EPfwsWZhWIHtTafKVWL/RpRKNGfYO2Z/2S+mNC7+Tnjca2PhAo3SFYpePl9IQDd31MeHSzGhcGY sj6wOSgw= X-Gm-Gg: AeBDies8T1phBUAZJpAB6D9YixU9WlS1uKQ4yPnBApQHGOKldu5M0AVDm4lKUQqb4Kk eRrmftfKNRBMg4Dc9YWMGJDdM063+41wX9217wDzB0jwmzVRx9DIZ/wJsoWdmOEZ53dIiSy7pqD MuZ8R7QAXG9BohwcFwXkGC3SL5V5ZIn/3Iz35o0GJYUorBoriCB3TyC+0t/t+fhRdBknxb04Bbe +JFoSFWfia8ZvbUMblEhQAcBmZR82G8WIXN5sVNGcvL01hxbOa3lPSfUPyxyiKPfJjADvYCqnpm /ZNmB4ZFYlfRquUGmvUabr2t2zxvkaXi+lOYM0uxyunH72CQQM1OOoucDAvdVB4ky+eKdYqHgWj CeBE5fx0bhNrBQ002ugMvmvUkDtV5ifjhXPJPtynfvvJuAxftaV43T5lrD+Qgis5O3MeNsFN+53 28rplaScmBH2c9QREr0DV4H+Pw0Bj+i3GRNAJnEFcmO+f8yNqiFe8SPH1Nd23+j9mW5y1KIGxu X-Received: by 2002:a05:600c:3ba4:b0:488:c6e9:1e0c with SMTP id 5b1f17b1804b1-488d6847de9mr53887245e9.5.1775850885735; Fri, 10 Apr 2026 12:54:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 11/27] cpus: Introduce SysemuCPUOps::monitor_get_register() hook Date: Fri, 10 Apr 2026 21:53:05 +0200 Message-ID: <20260410195323.17937-12-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=unavailable 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: 1775850928688154100 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 --- include/hw/core/sysemu-cpu-ops.h | 8 ++++++++ monitor/hmp.c | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index a96f4907d05..a9200ec5737 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -85,11 +85,19 @@ typedef struct SysemuCPUOps { */ bool (*internal_is_big_endian)(CPUState *cpu); =20 + /** + * @monitor_get_register: Callback to fill @pval with register @name. + * This field is legacy, use @gdb_core_xml_file + * to dump registers instead. + */ + int (*monitor_get_register)(CPUState *cs, const char *name, uint64_t *= pval); + /** * @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 3d812ea3068..799855f3f68 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1632,7 +1632,11 @@ static int get_monitor_def(Monitor *mon, int64_t *pv= al, const char *name) } } =20 - ret =3D target_get_monitor_def(cs, name, &tmp); + if (cs->cc->sysemu_ops->monitor_get_register) { + ret =3D cs->cc->sysemu_ops->monitor_get_register(cs, name, &tmp); + } else { + ret =3D target_get_monitor_def(cs, name, &tmp); + } if (!ret) { *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; } --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775851055; cv=none; d=zohomail.com; s=zohoarc; b=c3OFZupOn3i9lktE+BQHZfiHxyMuBb494Ki2m86bryW39HXEisepX0gf/FXU0RCmhDoTla24c27fLq4NjwYuayR0Yj8axi1FNE0snSafD7VMZ4avytn9CfCdhuko/06X91rEpuSIB05SRfH6hCAIOBOUjicfQzLyiCTxOmcbxw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851055; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=Fh21TaJ8ypSq1QYVzVlTyt3qC9Wy73HL07UKYAF+YwI=; b=D0VcXbTToZ4/U3CxqwQu+dUM0tbDNN6bQsl7UTMZjgulY5KCQmQECjAa7/CwB/jw0iOu3wJIuJxWyakTM9h36jqIHvSRhjMW0yR1iMhjQFuFUC9BvpSTNS7I1OGr42QLt59Je1aGfD/VTCTnUZOij779slBxxzavw43LlY/DsTE= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851055083338.4317991032035; Fri, 10 Apr 2026 12:57:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwR-0001uk-7O; Fri, 10 Apr 2026 15:54: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 1wBHwP-0001ne-JH for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:57 -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 1wBHwM-0001fp-R0 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:54:57 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso28744825e9.2 for ; Fri, 10 Apr 2026 12:54:54 -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-488d5396293sm84794825e9.15.2026.04.10.12.54.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850893; x=1776455693; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Fh21TaJ8ypSq1QYVzVlTyt3qC9Wy73HL07UKYAF+YwI=; b=TGFVtCpGYmPsT4teK8F0a5UXze3GU24UHg6FJ8oSPqgbtX5bahNZEZBQ0P7ds76g2G Jd+Db68E9AEgoX81Rl6Qcg2oSeKpw+FFBL10HMrSeUpQG6SRoR719NB5XSWjoY45qZia IYrcaVoNLj8tpBRhva25hnn0JZE3Io7tSoZkmNMSBIM/ErW4Z5h0C4i+Z3C4vbWmUw29 EE2mITArdjdHf+hxljzdbFiIth1yJcaOgYXqoIOx0X3NuZEYKdwDIxr4/Qcdika0a9kO uQWyr9oRV9VRGSxh35ivYpu9+OGE1qkztge6qr2mvo5f66vNFoTiyXaMHKQ3Jmk/HCWt 0YVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850893; x=1776455693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Fh21TaJ8ypSq1QYVzVlTyt3qC9Wy73HL07UKYAF+YwI=; b=g23eRlPHlnBENs1LTg2UO8ssHiHuTbWCtJH8e86SrXRDnVljHmrWVBopSYpoQuIeKo fCutlj/pb5MBj9o20HKhX1P+uBWfW0Dg+WeV2aJiQnd9osY5CEPmNOnIpU8TrlPwYmLj rPrwUbkiuY/Dj6yHbOVYVqJL8+8ppJ2leq4/L1G1gOTKrIBM8Y6g31HPst2nMcXAAyG8 jdO+O6I6g6xXYBJ7+ilMqBFyhkttqkrizZIxtMt2sd8FvOaAC7FbSRAsRpnBZzgLfXBP 1YqOFpgUqLnX7M/oZyR+4ObWCAtjO76LKhkVwkjX2oYOfYOL5wrRLzdCP/yXI6HEDfbj 0Jbw== X-Gm-Message-State: AOJu0YxCyF4i40sbPrKh89w72f6u8FPz9VdktI8syOPZuFIx/eDijMR8 srYpC5SdYdpBtrpOoQwvzdXDlKqoYRLRtfXNJlt6OfIhKkN6PuVZ3cKu6AArWgWZcCbsflE9Apc InmnpydA= X-Gm-Gg: AeBDiet6rb0OpOmwMl3AUWi19qWJAMBMcympSy5VqhOE35Jx9RFem8LQwJE4TQZ1kTE XHWHArZ6IhvK+7kZMyoL0hzexWNurNJcmL0r5JuFyyjutr8C5PDSFaDZR9hjp/lOgtm8dfNA1uA 8NTtsBdF3IwcD7H6u5z/R5+8jer5yUU/g1UanOkifG/3Z3ut97WqQUreZekRCMo3yScfyiiWIhb wkehvwvlDHXxhPiVzMKd8mMa+Mxg5s+lbbacXeTcdlW1Fj03WALjGGFSoZ6OXiUHQuCAL/lVMCO daPPbz3wqY6H5keMa1phEknxxqMZ5jtEaij8qhD48KNmEItgv1IBIyiSOfaF0H9X60rm1wqOZyH rfjDcp5yU1OQEItYiasDHYLFzES0YoZ/PCg7u8pVEOZfP4QtxOBRA83fEXaFWrnmF0Qcxvp0qPZ +L5GrFVMrmnsFSK+E4nzeoGDPyDhYow5MT5pPj2XXtxcNUPaSv5KBjWeNsyHYr69BcXi0Optu/ X-Received: by 2002:a05:600c:3b24:b0:488:c078:bfda with SMTP id 5b1f17b1804b1-488d688d2a1mr56635425e9.26.1775850892918; Fri, 10 Apr 2026 12:54:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu Subject: [PATCH v2 12/27] target/riscv: Register target_get_monitor_def in SysemuCPUOps Date: Fri, 10 Apr 2026 21:53:06 +0200 Message-ID: <20260410195323.17937-13-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851057267158500 Rename target_get_monitor_def() as riscv_monitor_get_register_legacy() and register it as SysemuCPUOps::monitor_get_register() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/internals.h | 3 +++ target/riscv/cpu.c | 1 + target/riscv/monitor.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 35b923c4bf5..7c91f1872b6 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, + uint64_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 3f206b9fca5..1c90c779534 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -26,6 +26,7 @@ #include "monitor/monitor.h" #include "monitor/hmp.h" #include "system/memory.h" +#include "internals.h" =20 #ifdef TARGET_RISCV64 #define PTE_HEADER_FIELDS "vaddr paddr "\ @@ -310,7 +311,8 @@ 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, + uint64_t *pval) { CPURISCVState *env =3D &RISCV_CPU(cs)->env; target_ulong val =3D 0; --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775851089; cv=none; d=zohomail.com; s=zohoarc; b=b89/FCV1S6kVftHFPVWN8/5zullhHFZfU1f1eoYjEurfcqYljWMpSiwIef5wvyhKG+DPcycvAIV5qpTgRseT2eleptnY0so58UWNpaXKhRd9NIBdgBP6/ZdV3kPoq5M0pqrVUy2vcAWr/m+TXKtJ69Xw2ZCpeS6Vi3uAbOmsiFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851089; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=WQoGjEROfb1fZGcAyFP7wGDHaXz8m4JpMOdQttRvXaU=; b=CGZyDJvN/4lK+hq3VsaLb8b9GtB5hx9WD8VH76fOFkcqD4M3Un4sWuynMQ3cOpPY1QXEneo0RzToF6t12OPEtCu+vDjjWk1/nlbjkVjjlXDc8S+8lNal99SgU7YRWhxM60rnNTnkpgw1I/QTWkAFrXZlqysLwy+miEvYo9hy4KY= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851089250463.91875617575226; Fri, 10 Apr 2026 12:58:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwZ-0002HA-0c; Fri, 10 Apr 2026 15:55: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 1wBHwX-0002F6-7C for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55: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 1wBHwU-0001is-47 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:04 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488971db0fdso23955315e9.0 for ; Fri, 10 Apr 2026 12:55: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-488d592d606sm88600455e9.9.2026.04.10.12.54.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850900; x=1776455700; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WQoGjEROfb1fZGcAyFP7wGDHaXz8m4JpMOdQttRvXaU=; b=hDwdKDl7XKAPOkK7kPQc5XoqlmAAHXUIARDvA/fb5kI2SKFNyGZRW7XLz3mYNBmk3x NBTkIhYVrqRdIBETJfqAvJhskn4LIUQF5I0rErM0yN67lSoMy4+xOogUrGmIP5wbfJD+ 5O8W0CYd13ZyZ78rT5vL5PyPBQWWlvPEHNpkLnyCI2oN03hsbB7vK3eokDcL9maURGW6 GXAq0d5vJXqgroNWz6GhdM/XMM83UM9y6UyHij8h8yUurd9u8u5fhnLCxkCIyJwHLeZ2 3UEKcOn3b6H1KGpcrJIjBv+hUDRLLZSFSzYnVFX2SyNAzIoILW6r+bMy92L2IM9mPcg1 lCag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850900; x=1776455700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WQoGjEROfb1fZGcAyFP7wGDHaXz8m4JpMOdQttRvXaU=; b=LbpD3uzXFANOxVRl01R6OctMHL0nSjeW1JirvnI7S0TGATmYV0yQRognO+gIMj+FRz rK66jGMW2sADBMaxtofUalp5ZwKgi/Apz3mnP7a65Y6vvcddCwrqiqE4MyIsiLPaXfU/ RLkkQuadq/PPDKXFDEXX0+mDqxn2Bf9Akx2UXadBE3rSJZug+TXyuNFO2BkNJTaaAOtV 6NCAYD0QUAdExJqnWGq9gevKgzBrLnN0Z6mo3+dh9AibjgcfohpUmVL+iYpw5NJpKBPx Pm+p1wh6X0Dz4MXsh5OaF9CpCSrTFGYtnPfrH8M3Syo3SlpWIJr6RkPpluqo9FNTTzW0 w/Gw== X-Gm-Message-State: AOJu0Yx46aaHkBz2w8uF6rQuUju/6AdxMv0rzS6c4N4FSc4yDYnA5OuE gE9f8kQfdbRMVvYOLRb8kqYCc4dH1Z2goUOIFnFdDXwdregixWBSeSGbJbT50wD1I5obpg8L82C M3TCE1Cg= X-Gm-Gg: AeBDiev24ThVSPFuBZTTklrz/OOb4cYphMI/zYaGh6uVMFcyJ8npB9dVTojp/QXWJqs 9b5PYz6jOUbwgTjya0et2qnIU0/DiZhO+tMmjTFt9j3lMNSsWth7a5+xuuH4l195STaSV/LOjoO ZnhqWzq6k35UwiB6NYWnlMoU6ReF1YmmwCqcKKnn89JBbQWTgDuTjNicE60PSLzve/vys89P2jC 0C+KtxqpM/GLRldFURSrjNbmw2YCWsgq+OaWWZ4DixKEJbZoEmwc2PkQnyM/60m+3TnFuqEJbV6 cRsXKfQWZOJPd0qvWefNrGgAjtRXoqxEA6kvY+EWvZZOKpr+ZKzt4zNkFnF0zuEPLJ3nrfW0HeV l+u48ZR8Ah8Vsglj/Y+kMZWfsAhyqUU5KJINAce7t2jVhjR+ZBhn1xDgncKnollQJVd/Y5IvSFI ZXwbDHDGQF2nMHPqFUZXyj7ixqX0eA6tELf4VDeGGfBaPmlYvv8O8j4yA1ka4DK5w/JCk375dF X-Received: by 2002:a05:600c:c0c8:b0:488:8bdd:cfb9 with SMTP id 5b1f17b1804b1-488d67bbbf8mr42408135e9.1.1775850899858; Fri, 10 Apr 2026 12:54:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 13/27] monitor: Remove target_get_monitor_def() Date: Fri, 10 Apr 2026 21:53:07 +0200 Message-ID: <20260410195323.17937-14-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851090987154100 target_get_monitor_def() is now only a dead stub. Remove as pointless. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/monitor/hmp.h | 2 -- monitor/hmp.c | 7 +++---- stubs/target-get-monitor-def.c | 29 ----------------------------- stubs/meson.build | 1 - 4 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 stubs/target-get-monitor-def.c diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index cabb2c55f8e..b444095f684 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -23,8 +23,6 @@ struct MonitorDef { int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset); }; =20 -int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); - 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 799855f3f68..3b9e180c1ca 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1632,11 +1632,10 @@ static int get_monitor_def(Monitor *mon, int64_t *p= val, const char *name) } } =20 - if (cs->cc->sysemu_ops->monitor_get_register) { - ret =3D cs->cc->sysemu_ops->monitor_get_register(cs, name, &tmp); - } else { - ret =3D target_get_monitor_def(cs, name, &tmp); + if (!cs->cc->sysemu_ops->monitor_get_register) { + return -1; } + ret =3D cs->cc->sysemu_ops->monitor_get_register(cs, name, &tmp); if (!ret) { *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; } 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 10eb68ab55e..85f9e3a4f23 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -74,7 +74,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('win32-kbd-hook.c')) stub_ss.add(files('xen-hw-stub.c')) stub_ss.add(files('monitor-arm-gic.c')) --=20 2.53.0 From nobody Sat Apr 11 17:09:01 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=1775850951; cv=none; d=zohomail.com; s=zohoarc; b=KFTMiICtpPzWe3FQlS+ugsVcAA5KkjOOuU2iiIko2/GCnpDhngZMT+PVaXUX2Z5m4eL68qx22RmYnJlLlxht50U0mNhfhZ16ThePnuJHtnT4oG6l/syWHV6tsRGkmBhkIgCwWLlZWMO9oud1aUeLc6ahCHGCfKDwMxsxtP+mz70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850951; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=1hmYqwWSqPmJMgJvimCb5gTwLjtaQvrO8BVqR+We6PI=; b=np5LsPWHlJvCDTQbdo/R564GGppIoL6+2EFMuIq3ldO0Wvio1Xw/AMZLP7JELVAnKFsTEeyEgb8/XaF8MWk8Qkr9VzkNjk77RXRGNz/vH58IUXMLwuRP32DJwuBQYIRT//1PjxMoSzy+aSvaLPEN+yQB3IriN+zaf2oNbqo9NPk= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850951247570.9744100537761; Fri, 10 Apr 2026 12:55:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwe-0002Ro-BT; Fri, 10 Apr 2026 15:55: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 1wBHwd-0002Q6-22 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:11 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHwa-0001xw-Nm for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:10 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-43cf7683a28so1617494f8f.2 for ; Fri, 10 Apr 2026 12:55:08 -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-43d63e468d0sm9671181f8f.18.2026.04.10.12.55.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850907; x=1776455707; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1hmYqwWSqPmJMgJvimCb5gTwLjtaQvrO8BVqR+We6PI=; b=XR44ntTZGA8OiXTeDSwE4T+q3zMF+j8TDb+Ng4cU1eSMmgI8rNg3HzWndJNenAQLo/ DbtDwaMpwKj8YQ8eFdu2KtTCf2s1iBIi728WMB9u6y2Lo4JwpMu2LACkS21B2o/azr58 TZhBDa9Z6F8+pyV6GnE4TFHefUj9Vt7gEYIGa3KdR9pDBUB7i87X6ciAMEVGdR91gnll sO1a9/eXGX26qr0eYepo4/nenTxt8WykjlQjxH5NajTPCR0OTq+ERR3K+xRgef1obxgh BFaxALTvK/rYzAfLyED8M39As3Xls8pVWSU1chl1+j9yTHFnwaj4FpPj8NckN4O5tKch 9yuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850907; x=1776455707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1hmYqwWSqPmJMgJvimCb5gTwLjtaQvrO8BVqR+We6PI=; b=tKffO2OroTHmUDdtfYS4VaOjQ/XYsfYXO9yrE8K/RPbJMaM7XeF+XjqrfaPiF3gmdb /8GSrpQg3hJwH2awsw8oG21ggIvbxewIxpGaY85O42QXx0mIlbWVQjV0KOHgtSaXk6/c uSTYHREAcbnE6RfxpGNl3skzHLIIbrkT2G202Pjwoo6DN7Bnf+QZIoUR7d80WKBr5plH QEWeyjqWuaUrziPnRamfvfdUCWzNBs9bB/l1/P1QlJZjqHVq0dOBjXQGw3f5B+vTWXwM VKr4y7dymmKShgNEF+LXEJxXADM/eom31i2rWHvHNn2ev3gRBeFWKvmiGz4F+1d+0yEX +VMg== X-Gm-Message-State: AOJu0YzUyxjkSk1AOQO34K4MJZYMcIfrePJwUtPCtH+TRjVXyA3mRm8k DqOlHYW6Y7Wu3Aj1HJFfhrrjZ71wYO7PO0sUt9K2gUzoqMHG95uvnbRO2wnx9J3SBJvoWsZ8XxM SUepTgdE= X-Gm-Gg: AeBDiesI6YESAamBSYfXnyVpxtBrMbL2q1CnFRncLf/h4ME8Qt6OoasxpeotD17+yo4 D5NLGxsIE66lF9sqki0ImTWEB8uTKF1NXVJw81z5NtKbRM4gRM1Rtu3cf0PCneb4phFMEFh8nt2 snnfnw67yRr52EZWLa34pp3QjMdT/lEBk5oXPG6j8O3NubXV0qswR1omVIJgY5duGmLt3I2DC5v Y4ptYCpQB+k1S5EskyHBqb23o+f1LSSxYHqMtMoYxBc8tyubfABrN8PkPVJUdcWoFEH6yPiGBdY QNj4hctlCdKHyHSVx9ccAUrCU5lcWu+xdDc4AxYxvBkywKJbVnT99Ja0SnSTtNeQ4kW5W/aQuxv Wt6oL4zRt41d/2GBKT/51VFIHaFMMGrkGOkXxbB5kEQDktKfjQB4VYPeCNZM2YyqrpMZhsMdEAf NwGe6jZfGs2jIPGf5h6LzxbSS3yuV28hpwbqBQvJTdFQyGO3rkwUOHEZ+536eKB3Kzyzr5vn3D X-Received: by 2002:a05:6000:184b:b0:43c:ea2d:9c7a with SMTP id ffacd0b85a97d-43d642cc2dfmr7403832f8f.49.1775850906890; Fri, 10 Apr 2026 12:55:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Fabiano Rosas Subject: [PATCH v2 14/27] monitor/meson: Use SPICE with migration HMP commands Date: Fri, 10 Apr 2026 21:53:08 +0200 Message-ID: <20260410195323.17937-15-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1775850952649158500 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 --- 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 Sat Apr 11 17:09:01 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=1775850945; cv=none; d=zohomail.com; s=zohoarc; b=dsJAjO6l01JaKFU9gSNDcDbJQwuedGSobXXV3Buhv+xJMH98htGQR8U1sljTFy06vcA0qI5iM+S8TaEJ1sNCnvYnpvrYrTOug1MKAAhize8nEycZ0Mtkk9qMdlig8ey0JXdg7qP/3lpsLHoIYByxTv7/vlnzvxDzSxfp31MuxU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850945; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=6HAEsPfskfREToikV46U/wzGFh7dU/0uRJHIvrZhc2k=; b=DRpsM6Or1Affty2DP8ptRqYKBYHIqSg/r9UyGvLAAP3BjwOP9vgbBxzt73wp04rj4Iw3UfLzH/YZLNJF9OpI3M4Bxv9Ye5PxnuQtWlaSTpFsRzMXMlc9PEnBkE2RrA+qaGxd00xukGwvEWilNFXyLi+011OUdientu7ZDxJ0xfI= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850945839703.100646053105; Fri, 10 Apr 2026 12:55:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwn-0002xp-T4; Fri, 10 Apr 2026 15:55: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 1wBHwl-0002kp-Bx for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:19 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHwi-00027T-7R for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:19 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-48334ee0aeaso23616715e9.1 for ; Fri, 10 Apr 2026 12:55:15 -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-488d5d80bafsm29702685e9.5.2026.04.10.12.55.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850914; x=1776455714; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6HAEsPfskfREToikV46U/wzGFh7dU/0uRJHIvrZhc2k=; b=r0bVxLJ1D0yokeu8pO4DRnbsVu6Y61xTQbb0rAc1LReFEH1BwRx/HrF+JgB868QIqq TE4lda9jJl3KqVKFtK4vACPA2FNv/vGrgOVm9ZKB2HSOZzV/k+G96NH930aB6K1ylhGs nwfJJZDXhg4/zMgFABfKF1B9TS0g6FEwaEIr9wI5d6w+FwXnK3S2OLB6eEb5i3QA6rpi WpXfvOld3zVrQbrOFH6+illDvIIQ2T7pNiXny5+hzbLARde0lPOCc4tkyzrTq4EN0L/U 98eXUqV22FF1XSt0B1yQxtArSb92nHNS+8ByBiuoIjwyJmOYzHwEA7ltPSFQBMMzP7Jo 3YrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850914; x=1776455714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6HAEsPfskfREToikV46U/wzGFh7dU/0uRJHIvrZhc2k=; b=mrvXiWOrfXpP12j8bKhKh0+eIWvTCcaU5W4vIE7tMUdf1dVO8iLT+xPeNflWh99qb1 sr+Nrf646g0jM7pauY3EuwsaZ9FVkznA8FJRX84k80DM7/ZmVYK3OQXHtExrn5a+vxXN Q+eClDtcRLJmX90xVZhawP9os5ekiNr4yxP0msILR0uXHvlVN+4v9bTMkpTYU6z9UDxk oqqJxVaZIWXLolJKfONLnwSwJEfOhiUPEuK9ShYmTRMuo25izE3s4dPse6WLjceLa/dj 0nw4tCZrXlSxEcdw1UU5D9xLTOSSEvuArTCp14VgIaFqzp+UhGBVNnt6cMtPf8/EpV5U V3tg== X-Gm-Message-State: AOJu0YxQmUbIMixe57PgmOson4iQjWkNZH5VcynyFKpHnDQIfVPupIyp Hr3d/LYmNccKu8yLRc0d1okat7lho3/R8wmNft+Wohh71SDD/DZdqRIdVHQ4o3xw5c+ZA01ulNY ay+szJNQ= X-Gm-Gg: AeBDiet3k/bZ1YRbR0Gve/tc8pzvC0v3K10yVCK+G6ChSrqbGfGB+cAWumV4HzhQh+1 INeGz89m0fhE2T5jeSV7gNW2ZGpXY9T4cjdzr7cmlXc0alRpR3rLYqbC2fndAv8zBGUGBpqWOcL uAriXg7j47M0O594mJ/frv/7f7N4R/YD6pMUGHcMNK+A88pFIMY1p7BXUgzRtJfR9InPx2UGCAM QPkcBE40uF34m+XxzNWSZ7lGcYYf4BoBZsYHiTYl9rj34y0LRjaZczMaZqdDLd7tWZy+34wMmoY qzeIRUMM8XztPWhQrFPe94mXs9wTyVHYSYHplCDFap3RHaCzlYt9voOimzdjOgeWftLBKomKHGd 8jqh7KYnP6vNsfR6HuYoqVVC2u8UeHFkmcsxKxLDHZJ8AdBMmhPdJRQRGYfNaJuay85IRaCapK9 vUx1sjhflQG3bL5j3wrw0KLYtLM/KGip+Sk99DtrOVj5XoVjwL/evTHh1PqsxKNw1dvy4EJTko X-Received: by 2002:a05:600c:5397:b0:488:b8bc:6a32 with SMTP id 5b1f17b1804b1-488d68a4765mr64730165e9.23.1775850913981; Fri, 10 Apr 2026 12:55:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 15/27] stubs: Rename monitor* -> qmp* files Date: Fri, 10 Apr 2026 21:53:09 +0200 Message-ID: <20260410195323.17937-16-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=unavailable 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: 1775850946685158500 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 --- 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 edbbd544d62..932d6aee507 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) @@ -800,6 +805,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 85f9e3a4f23..356d7800760 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -76,14 +76,14 @@ if have_system stub_ss.add(files('kvm.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 Sat Apr 11 17:09:01 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=1775850937; cv=none; d=zohomail.com; s=zohoarc; b=U2NxbQTIgTYjmVXQhBtJWH+WkQd6c4hCzyFCBrQGc41qMdVLV3OUMjHgv+BrGu+uzByrUIR009YzVsLT9wvfaJIijCBDT38874Tz9P3gcLTWynRzcqQCcqMdpwLgGSgHaATjv4u0mIaWStRJdGHzBpdzseBHKcWz59EIIhLKoVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850937; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=P7DYNcbBqYRxENhIeovRDLogIedruZzNw+qepAaR4ak=; b=GRCzNP+1R2iz6Pxhwn6PPhlUN03lf8EPCDVo5Tn3i6QiHw8rTurepp5kOzzzAI1mRD3RnAUYClgsH3/bQ9JlHKhL5G+PgeG4gc3KBHgH6lgNGS0v36n07flPCCXbqFyEkApSUVgIv37tkyKbnZvFjJAJxQRTlRpGkMwRUcCnROM= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850937530494.2624261210095; Fri, 10 Apr 2026 12:55:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHwt-0003XN-O5; Fri, 10 Apr 2026 15:55: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 1wBHws-0003Q8-Aa for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:26 -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 1wBHwp-0002Go-BV for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:25 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488c2690057so23816625e9.0 for ; Fri, 10 Apr 2026 12:55:22 -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-488d5d80bafsm29705155e9.5.2026.04.10.12.55.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850921; x=1776455721; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P7DYNcbBqYRxENhIeovRDLogIedruZzNw+qepAaR4ak=; b=Id3b9VX4uOXPzOej/emz/IrY9x5unFfcDQza2aKuaP4vSBqReIR/nmH8yG1bTZxt6B kJ0mMFbX4AC4RNbn3yUc4pKJp8S1BkpJMUacLq0J4u7I8v3/rOGjQUGZS5vrntOPuLT7 YQEJ0q1XUo7mM/yyY0+szNeFIA3sMfqkcYVw3oI2cjDWyMMzYGx/C5c4tFeq1ZJBzIF6 alnYhgYSDiYuq2DIAUWEfKKVLJto9pEGqEfUK19+j6C+vyan38Iembuh40+kQEvO2BmS w+FkTWK7Jp/vjb1Wp7zwVkb2rirDpZPvoDuU2iCjLW+qINTKjqtFjtEz++bSmYQlSeYc hUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850921; x=1776455721; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=P7DYNcbBqYRxENhIeovRDLogIedruZzNw+qepAaR4ak=; b=qxlc9MjF+c2BMP5S8UeV6XnhfmwWPAWIBVlB8lUTqQ3TaHlWNKxG59N0A6ao4P4tEC AcbRkWN59pUZvyIQxhnNpGqPyGV1j1W8eaztJ3UtKHHEq8PKUfUB2rBYzfO2WG0V+OWR 09HE6Fwv1eF9RWNobzcgRWFTtM9XVycYxmtbourNsRupROnW7rwQENdhNalVV/hjjW9p +qwo3jT8TbRjcWtZhwrqrK7MlRpfNNyOELwapDhCEG8TOD+BbKHl8XzkFaw7zsYshnvh 67hmszm9OraVGDgMEs08I/iXfOwiCgYuuVmaWM4DBsw5X74I6So9b+rY0sWZxAh9Vu8F IY9A== X-Gm-Message-State: AOJu0YyVzB50LROFoKsIqV6gVQtXF81z1fDmhKyG7ajpx9N7I3IUscQZ sorX/b6kzNwYNB7JF25DGXuNtrMkoMwrL35QaC2J006MvCm7kY+i4rr3yHs4sXwQ3kKxB7rtp6Z c+gAuti4= X-Gm-Gg: AeBDieuKkO0Xer1IeGznE1J55jTnxvRi8j6c7brbRMLne7MW2FB8GpY8V3eQMnYl+Iv YcUK390ZfmspBp8j+rh+iUPf+PF7sJLETY89e+mmokwx7m8bhYBgT3EUC7Fyj7CudX6r3W49Swv IUgkNH5kZh1iwdbJh2Ad65K1+5kAii+wBbQhTjnYLTHkKFwxLMkQMuawcMf3MuKcDtcmY5sIHtU 7HK6VqFH0vwGnLean876LIycioccJz9D4PJUkqiDT1pcvleP7qUlI8UuYbpR9NNebR4yKAtpcpO qRrQaQCU94UYNcCjhfmSClNrHz5A1J/ydugywPpuD36Xi8AApscJ0BJqbSDTN9kCtTMzaK3sZPW vHCIKkSdxdQNCvO9fFya/ujj1kaR22G/K6+VZe120tk1hcGGQ7hIbg+Nk7OrXPLIrc8RWC9cuvS zQo4WUvFPlKdKyRkj3qa3bnhYWRAPRWXCCOYU/37mDMAmN1wICrUQgy6+ipr09+WHn2sjWUWIRd 28R0Tlx+38= X-Received: by 2002:a05:600c:4e4d:b0:485:3193:6ddb with SMTP id 5b1f17b1804b1-488d6808507mr60392295e9.3.1775850921143; Fri, 10 Apr 2026 12:55:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland Subject: [PATCH v2 16/27] monitor: Make 'info via' a generic command Date: Fri, 10 Apr 2026 21:53:10 +0200 Message-ID: <20260410195323.17937-17-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850938743154100 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 --- 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 932d6aee507..1810625eb1e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1558,7 +1558,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 Sat Apr 11 17:09:01 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=1775850947; cv=none; d=zohomail.com; s=zohoarc; b=bKO0I5H18MS14dHfIpZDrrhj6pPIxvtHJOCOVqaAL40BNei7CJCf6r8pRGiYvfLaoEvG/ghHGJL6ced4OLcs6CKamEg4ifLHY6F+rUbwGfw+7QnrzDPVJ6FSbOaU/t8EhGNoxczHHFHVkJA/T3dQd/ACe35r1EGy30RQ0ay/Vd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850947; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=TCjDcmgJjEnwXjW08r4omEzNwMlkd/NuRbLQA1eGzug=; b=PsMOje9wFX2Gl9CGspVdcuqE4+t/FNDqjuXLSJDhAhCQeHJ2T2obQhR7JTMWbhKT4ICjY3LnfIO+weiM+Vc+/OQbaYoCRIphM5+wDvCBokpFRWWL6pk2BrVcj69NWZvu26fP1sautnOvHZ2HbEuo7zNhbECzOuqM3a5lcX1lEio= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850947308830.3520014710152; Fri, 10 Apr 2026 12:55:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHx1-000410-Ve; Fri, 10 Apr 2026 15:55:36 -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 1wBHwz-0003sF-IM for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:33 -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 1wBHww-0002RN-4t for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:32 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-488afb0427eso30801095e9.1 for ; Fri, 10 Apr 2026 12:55:29 -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-488d5888c12sm109907875e9.3.2026.04.10.12.55.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850928; x=1776455728; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TCjDcmgJjEnwXjW08r4omEzNwMlkd/NuRbLQA1eGzug=; b=tMzF32Bba2ULpYnt/xAt3Or/AkyzDRYSM4PM5HmYVRQ2O05NbEG9I1Ezi0pO/M5WsH 8H74neGEuTcYCkRA+lkD/WFnvo3nQUMo/xrlWTeDWDAwJUTj2ExpVAz4nRwZGsyVK7wA vLDfNrZzcGlna15dg8ZNWVVyuiKTjJze/Wwnm2LPIkFyJBqHu5Gawoozp7mYGI6BRhjd k88T/CdBGcHo5J6RvIf8rDjiG4lF3JUQm0lqgqABQHjwMDiLWLv/7CNmlDmmjIyD1Djl 5zRkPT6itzgN1g2+mFwUPYZf3cYMaBZLcMHzcZs0QXEbK7JxBSEBaB8L7+DJrx3SqlUs r5EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850928; x=1776455728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TCjDcmgJjEnwXjW08r4omEzNwMlkd/NuRbLQA1eGzug=; b=Qk9xaobLlKc8Z7opXDogsz+J1wa4CGxXCiS4Nw7qQ6poYnuGAIenphuxdQwxbt+4XQ PgnTFqZItEdvzzdPqmIVCIMZ4ZTyL1/jkM47duWmQWfHpFCSd/CMx7r80lKXZtAo5aYx 7qhuqVAHyiLpVyqiyha4Fd+Jn/ICRGBKujxQ/XWedkWjXq/y6mZ5XJ8hFSCV8KjPhwFM Z3YSonyzQFbRZczen1VR1N3itAdz1f2u8Jfq2dPqy2k5iQu70/OnkJvIFvD6sA76EcAp Kxhc9sUD8QgHr84MuDP3UdzqL4BqGTclPxdI+6+50IpRlzFUVVVUpoV6RSXtXNFoI6Aw ZFUg== X-Gm-Message-State: AOJu0YxB1WFadf54g9DwhQMs2OI3s8xEtV+cuTmEceNoU709VrpTZkVZ lGUBvLmD6ZmHtVekJLZe/Sm+q/rXnznrUQEBfH0+cdsUmZmWeXMRQ/RVAjkLlk88ju5mGfwdMZD wVdbOeZw= X-Gm-Gg: AeBDievET2At5/FpzIysY9yHyWXhlMbx3LqfZWGOgNMArzxY3ZwvT9e21uZfkFaw9Vd 9UassQjwy449/cldjMLathQVQ2U4dgY4HutuZyXK5l9ATz93av9EDjieMMvPHixywbJZw4Vl+EH hPiIt/1ypc6pxTpPd8nCdoww0N8n3hrlTl83rw6pSRh99D0MPCRSfpLU1pMp/Y2p0O4inHVdmoN hY2/yB9+myRVkM7lQThhdi2APl+kDRuiq9W4IIklibz33u6u9PQjWU2KCKQfO1GLToj5ciphf2p EvLIu5In6kYc0+0sTE/rGZxRT+Z2HGJjO0QIx8TTLIPhABwwAC5XvS4y4ene4IGIXGsu94CryA+ U2B59TsQk+K9foDEhEWtv8LJbD9NmGicdP8Mr1Yc0EdBPP355Zbb6yWoHpF9ijmKdODSRJgcP+y WlXR8wdoIJvIBP7zLuyImUVoiLU9fi/hat+TMX/rS2pImIGn073GMiqoL1E4xIGRByBddtCrwU X-Received: by 2002:a05:600c:c088:b0:488:a639:b772 with SMTP id 5b1f17b1804b1-488d67dbd80mr44469335e9.7.1775850928231; Fri, 10 Apr 2026 12:55:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Woodhouse , Paul Durrant , Paolo Bonzini , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v2 17/27] monitor: Make Xen emulation commands generic ones Date: Fri, 10 Apr 2026 21:53:11 +0200 Message-ID: <20260410195323.17937-18-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850948593158500 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 --- 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 Sat Apr 11 17:09:01 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=1775850979; cv=none; d=zohomail.com; s=zohoarc; b=SaQR2W/zRWiClwoEUMrQLgBhJKMIk59G0nyi9oBw2c3xYxaY1mEewJYf/D37Y1+g44XSkgl32vPax2wcSRYTdLKseAqKxtasE7VmvNM7Jnm4lxEBxsuRwZcPwkc/IXgvsQGICRYJtLFGTO0FuMya7KMIF5M738CYGgiZChUqhT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850979; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=px/O9JgpOPO/Ufbv2ZpzWXAnxI26EBsW5Ud+Y2G0TJ8=; b=aXBOAP2Dc1tVZNWp8QkOdX4AFXULKr+Q3tzGeUS9s1JPb7+JWoAk+aenxa0M8xm/+saTy3gmrLulR1hCH23u19L/E5YZtb+2elAxJFokS7vUbPsIxJB0SuwlFZ/IwFzNpWLNiGbxIxxyhy64upJz/aLoedSHrs+SIpKi3iUsQ3o= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850979483665.6886458973427; Fri, 10 Apr 2026 12:56:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHx8-0004Qu-UF; Fri, 10 Apr 2026 15:55:42 -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 1wBHx7-0004Id-Kn for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:41 -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 1wBHx3-0002hv-IE for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:41 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-488ba6366a7so30027345e9.0 for ; Fri, 10 Apr 2026 12:55:36 -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-488d681ea59sm28066985e9.14.2026.04.10.12.55.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850935; x=1776455735; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=px/O9JgpOPO/Ufbv2ZpzWXAnxI26EBsW5Ud+Y2G0TJ8=; b=Ks83eXtnQys7Wkjjvyiz47E7DXhgvXg76+EYFntvHUnQcW7DinCM2UnntIU37AKQAj MLt0AvBk3IV8ZaQfzRZ250sr7MkQ5AGW6HV/yVF8kCeRLukARWM3GBAnYpixgKJW4zbb xRnXpJqv/7t+Xqr1CO6dyf6ot9aJh0D3XGu3r7Mlxv3OrTl7L1PzNkB7iCgAkkQJatAH 27KluE3X9KBkJDCAYITjfCtuHtnQEuYJIKwtxrIsUCcibiqrQ2SSxlhC+7qpUVfhB+iH PJCzPRTkAloNATphqHxt0BtrLXasJvLhwjJIVHwHSmMtEtpp4tPFDUxNcWBeuetTQumP Ipfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850935; x=1776455735; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=px/O9JgpOPO/Ufbv2ZpzWXAnxI26EBsW5Ud+Y2G0TJ8=; b=IF1TnSjGLoKTELxrL7ih1Tv8EDZWBujTDaeBKfvPCHXKbAUr/PbYpDZw+8BcfAk3og TIdRXjLA30CM3tP5wxvvgHzoaJd116f30FdXPEZ5mRwIqjMhwiaU56lg/Vlgc5cHl1S6 zszPnYUUg9+IjgGExP8wmNgshFlqvfxNkUGHg9q0AGF2apqC7iSErvTsN/TRrkj+LCYk FgadTb3msAT5/OadMXFdYcHr0wM23bgFtwNiFAsbnCWQNHI2Hi/hqYGywRhKiIzOI1a1 XLd7dlOyrCbHOCxc9HAAj3KIBrHvgVhGkJKUcjhQRJc97PjyXgnYapY8sXhBm6S+YMOf +ncQ== X-Gm-Message-State: AOJu0Yxr3/7pV93fC3+GdRLHf0VYn6vxSNWTFy1FBFRIml91FB2hDgXj GR+NnBPeXTGAylTiKR4RgDU7o/hefGvB/xTPnwORZ5/r+dbCI+NMpwvYAugbJ/KCplgZt5NuuDw dJKa4zK8= X-Gm-Gg: AeBDies4jXEYbo53VSzubzvtHb7hqW3gjL40sbJElzLrUcPp+3Sqn5qmgZlERghrf9b 9tVZJIs65BaoOZSdiiJJmZG/5zMXTI9LVo38TzZw8Pd2TAig6g7D63lVuB7iWZNFLOWW1yWXwK8 PwqbqO6vPxKwlmG9EVTZyjYPQhqgcL228/ggZi3T2Iw7JqFFiMWTf6+8JYxh3Wx0KYiv4NVocYy z7A4CVzPJs6dAoe4XOt4v0W2YdCaDdeAR4gcdsI/g8YnKHoCmU/E9YYV9SGBpELu6VwOLbxOdCx qeXVfxFzi0bqWfKpsmXde85pTBqJHJWa6MpEu0W8/yYYlbBofwbeSCnmsmyeMW3AP+u1PjAHAS+ 7DhmA4bGJ4yNsNmdWrk5JO5wNBtjc5u2E4Wu+gBZpVlryoQu7S1E5pFhjpKP+k0DvGgzkgUzz7g d9K6fQ638niytejtaltCiI2FaQpk27PNuXAGDsoDT30yHVDIUnC/MOZmdCInIq1dUF6T+C9sp2 X-Received: by 2002:a05:600c:5298:b0:488:c014:34da with SMTP id 5b1f17b1804b1-488d688687cmr63654455e9.26.1775850935538; Fri, 10 Apr 2026 12:55:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 18/27] system: Expose 'arch_init.h' as 'qemu/target-arch-defs.h' Date: Fri, 10 Apr 2026 21:53:12 +0200 Message-ID: <20260410195323.17937-19-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850981313154100 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 --- 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 2c3657d00de..a38dffd4899 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 246623b3196..23f1da66369 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 Sat Apr 11 17:09:01 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=1775851089; cv=none; d=zohomail.com; s=zohoarc; b=lKoUuxBbCEVxufIi12hGiE5LJHj7yTZaVmGxwdkMSU4XBzhyb1j1Muiig9a6CKFN+NMiewwysz8zNfYD6pLh8H6KmI81f0oxU5lFqE0mTELXraX3W9tGYHO/rkS1IRzFBeJJtkHBsAZ8sQHNj1xnApePpXYsoCYcaoLWx0MPeaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851089; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=KRKFl/rXH5Np5OO3Lz1ftI+bdnLkrX94FQ8eyhGxyK0=; b=em4xsKitcTkFn8iazEJ5OV7xGIjoQqf4jsIZ3q/keQzanLPBZzYshqoWNhhLeR5f/a2d6jUqC3T9GTfHJK4G+89s8UdeDngNl4Hg55vUziDev3PZOoALlGnkrLOWyrydZLB6QlfBbcYcAgnEwk+ZjSIXVu+RqRR+jUEqKjiwSOA= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851089771391.6662241052604; Fri, 10 Apr 2026 12:58:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHxE-0005Am-Bx; Fri, 10 Apr 2026 15:55: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 1wBHxC-0004vf-93 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:46 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHxA-0002yo-9s for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:45 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-43b95e5b3afso1560328f8f.3 for ; Fri, 10 Apr 2026 12:55:43 -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-43d63ab84cdsm9885795f8f.0.2026.04.10.12.55.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850942; x=1776455742; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KRKFl/rXH5Np5OO3Lz1ftI+bdnLkrX94FQ8eyhGxyK0=; b=RRTetaQoSo96KlAZyHq2RnfnsStzQJQ9LbwGgRm3lZkKxuGNpyCo/rODV9CDc8U4IP yEx02aAdPElSZQ4Sbl7od3KKqJlv8X1vMvkKYck2LxJsQkDfRwUh+90fi7ooOziyLh8h VtRXo2ERx9DJ5WKAVKCTOiT/42FBeN8wZEg3Ghk+qCJdTxVO69zNqeHspgKj5DSgWzc7 s+r8hDJUT36npVL51ac9xwOKcL2VjIFhSSP9YCVvs6+HMjR38l5DlifIwUtx8MSeQtjG nt7JoPkKdDBW/oH1iioVh2m3VZoDASZIXhZNdygXQfVc83gcsbOBjyeFvDAC9jgIstqx iZwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850942; x=1776455742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KRKFl/rXH5Np5OO3Lz1ftI+bdnLkrX94FQ8eyhGxyK0=; b=CaYo9DX627U9WPYLBS1L1YJg+ZWrByRD5wuQIV8oxqKFzvOJHkdqG4s+MTcIUPZkbV 0jyUe4m9LWLHKDAYxslfiK5TBtWw4zqVSjn57Qm52asRSBU0uLHgemFTiDv1II2rUDKa 4tyjOZJcH8Gf2RIvESMVNOhIUV28D2sLrrjsC6M4rJMWHSp583f6NkIYRimUtxleSp1f rZLSHdGsH0qFWzMjj7lUfD3yyDTp1p+C4DWGKwkN4v9cWhnVr3h4qP1Osya3bdT+pu+F cqa6s9XkuApr4dtEvVyqmPgGHFy6QICFfF5vp+fvadxvhf5ogXNNOkeOl/kv2P0dWkhQ xVvw== X-Gm-Message-State: AOJu0YyG2UeSDtcEvN6w5r2EZhsCI7fJ/MQvYEFt9XhSeKT73UFM1xs6 i7geWeN8s4xzfVhVhKXfwsn87aCEtN8VPwDy6Rwr80euE//MIT486j7++AA6xJi7lKC529WyO8W yGMj3PkI= X-Gm-Gg: AeBDiesa32FOuP4rugxYsImD9a+uVkbNCZgrwvri5zXPE1l1yEkP99S7KSYI4/GIeWG BbIcuL10Qn09NeLicb9QtpsRJ8P7O1ghr92/l02DFGOC5+Sy/az0t/p1qn28bjGdQUs7Wqe3P++ YF6cL5HK0QAH5PCjCI0o2NlkhWnq75R+ocfvozfAgqW3fUgP/qqmkXdx6/ALysw+yJ5YaLKRuGd Iz4x3OSpW/ZFMNTGBclzgjyax80A8KbxCiIlWOCWxYnRtb+ngpsTuqqlAuGutapab4qPwIQAKuv UtCiBo6jvU8mzJKsf99xHt14rprxpT2dU5np6TrA0p2hLLMQQ7fOraxhsNtUXPN8OFhTeocC+2R vsjnDhgZbFTxXorxehifKk5CRMA5slD9X0erqUZf/Y3EquuspTo7sPuiApyGFBxvfCmjCby493p VQbRdv6L1pCGEEyDmQVoBYXxS6YCRykBEBbXBB7JH9E1isO2pwar6dEfUiL6ePwD1hPQSAohGg X-Received: by 2002:a05:6000:26cf:b0:43b:4212:2ee8 with SMTP id ffacd0b85a97d-43d642b9daamr6511764f8f.24.1775850942417; Fri, 10 Apr 2026 12:55:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 19/27] monitor: Introduce HMPCommand::arch_bitmask field Date: Fri, 10 Apr 2026 21:53:13 +0200 Message-ID: <20260410195323.17937-20-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1775851091332158500 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 --- monitor/monitor-internal.h | 6 ++++++ monitor/hmp-target.c | 1 + monitor/hmp.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 3ecd394ecf6..78281928e7a 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -74,6 +74,12 @@ typedef struct HMPCommand { const char *params; const char *help; const char *flags; /* p=3Dpreconfig */ + /** + * @arch_bitmask: bitmask of QEMU_ARCH_* constants + * Allow to restrict the command for a particular set of + * target architectures. + */ + uint32_t arch_bitmask; void (*cmd)(Monitor *mon, const QDict *qdict); /* * If implementing a command that takes no arguments and simply diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index d07e545ef7e..9d8dcb8835a 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 3b9e180c1ca..c1e99c462b8 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 Sat Apr 11 17:09:02 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=1775850969; cv=none; d=zohomail.com; s=zohoarc; b=Ajf7maNUMs35Uiq75xrGqsMauPPJq0s7Kv+4CEawHKHdAwv+LHznjBwfrkl7QRcQoXwUoOmwMNVeUJcJaRrC8FuxZaRk7VlJW4U6Q3h4JNK0NRQSLQxByryuT0pWIrU5QzWJXvyxqtk9QekmqvMUjTmIwcCEEd945+hUNjQKTp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775850969; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=j1FsrkHiiVfTWUBHqJkrxULfXG6j6GR2S4+XnGN40SU=; b=GY+W/9vXsOQooHBlgfrl6V2Nzq+aDqy0XRNTHEmxT1Xva8OL2wnQTUrRh390pVt/Ry3MGSq23RETj3SqIeYpiy/ol5s0GgmJ7rGfC4Mi7mI/jQAzUaXez866dfbwM+UOvO4MQPe4SwVbHmkftBj+tVRZUeLS2ZZ4fUjTXNTbzBw= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775850969949668.4547451782262; Fri, 10 Apr 2026 12:56:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHxN-0006Fr-2I; Fri, 10 Apr 2026 15:55:57 -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 1wBHxL-00064f-6m for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:55 -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 1wBHxH-0003N8-IQ for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:55:54 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-48896199cbaso25900715e9.1 for ; Fri, 10 Apr 2026 12:55: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-488d525c931sm98623515e9.0.2026.04.10.12.55.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850950; x=1776455750; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j1FsrkHiiVfTWUBHqJkrxULfXG6j6GR2S4+XnGN40SU=; b=Weo9G5EvHvy6O5IG4GSe0RjE58zSpZEThDd346JX8LS5B/a30XZAoOz3A1J5MErOsa liMqSzy15Bq22DXqj459EC3/Ch9kvrZD6He6oR/7xg927h//+ZG61lUWdwLj05904kf+ GQcS93YHACunEVTl6MulLMiaLlsR9A+romv68N1xWT5YJYyG9Trnm9ad1SSQQV8sNUUC rQ6t0m5E1ZKsJH7SQnhLYmv9bxTjvoZDwFY1EYvfmfcFl9ig8mPieKRTPahlGwn6ttNa +bJq/PosKpcZfesPSHtzYWzPD2oZLaLLuBW32C/RJVOgFFmhYJejhUP7sbpg2+qSE1pi DXkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850950; x=1776455750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=j1FsrkHiiVfTWUBHqJkrxULfXG6j6GR2S4+XnGN40SU=; b=k6KROcqKFhAub5cqXFerRY1SehOFgU1pVKx4hZswvpV0G8FPrlGjhbCGrcUsoURfW6 J/2FDXIKesJp+7EM49sK9HiBfX8HEKv7q4qQmp5tUBaBr/bA5fCJdrWWpdopWBvRpLhX DqVtbYyShk198le0dz4Bw/xjaj0GIplBAiAApHDyKTjcFWlP2c/BGICgq5i9HxRbk99i DhOTH7Pz6+AaoU+B/8WIDn9yuHpizILcbjAhtEiLuJaMhBguXngD8Ai1+1Pn99uuC+Is oaz8fypQAFBxT/61MMbO0aVbRYp6nWmCpFi1VnRSBp5ToaLIGwMzRXNuvHSKoIHV5XAH mxvA== X-Gm-Message-State: AOJu0YxTiZ+IgFmyFZQujP8Gvga8Gm19Eei6Q/9R8u5O29idklPULWys ft3WRq0lDRsRd4U8s2vDP5gs8+nOO1B0RKwIdFf3TnrV1UYInnSjBKCwKXfPH3pebDcqmTdVRti pWf+PEnY= X-Gm-Gg: AeBDietBq2KGirQfN6zFdBJy1rX2m4FlhzBRCP7bX9fGtBmHy20wi7ivtorkV0CQy5L Bnmt72WHFKoSZhIZ77LPIbrOuw7lO8UWBe/bALpeSpse+U1BQU3bNKKemVnvHLySL4wIQt+HqwG p9Y6B+w9pdaspUG+7/+RGMzkCpajbagws0Bf6kG/fhc+4tw/+viyKP1lmBGgJSHi4Eenbu7IHEV QVVWXMgvZizcshjdMIh+/BX/5nugIXYNkwY+LlwtzebQWRDUYUoTQcL0Q+P5qA5rx2P7CZPTeet mxwUe3HWTwnkXedLvnEfdkTB1HGYwbAi5TgyMTJMHuYNfnXPn3BEpBE5/ux6MjeZ81B+iLHYVug 4hUtiRxuvFQBMKEPnJQG2MYyBZzWx27BuC+ywnl4zAwtmK7fcPBjuBhSeFNZk0cSUCUAa4f0IpV 6Np6S4iQEDRs4gP7mE7LoRs3hD7V9yADHwOMe9bfUz4YrDf0YXqSpdE2YYk0Yfwy8CBa0DZQKx X-Received: by 2002:a05:600c:871a:b0:488:c683:be89 with SMTP id 5b1f17b1804b1-488d67f0b8fmr60065145e9.9.1775850949623; Fri, 10 Apr 2026 12:55:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Halil Pasic , Christian Borntraeger , Jason Herne , Eric Farman , Matthew Rosato , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck Subject: [PATCH v2 20/27] hw/s390x: Reduce 'monitor/monitor.h' inclusions Date: Fri, 10 Apr 2026 21:53:14 +0200 Message-ID: <20260410195323.17937-21-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775850971155154100 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 --- 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 b444095f684..a0a063db8e4 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -182,4 +182,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 Sat Apr 11 17:09:02 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=1775851027; cv=none; d=zohomail.com; s=zohoarc; b=FJTaDKC2sUL7L4q72wJ5l14YOrgaijEnzD8qZyIxYnHyHaR8zm30UWPt4RxcyMFJ3yINJ1D58lk2VEliXSy3o5rL9wA+fHv2cinz3Xy75+irM6Z6UBKTOfLJxaZZoJvYTLy1OJLh5TroAd5K0rLElWQxG1sAiRMJa2LjYbcBxFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851027; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=Ns/VNhECUVMMVKjm49BzmvODa90VglcciVurHoSA27A=; b=UKMes06ZT8jLs2u7CxtpFPPpREq06Gu0HOO7/gGuMdFEcB7YbgfVKY+2aPYuBVkQ9ddsNRXTI6MSV9yTunpFYWNrQSCYoACMo8e7Z/gV7bfu66k6TbuRPJuH1fIvu59OglV84PO8bHp2w7sENrheR4r+HK6SSBLHoAkxLGtDvWc= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851027838308.5019971015271; Fri, 10 Apr 2026 12:57:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHxT-0006hg-KN; Fri, 10 Apr 2026 15:56:03 -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 1wBHxR-0006XL-Ot for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:01 -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 1wBHxO-0003bO-IC for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:01 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-48897fd88ebso25629685e9.2 for ; Fri, 10 Apr 2026 12:55:58 -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-488d5888c12sm109936675e9.3.2026.04.10.12.55.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850957; x=1776455757; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ns/VNhECUVMMVKjm49BzmvODa90VglcciVurHoSA27A=; b=N8tYr4dnvRwEFXBVQ1UIzZnyXtt/F5Bo4hZFdAmWl8HxWaS8OLhvdnYf3h884MQ4Sy hauLUX7ehGcsTUp6nKL0DN9Lpk6ZH0v64N+0JLmQ0KLXbnBINiSwaJ+xS0L+TMklSO0W 8kHmLldVMaeDcmECM1DZ2bZqyJpZUGJH7YfVNPEe58JQqRMwrtTtj7oBT0yKej5Odb7Q gEgsxD/t0KLwwjzzG4lJ8xQajkz0/vYiO32zfQWNYAMtDgmJbg6D2yp46Zk6BU+pIsVw /gLPDO69y3pDEV+l/zeQLPvRkRoWnDE2FDu370PPg/fvDYgZiqDUiZMRwlALwJtRRsLk 54eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850957; x=1776455757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ns/VNhECUVMMVKjm49BzmvODa90VglcciVurHoSA27A=; b=SHJEouHScAUKtQq5TzbHY6eMUSmKTKvKXBee2CyiYGw4i9Uthreg8Fp/Jo80+EZVkH ogitdKMY5OaVkkbu01uKFA0HmtOZ+mTiMhAing6UM/YVvD4addWp/QIUgyVbZG6uGscL 2Y8RNsbO0j98TY435nbLlxptWianhYNaMqZ+1J0qK4brCtgq2teZc8YFh9zzOJ6TCeak apIMsCJ9LFlc/aSj4ffIi7n43C/1Jg+pUxUKGvNZN/ko2PIK9bwlC0+rc5UOwVC9A0Ib SgU9s7bpUQE+89LOeVlSEITCPO1Vz5ICNmFRzoTKriDILhj9eea/ccjbh2nKma0XgC9E abZw== X-Gm-Message-State: AOJu0Yy1mDAc0jqEWVSQ0fNLd1kUh6BDKdDgbqnqS64tZ+PpJaSRxg2G 7j95rjYgl6+SibwQpmgMJHwk8zub9DAnIJwhCvQTncOXcBlXgdEXK47VP27oofmKh8kpTR6vfW4 FULP+8x4= X-Gm-Gg: AeBDiesyUT0g0VZDE3LxNCLHSAgsu3qAqlaxnRzQ2soJMVy5Zx6Qz9TPWingz5BZKme gLQAApD9S4nDeUvFyl7dlwhOXOXS9OoPo3kJYDVKtGkjpwSN4bfFanSshgkVtXCAjbDgUursQfe cr+LqyrpyMLVzGuOVcSzQmVfTOY959pqqdLo4EhrRBeMwdZRFoLmK6kKjCGEsTW++FaP6z0CZgp 6LCuPhBxOQ2/UXNYuO9nULC0gvv3/RIJh+T6nR8FhVRwXYS94L8Vh0PLN5tMTfLqkZo/VmGYY2C Gym7uFD7F+UIiNqxQTmz6wCn83h3ymV3mmjdvHA7PiIVU4rM6dVp+Vu2BwB7ngOaNB/Q/mDAv7i Rf12JfcKy5B+WjkCmz7Mpj29wNzzd5kULrpKzGcAN1BCvksBGMkQXPYjtOE7GaGHDQ8mbInSp5D cq3Qn95vGaI+We8FZ3+nC8l8vFse4c654wXihozEZAJtsxwvv+13kUS+5Hm9q+n96nS5x6oyya X-Received: by 2002:a05:600c:64c4:b0:486:fbd1:9dc0 with SMTP id 5b1f17b1804b1-488d68c2c56mr54818125e9.22.1775850956615; Fri, 10 Apr 2026 12:55:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cornelia Huck , Eric Farman , Matthew Rosato , Paolo Bonzini Subject: [PATCH v2 21/27] monitor: Do not check TARGET_S390X to build s390x commands Date: Fri, 10 Apr 2026 21:53:15 +0200 Message-ID: <20260410195323.17937-22-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851029081158500 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 inconditionally within hw/s390x/, define them in the same stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 1810625eb1e..e53158143a8 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 a0a063db8e4..c8ce8579424 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 struct MonitorDef { const char *name; diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 9d8dcb8835a..4968d511101 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -35,11 +35,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 356d7800760..d4a6bc0dde4 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -84,6 +84,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 Sat Apr 11 17:09:02 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=1775851121; cv=none; d=zohomail.com; s=zohoarc; b=fsq51QjbGjZYlbl3Z6yPAA7N2lNXPKuo0/URbmFlPIeOexS3dyVp/kwvZnuUw4sDY1Ut4TQpk8dm/8a3/tAg7hpXVG6WjvpfhJO/I4o11rCwI74lwjIFmEhbg79jLxWquea62kl5F3ih/XRzmqJNWzf7vVOb2TqH81DPkeduprQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851121; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=k99xMD4s012E4So2wpbCNS02HNMrfRabi5ydC/W3ahM=; b=Yi9utz4HbONPuTdK9/hrPK9l9CZbEiRgBKiy38/MalVp3azrIpwDj3Dkx8k+V69IoNiWOhUShOgacAB4PP9ErGCrRMRsM9FoyVy21PsyM7igvoC+0PG+KLTKJrXZ02TnJsJz2E/j0eacpBaJojUTdgcqm4F5zPOJQdtG+EbuRqs= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851121441569.2998251952306; Fri, 10 Apr 2026 12:58:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHxd-0007aE-HB; Fri, 10 Apr 2026 15:56:13 -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 1wBHxZ-0007Et-HU for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:09 -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 1wBHxV-0003pJ-Fv for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:08 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-488b8efed61so22042275e9.1 for ; Fri, 10 Apr 2026 12:56: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 5b1f17b1804b1-488d525c931sm98635955e9.0.2026.04.10.12.56.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850964; x=1776455764; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k99xMD4s012E4So2wpbCNS02HNMrfRabi5ydC/W3ahM=; b=HR6rYuG7MCfqMjkRpYpiB9r9Pt99jtuZP6ntxr9DHjMPTiFKjZ24GVbQyzxAk5Cyl4 Fl1LGtMb4fqlP9Yg805AYPplTqd08RwO6ZMUeOu8IpMADS2CYu3S2kzkjuDXtPKDkCut hOo6etvObrAk2qGeokHR62N9hu4zYW3dYgx1nbqXTg4wsghc6IhA1YHOMWX7lq7whnzx 45/IEFQjvyEZ/4dMeWBzFNHz0VCAhV5M8LaGXfc0VeIWoinPuj/mzIMksCRcZNbGi3Gg poQI+Lt7CccRV6k+BDg2s4N888Djc+xc5gTl9oPaToDkgIdtnBVIH5TcWcjA+2aoziMt vXsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850964; x=1776455764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=k99xMD4s012E4So2wpbCNS02HNMrfRabi5ydC/W3ahM=; b=Uwn6lBmSZLpdO1lmnxqIUMIw0OBLiIPlPiN/A/RsyKtaq99Zo1Fz+nJU1doiXj/igy 6YQXXXbVtYqGBfz3jpUIWWebN9xEXMxXTx3qkZ+CJjdQBBqyGVa2TkKZJNR7aLMhG6ba upyNtcyKPmGF4IGVivPQDJ7Wmx5+I7jsw3j4Wr9Hz1sD5c3aFGNx+NrdBbpeFLJxz/m9 8kMLyBjF6mGVLDtobs95zB1aoAjSFpUNEkZeRIgbZT/l7eHJ67tqZfhulRR9+KeQF3zk 2V1J4ZnXu3bdoOjDOuvL8tKpiSMvPSC15FMmN8vhHeQqAvVZVHWGkUvjsDBWOsEM0DZI wVew== X-Gm-Message-State: AOJu0Yz+mgvO/+/fV6hDresBmgLh3XTvxHD6a/Rqm9nZMNOSmGN8nQxE 0ttOXAE7Hl1CS6V/XgfrdjkGG771f9+xq72X7Y7IH1GH5Ga5ro25BMusQIxH/3jyUqR63j4Qn7Z +9zinmUg= X-Gm-Gg: AeBDievuZShiH0INikSY2gQVwRWjg+fFI2l8ybMvD2GYPwlefXGB6W6SXPOEtPUsGG6 aEyXrNwytIq/BGFnL+zqLl1WgRWqRyRrgLb+oKUdn03TpXzPlJpeC4b+iGzheP6H/kQM2G3sFro yDQJYl2XImA+ZZ5vFYGOT9741CT5wZsZlUJaP8JgEhgMUP9UvxMFZnm30KuBEf5L/Miy1uyCkxw +x4HrdWJitCqdEZURoeiRiZ0nMNy7HJswXj4NlrmnfJ0ZOMWk+50nou3/ADVPuxQC+F4LogG7Q6 JGntaE1nCj0nDapN6r4zTALHYEp1x+xlD4ImWAimjhsyg5WrmQBL7XsUsci+/BSe2LYAR1jOyt3 4lljShKPu2CPgcOhe58OZN26U4+ZuMtoorYsuY/+KgSvTql58aI8y54BMDkyQ8zw5ZsOid/+IpC 5orZmIA6OEzG9HIGQ4MxSVoL73PgRsbJbmmfzEdlNaAqLKhAPJRT+K1OGIVNyAT6AeOriCJUco X-Received: by 2002:a05:600c:609a:b0:485:3e00:944a with SMTP id 5b1f17b1804b1-488d68ae78amr59095475e9.9.1775850963612; Fri, 10 Apr 2026 12:56:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu Subject: [PATCH v2 22/27] monitor: Do not check TARGET_I386 to build target/i386/ commands Date: Fri, 10 Apr 2026 21:53:16 +0200 Message-ID: <20260410195323.17937-23-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851123562158500 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 --- 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 e53158143a8..458951bc051 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 d4a6bc0dde4..dc289e3a482 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -85,6 +85,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 Sat Apr 11 17:09:02 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=1775851071; cv=none; d=zohomail.com; s=zohoarc; b=J873/oowv2XYU+5wS6tU39bKWOovUfPfwNYhJPJHSFuUZ/IksHeVYbjjI3ImU0yNT927QKVVfFL/iVqQXcHhlyqobJqgTM/177CGONvNVs5GvIHmo06ExQybrfgV5HhOljb5PR7tW9pInt2HVTA9fVvIOWA2GKCT8aCbCUrX8qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851071; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=C78IbPBsz6cVs2Ym43RKAMokAYox7chDUSzKqZO66SU=; b=hqjThfRhLGk8ePWF4acaIqOX8fUK74/30CGUMedrdzBWNrqdcF2HEoOWkwOafVsOA5nIyPvrTIKgrpFLtByJL8RcedOnKkacI5xNKX6etd7WcrXi1VyY/4Lz7TbBmDFr7tnrAWGFyaVuPZ0ZfgO9KXBQ4G1BFhnx7qexP7rl9lA= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851071077585.8286340217707; Fri, 10 Apr 2026 12:57:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHxm-0008Rn-RZ; Fri, 10 Apr 2026 15:56:22 -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 1wBHxl-0008I3-0f for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:21 -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 1wBHxc-00041D-VT for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:18 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-488b0046078so24119855e9.1 for ; Fri, 10 Apr 2026 12:56: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-488d531f2b6sm106301525e9.2.2026.04.10.12.56.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850971; x=1776455771; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C78IbPBsz6cVs2Ym43RKAMokAYox7chDUSzKqZO66SU=; b=n8DmGKHlWSIX4ZQwbtlQ0+D23gzPAAiOsDkskPo8XxYh7NN2Tvrc5mjpylEeRTIdWf bHvJExa324wGjoLNN4cZJjZE+c7/NZqILob5JYIk7bJPmPYvZX+W3+riuu0PWKEhZuHB 1m9J8UMaGy91gZD1OCQTPKH006rUYUbB0zxQPSGdoX+Ntni236xs11cpgtZZdvYgDHi4 DX/+y8GVknfROZXOb55OUmjKHqPo8dRns9RiMWx2KsRrzQzQhVCO8ant60gMpiPRqiej 9kYKSmSgJly5FLDf8UGV4nLhhRkbJaR5MYo58CjDOBIISqq382JHMxcbv8UmZ/dK6rzF xyrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850971; x=1776455771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=C78IbPBsz6cVs2Ym43RKAMokAYox7chDUSzKqZO66SU=; b=m/s0JB7m0TQ46D0Y1uhsix0KraN7ztF6AUGbyhWPvItdVbxlKoFuWg5yVDEunsFmW9 KaihLYKxsEeZKiOoJGHe2FulI3wWb746r53RBXAaM61OIuTyowUovjtAPy+AYCCrOrTg F+VCICwOEota4Dom8av6s4NCa9AZlCnluvQITyeBhihuGSU+e350Aezs8WYfUgROz9UF 2tyPaHhWeyOs+0Ty02zX3TLOvWpHi8wRj3OIP93e2MkgIcEqj+qyi7fhYUwKREjOSmYo 9fu2uYTYJgmCNt+/l7rkobMQ43MLe+S1BgEqpH8aDoDACH5qmO1RvgwPOVtDAMP9uVcI fLUA== X-Gm-Message-State: AOJu0YylXRrlFLIjUi2y0DbraBtp3rO13TDRGZL0pMNCjDN3prQ5rMJH OAANyun17CCMF2R26MAslLebMwDZNMOlBaX5pSMFtZT5Ir3QNnAy9AdwnlXkHYlCXJPTYNZ2ahO 0aBlD2CA= X-Gm-Gg: AeBDiesZAJnwrrSaytlm1KUymYjojuGF57i7ig8wGt8iKYC8zfKgAYrQbp/73zVq/by F00wq4pG2VpIYpqCoS3XI/bfCbseR+zlbQsKhMxXCr0ma8BXf8nJvusEXv6KoBefiyMJDyrgLnQ wPIIJMueOega0u0WJ9hH18QfUZY2e6lo1lxg0qhA845CE1cjR4x0D0y5a5Ss6uiqd6mGNVRejBH AqGm81Izvh2lDqTM/cV0RfItawxsI69Acz+/qFxGpAVVNuPfJck6KhM0NtqgDng9KFVqyC2O+/s mc51gkX7FCC0maWsmGHnQggrCz6mehAC/R/Xi7fESPA61mOoFFiYfyfkgJmG2OxT9MhV/XI5UFt DWADWH+2qO9WL5Foa1806HHWBW6jH5hdLTA/OznbsfozkvI0sY+n5YxPi5bh/lZ279EKFzSDOm3 39Ub/xXbGdJ3IpvZTsUJyEn69OIA4GC1NGpd28CnGbi7XiNqpBdyg9Bw5BQniUffzrv6WfAGZR X-Received: by 2002:a05:600c:45c9:b0:480:4a8f:2d5c with SMTP id 5b1f17b1804b1-488d689cf9emr52390385e9.29.1775850970618; Fri, 10 Apr 2026 12:56:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Marcelo Tosatti Subject: [PATCH v2 23/27] monitor: Do not check TARGET_I386 to build 'info sgx' command Date: Fri, 10 Apr 2026 21:53:17 +0200 Message-ID: <20260410195323.17937-24-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851072767154100 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 --- 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 458951bc051..31e973fdeb0 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 6e82773a86d..59d58926311 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -22,11 +22,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 Sat Apr 11 17:09:02 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=1775851107; cv=none; d=zohomail.com; s=zohoarc; b=g3UONjSiTkLK9YgCPkgmqlSGFiAOXfGqqrExHe62dKI55UB8yvYvbF7ZqscN0bb7dMlshsfzjnUnA2AvxlWIRMrTM1rNY9GbKOJKEN8q3EvsHrzHAufoEmsU/A5pz8ulsY60OUcz0wiITIS8PWip1pOTpL3hDQdPRgdWXveNrJw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851107; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=Ow/eQWa3P4KDoGEVMogN/Isn8lewWO8ymg/RYy5QKo0=; b=ALqlN+ePgYDFBT9rjX0kxRqCM3NJ/w065a97do21PmqgFE8r7DsNQshfD0W34hiPUd5kNHbAWAXaAdJrLt4GqVmXlCIeBB2EYrl6RNuj0XR4P5rgaai175varbFsuUlORKOj5tLCrGbUSNlvIPIQYL0KFATAWWny5kk5Mj/Ax4c= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17758511070271022.980716032834; Fri, 10 Apr 2026 12:58:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHxt-0000ZI-Go; Fri, 10 Apr 2026 15:56:29 -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 1wBHxr-0000Sk-IV for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:27 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHxm-0004MA-7S for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:27 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-488b8efed61so22044685e9.1 for ; Fri, 10 Apr 2026 12:56: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 ffacd0b85a97d-43d63e5c981sm10026977f8f.33.2026.04.10.12.56.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850978; x=1776455778; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ow/eQWa3P4KDoGEVMogN/Isn8lewWO8ymg/RYy5QKo0=; b=fH59SpcGllwzOEpfjLuaPIBCj3Cgsdul6H54+fp22YXR2fk5oWk9ZA/XSLJTX/CETB 9AxmohhADUximrB48xjYHgj3bfNanUXXyIhuexjuDdEWqbrfArg4nZQqcz4yxqOL8O4o paErOSJOx/cg/IM126/pi4qLd0rhbnbx0rlSwk/iSljKg3FxrbJIyGYAkQD8GHBRp3Y1 h1xGc1X0/1BGlFODPjJaUp2SuYqqa3pDx3udYxxJZMHvJWSWiz9Bhw8vLayP9XJynSwN OoxqFh7s34jx1bbi/obQu58UE82odyXuKBgvvtH0Q6xcL4SzieKRESDQ+1azqRYy2JcB dNUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850978; x=1776455778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ow/eQWa3P4KDoGEVMogN/Isn8lewWO8ymg/RYy5QKo0=; b=G/hvClqLCYlXFFbfP5h3c0Qtn44LX5/iffwaUNfXOELBR/0NXgBTCs3QoE89Hgvy7z oHcXvjVPLtFtgQdzUWSLdVxAsgYm71q1uV5FO0d0+uggiosQKpOOkqFRTQmtpKLKz4B9 bP0l+uvoHUNHv1qpSVD/BpZTADpYwqfoScAO9uWzmFlFUoJJdjqzgvN5FfqVGXjun5K+ S6wsaTD5TyWp9RzupgHhyqj/OnfD0STt8R0W9kTRxcALkZEof38x38SYyKeazfe+59Ja CydidZ7QzSoIEQArKKKbCaRVZbuPEYkYYWmHFpxVzWaQN5iaVIlCPlvQuDBcaAOZdWma JSKg== X-Gm-Message-State: AOJu0YxVqeeB9eCMl7vYb35Xk1t6l091L8zvm5qQIId0N4BAP05ftMq1 7NydWBlXGkWp3496QIGXGf+4I/vGw6e9B6zqT6eHd1PnX5LFCH5uK9OdRbphVQYrzHwjE1UxJjH 1XzUkxjw= X-Gm-Gg: AeBDieu/G+Dy0WIRLfePQVrOtl7/W9MVRL7Qt0pbyascgYWT6jW+xTLtMdxQEJXlyx2 CuvaUatV4fRrzubZXKtEu1L042QBC6V9PlhH9aRuKWngpbHnzI4EeAR8c7qe5nqnp1nt+jGUe5n +Xp/C6Fk2Wqi8C5jN28d/zkAAAtj9pa9EWvL0XpAHe8cK21pgz97U1XnUfuZX0s7xmXbd+w9Snp FJM1s2Bq22fC/QlNA28HEWzwJUTiklmgOrWd8qHTkB3TLjKhV/3JWYwhyKQTkYJ3ybY4GNhYrCC Bm4NmtNrzt41qzmx2gnJ24G/lWEwumLN7QHIcCeEq2nzxsZcI/7ZKKw3ZsAwi5VCAGYEmt2qzws +3BRrb5kDDWqFy2u00GC88ZyZbJjXDa/53TYAY7ZV6d0pEo+LRzm9r160ndMQ0ca2Fo3brbgczp o3nMwQMQjvHayLn39V64puVQECpsSh+8Vb9tWricxdJECanQmJ6kAPy5grl/+hsbT0EVSWMCI7m q8Qti3qivU= X-Received: by 2002:a7b:cd05:0:b0:488:a9c3:44a3 with SMTP id 5b1f17b1804b1-488cd4f463dmr84378015e9.2.1775850977577; Fri, 10 Apr 2026 12:56:17 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , Zhao Liu Subject: [PATCH v2 24/27] monitor: Do not check TARGET_I386 to build 'info sev' command Date: Fri, 10 Apr 2026 21:53:18 +0200 Message-ID: <20260410195323.17937-25-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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=unavailable 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: 1775851109294154100 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 --- 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 31e973fdeb0..5dcd24a8a89 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 f799a338d60..d97536cca1c 100644 --- a/target/i386/sev-system-stub.c +++ b/target/i386/sev-system-stub.c @@ -31,11 +31,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 dc289e3a482..09e73ef8b73 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -84,6 +84,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 Sat Apr 11 17:09:02 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=1775851081; cv=none; d=zohomail.com; s=zohoarc; b=YN80TFJ1mboy+uTF05VUHNVwLDwSgPcN1H+j3IOpmQun8Rag7rRFBs0bu9tlOfBPL1lnHskiZ/ME1coH2s9gNGwPYBPD4uGmf42ho/ZBnD3hj+qzh8ec8I9JgEQrg7Izte4heqhKxxcwaF3BOcJusl9yxoimjvkxyZj8GW0if9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851081; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=3N9tVXkZOmp74LI4AeaDzzl55NbG18DiRwK9K16fx5c=; b=OlO/kfVxQka/PZ66YK73RTF1m7O7IXziVw8PvNBaI1m2gswCVy6i0wmAsvs5x2kmqXmC5sjZ0ZqUn2iQLYQ863QUExWwa/gMqYm7NufU8fXUBeYk7kfyuJIp5uLDSHnKLpg55vDI2Fmmts/atynluGgOuYzxclhZMCX9Qs6HKic= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851081349217.8407263231927; Fri, 10 Apr 2026 12:58:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHy2-0000oX-KR; Fri, 10 Apr 2026 15:56:38 -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 1wBHy0-0000mH-PM for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:36 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHxq-0004ag-Ht for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:36 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-43b95e5b3afso1560801f8f.3 for ; Fri, 10 Apr 2026 12:56: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 5b1f17b1804b1-488d5b56d1asm96903885e9.15.2026.04.10.12.56.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850984; x=1776455784; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3N9tVXkZOmp74LI4AeaDzzl55NbG18DiRwK9K16fx5c=; b=Q6EwOKwtEdlJe78qgdf+K9reHh119V9ZNBDERPt7rGRFcT2GQrITYljBOIQD3zQEgs NUI88LoGbzVyLhEIxs3eoGzAZZtEadgYuld8mjSyWVPiKotie/W3UEAEw4iC7qZrs8+q o5U+3Kz8UXXxC+J2/I8bpRb9DVQ8z+2al/+yvHN3XWWKYRHa1pMolTo7raDNAIlNjKIk flEdBpEzivY1nFCgswyRvsmx39pzUKPBuEjCELKzyRS2HFAr5HBrM/q9WhLLOy6hD9a+ a3yPoaGO40K1PDY/8JVqbfHegTJ4J5rc+sUEcPeq3zncjIWp+c/1M877wXuxI6gn3+Dx whsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850984; x=1776455784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3N9tVXkZOmp74LI4AeaDzzl55NbG18DiRwK9K16fx5c=; b=YRQkWwcgsz3dx5b+hU4L2b5k+m62kT7BWZH0iGsG5GwmBw3cMjnq2kKCmZ6tKdHNB1 0/gLffh4rts8kEmLhcl/7xPGpA+a33VuxrGWyKXa1ghxhGDmd4hLysKKf5j8OBZl4erE rQFrClU2HXyS7Hw+aEeY2vmEg2fTYBMQeJs45flCR4XWGbB/REjtI/FSr96NHKhfp/ei 7NgITtWNzG7DYbVFBDW6ozuB88gZEiCIXT5dp11BJOmUVFQqeOhgzMn6ZaI14Lqz5Vkv fxal0MAftsxuXCKENwkGaN+RB3TT8q/EBBQS3GYknmS4GhjXsXx8QuDLjpbGEU4H07Gm gt9Q== X-Gm-Message-State: AOJu0YwZjO1IJDqDpLch/vfCB6axJMdTsza9EwsfEwWkl4gvbHuSLYWL 4mK+mCkcDjyuCHSeACGdjujppOsqEuBbLD5rO69ciwoJ/+Ax0jJHk68Udj0a+LSgwdFaeaRf1o2 Vf1ZEy5c= X-Gm-Gg: AeBDietKp3QerXU3VoJeumcN43KseRns6Z5hjq6P5SRtNL6sv+oG9Vapy49Q/olRdpx OR0hA+xEdCYwmaVvwGAji3V0E3lhEdN1nUpH7ZRzFSwLjpbkxO3RO0aiDw3i8SGwclTu6p0JcKi eRjwczxXZZXH4K1YvGiMl4FBlXroLF07B9SS2jHiHNtKv4ksWxKBRCSjQklQHOP0/lKMBtd6x7P G3JtG/UFLUlCns7fojzZh0U6pnp5wjxRGz2AX2h2lsHNm2Z+E5Ez0akTHCygFHhMa2OpFA2RVeC bQrKfq1hnFuthjIih95JrPGawg3gHbE0YvuXUFXPiufGCDYm1AOYqotYjIK15vLEfTdUeLDHgaZ r5Y6usVnsCX9wUcCziezGlV/p/Gy4swuGEf65P6zaAMhJtcl4NzPcYmW8b6xvgU4eEBvT4Sytut cOVOUZamIXQzS2WdagXtoqjjII2Ciet/vPASRmr0y9XGh5JOvKitPZFRaBjlGO0GP6zwlZRZXW X-Received: by 2002:a05:600c:35c7:b0:483:64b4:79da with SMTP id 5b1f17b1804b1-488d68b27d6mr64123085e9.26.1775850984497; Fri, 10 Apr 2026 12:56:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 25/27] monitor: Do not check TARGET_I386/RISCV to build 'info mem' command Date: Fri, 10 Apr 2026 21:53:19 +0200 Message-ID: <20260410195323.17937-26-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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=unavailable 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: 1775851082836154100 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 --- 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 09e73ef8b73..ed7ca54ae06 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -84,6 +84,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 Sat Apr 11 17:09:02 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=1775851058; cv=none; d=zohomail.com; s=zohoarc; b=gf66BcxkOruspJVQbjF4gLDh8ztS+c2uyv2pH07ug640HgZrn/InOhvZ/RiqvNFSq+2T6+l3K8z0za9Zj20Nq7By1+b/87WdgtfAZAZheYzARLZnmfUrk22KtYOvUD3tU3FZbQRqh4Qq1qrdCoa7djDZxRFjyB94fgnuPXf/irM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851058; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=iHk1fkmZMPSQJTPZJGYUyFHdUWj/VJJojjesXRowi+8=; b=LIeSfJxctULMVSdpCWih+kDKjcJiPmkE9BLlwerHAdaB5jhHsOtepg92j3DFqHxgYaIAo99b5ZFDIqP3oodGtX2AEfN4rmCGhX5tf9r0alqt5G/3usVVJcqeXDfRWriIDD8EvUwIN7RK7TbpmaxYtluuLMAT3R2p4dH13hf0uCA= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775851058598390.08128857815177; Fri, 10 Apr 2026 12:57:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHyP-0001oJ-16; Fri, 10 Apr 2026 15:57:01 -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 1wBHyO-0001nl-1D for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:57:00 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wBHxx-0004nz-Cd for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:56:59 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-43cfd96354aso1510268f8f.1 for ; Fri, 10 Apr 2026 12:56: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-43d63e469ddsm9751293f8f.17.2026.04.10.12.56.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850991; x=1776455791; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iHk1fkmZMPSQJTPZJGYUyFHdUWj/VJJojjesXRowi+8=; b=XWNwM+XVhZkK5hUhnXf5tbau2IwCa7L7eoyhDgP38BJEt833XQHT/P+1CAPs7+XOne BBqiu7QeSvsm+OpcyMgGBMo2BJ5qrImI0WWSd3F8fiucg9wMkPUV9FCEDZ9Qo4OB+h+s IDMpI0P7NFjUS71OT7jJF8iegGqFmR2q2SbiX8okhv8LEZ4InCY1QUsFzTLzTka7AVln WrERH23rxsUBZW9I71oleGESoN6VE5x+MGztpWsqMFjg8llVP6PA34tXQhZokHgXt4kP VYrveoRjpaHGb/BAv4fY9o2gYSJbj+TZ3LWNGhKR3Sfm25mxJ+jrL2q9Rs6BW5xnYWvB tkuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850991; x=1776455791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iHk1fkmZMPSQJTPZJGYUyFHdUWj/VJJojjesXRowi+8=; b=GSUiWFxeLs14AD5dKFigyoAo2M+0O4i9J30Skn65mQZIVH+uLGs1EItRvLoAhFIzvc XirGnHY2ECOLPdHKRSLubGVjAoRXIP7QcLKxv0J4rMdNB/Ci5a4p5kZwneFDBd0wDbt8 Xve/+I0APpXISL8gxpqaMQwzJC8MOdeXzhY5FoOtHkaDxlPHFD8EBx8LHbNnM00kUjXe ab746qDAT1lWXcmQyL4zPdwJl2IyS+IpMk/MNkUe/ip4khcrYO2zHb533x65n4xva3yf on2exN1VlGtH7pb5pPqUIm/EQMceIc9PN+f8w00v2K4F8GaEpnA0Cs7j6fZ2OKe3HClb 07cQ== X-Gm-Message-State: AOJu0Ywo82yNeNyRjuJ739tR1gI8NRDh/AmF6COObOik+99PdzZ13L1+ ELOUZ4hVHO990bwpYNtyqzQtSgPLEi4H4ohi/Mre1vKV7Nd3Y2xpmmQ4xyw0FvG6je3pURvtJfA Z24+jHOU= X-Gm-Gg: AeBDiesaayomIRwiBWF44Ys1sUbYFLMxZrReDtAtohDXRw1T7kPqSthLiXUk1tkJkNF W2xwvhKuNhEbw6ACi5BwC1Xij4EdDw+dkvKe7rq4QSCuBKcIdTZprHaB9xt6XoYvUb2jQkkd1vD BXo67RTVijot4MiGIZQhw8sKino/UUUYk3mcwsB1MgVYsspcHo9K6qCU9eRxHovZJN1iyAsoRh2 5NdxNim3zF1WYjJTcjT4FgxbpsmkFdN8VTS5guxkx2WRgyF9bLz4YwupDqyxhVB4tW8W/B57AmL /LScW2xRtTcsahDlbSjVzRKTEkUBMXp9Dvkk7Wm0HUqEMk/W/mX2Qd9l1w7stwRj0GXOgUb2F9e VMd5V86sMzht4IK9uWs1RFPdtZk+4jDnV88cujcylJsWap6v7fg5qXkHaWxI7CPeCOiwoJ6euzR yUjTdE7t7sNyN90XpXwU+Zd+mbWYNpxL+pAbH5pKS4jQnMgB7O3cDMwYepdi3mbTkZvWjfLR92 X-Received: by 2002:a05:6000:40df:b0:43d:4b00:9ee9 with SMTP id ffacd0b85a97d-43d642ca07cmr7372748f8f.43.1775850991514; Fri, 10 Apr 2026 12:56:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH v2 26/27] monitor: Do not check multiple TARGET_* to build 'info tlb' command Date: Fri, 10 Apr 2026 21:53:20 +0200 Message-ID: <20260410195323.17937-27-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1775851059187158500 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 --- 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 ed7ca54ae06..3c6d0032e93 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -86,6 +86,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 Sat Apr 11 17:09:02 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=1775851072; cv=none; d=zohomail.com; s=zohoarc; b=Es/U+WhTzLirIP2CLEL+KdHn6AdDotC+rL7de0kbvjLqYCEaj9oVT7FSxdmMawKlginmVkdQ6OQWhx0+6IZR7TcaYiNU0NwGRU9+YWETfSnlQ8oSiY2y64zaDn74nKIaDZBhxY5xKzJ3njRCn8d0lYgDSoNgkcUn3twxzi7Rw1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775851072; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=TnjRe5b33HAs4SIsako+kOOSPGazNPDfUbCOKtysLcw=; b=PVz/kGE/R9SK1LKCyEUbh5GvGZnAyRDHrPlLS6jqLJO/tLWEUd09UjIGUIGztXdqEQfUBXGiblnm+0Cu4sNEgWQS69ZbSfWCQ6BKoFkB+RWdxJFR5BBDx+arZpXSy9F5qHugaX5htv8uXzLR6dAK23QwAw9xANbQJgcAIt9fhjg= 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 lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177585107245535.484879777509036; Fri, 10 Apr 2026 12:57:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHyd-0002Dk-5V; Fri, 10 Apr 2026 15:57:15 -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 1wBHya-00029g-HT for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:57:12 -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 1wBHy4-0004vK-8v for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:57:12 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-483487335c2so26372345e9.2 for ; Fri, 10 Apr 2026 12:56: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-488d531f1f9sm124274295e9.1.2026.04.10.12.56.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Apr 2026 12:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775850998; x=1776455798; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TnjRe5b33HAs4SIsako+kOOSPGazNPDfUbCOKtysLcw=; b=Q2maWj+/L7brHeiwqlqdYeP+o/fCrvIPwee7m+0MISUo6xN6RPlAp48OnKwbqrfMj2 5EJltMnnMZaRQe818qvxoSwORUH5vNkvwbRH8WuLJ/+J24N7uClGgj5M11nH+VFnxq4m Op0ISVKbobLa00R5xHdhZ4KCAlFGWl5N/VmvF3eqKhAxSStzpyO93zqYD2fVviRGTqEV ppqOpRFNqu19chbZpr5+vXmezYRf6aohqqOYsHHctsaWs+e3BNUiz51O0zHYa4KVLraI BXMk5LI2CW+RrAos0q4bDSGnlfBseyL3at8ANJXqa1B7GqbcvcWPJPIvQX+VsXhK/e/Y ku4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775850998; x=1776455798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TnjRe5b33HAs4SIsako+kOOSPGazNPDfUbCOKtysLcw=; b=UYUcnRODYVFDUFhAVUwmuUDObfjOpSY72ByG0SPFx0zc2RJbtzuIfRk6M7e9kTxlHq a9KEQKcxa7IKGTaLS64vPf2CKuZLZrcj7aT0EYqnqfzeurozobOlFXXrZN/qqfg6V2w2 5JC5KJlgYC8THAutgaTc9xPIiCnAYwfmvWK8z2lfVo1s9+y7v0H0DSYAPm7GC4SkU54V ZKpEBj8eDOjm3Yo/t6oTRC7GyMXd9gil9F0bfQZPsdBa3NXccUtx2qOpxe4gbTXyO7kG Kq6Xr++zaZ84TnXDMgpNi2c6dir92PCv4q4skO0PgVDXioULHy2exWIezdmNJE7PHcxa zR9g== X-Gm-Message-State: AOJu0YwpMYAurXZ2WMzNHNPaHiyjdXRptVoLizrldJyQaXLqizJEKXO4 dKKmHhQeW4rJkIgSFB4KSC4lvsh4M3zHtp6DEbFe4Yem+583YxE9x7iWfA4L89TKm1G02KAphQ+ E0NdkVgM= X-Gm-Gg: AeBDieuBumsU50DOwV7P715IKoh26fZV24S5da9705CzRc7pt4kZI7drg8fXD1tN0al eUVX9hlruElpXyQGO3hH4GwrXdTXuRZhoCessx/vDgdhA3I0fiJ0/GxohZuGJ1gZZCQq6i/FxWk EtcAojYSf5SK6IQx3CvgvZ7J8bbr4lY4ZG2D9w7Dmhfib33K3UJ74SIvludLEGTpq4jc6uplfZZ 2gHMutZvG0N3UO5re/P12BOwufNs2KWJxKl4U8clMQ/BWeL0Ep8QZ1V77a/g2wV6VDSWUWbGMjb QMt3PhLNCzPFZNSguSCWuTsFbSTNFm62MgGNolVS5zTcQprHYZqMyhf95ekMtM9baHVsPByzEh9 VSZUrqui7lOiaibj7yiPBGWD/9W+xDKMG+Na8FNNqrQfrxDj2XmI9rfBSG1fiOt1z/PAXdkCpTP Cs/uB+zLigOdFh0EKk4v7gEEIbI82+0V/QZkYpdPhX9zKnAKZqFiBut8EVkWy1NGaBXcBuKlsA X-Received: by 2002:a05:600c:c0da:b0:488:936a:6220 with SMTP id 5b1f17b1804b1-488d685b577mr50873375e9.21.1775850998436; Fri, 10 Apr 2026 12:56:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Dr. David Alan Gilbert" , Pierrick Bouvier , qemu-riscv@nongnu.org, Markus Armbruster , qemu-s390x@nongnu.org, kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 27/27] monitor: Merge hmp-target.c code within hmp-cmds.c Date: Fri, 10 Apr 2026 21:53:21 +0200 Message-ID: <20260410195323.17937-28-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410195323.17937-1-philmd@linaro.org> References: <20260410195323.17937-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=lists.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=unavailable 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: 1775851074793154100 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 --- MAINTAINERS | 1 - monitor/hmp-cmds.c | 40 ++++++++++++++++++++++++ monitor/hmp-target.c | 73 -------------------------------------------- monitor/meson.build | 3 -- 4 files changed, 40 insertions(+), 77 deletions(-) delete mode 100644 monitor/hmp-target.c diff --git a/MAINTAINERS b/MAINTAINERS index 5dcd24a8a89..d184e25ddd4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3414,7 +3414,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 4968d511101..00000000000 --- a/monitor/hmp-target.c +++ /dev/null @@ -1,73 +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" - -/* 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