From nobody Sun Jul 26 02:46:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277390; cv=none; d=zohomail.com; s=zohoarc; b=mRHxVy8AEyylmRFxHQZl+W1lKKU4HWIwFp1tV4wTvnWBgcHt7kNw+/AbdXJ2/pN6mo3pN10JbkPpvyBOTvwxpiZ0OOFQ0Xq0+O8QX7tudB7H6dAspUFrbo9zg7fsnOkKqrtvvU+GmroW4EFH2Yk1g9G3KWS0dxHQyhq7h9AI108= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277390; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0N5garPfkGQjAeUEzsjLtjevClXnBOjQBVGcUSmAQTU=; b=FypuPBTA3o68pk5+0IonQO0wk3HjPu9DdP28H8X6h6zAqz9QvywMZJO+/H9y5mZUXo6Y50z7rlgzo9B9iJjR1LYKjWoMibnCR9ogCsrqdzPmB9kXmVW5E8ME1DG6JhrRc23sVKmc5mSjdfuIN6DDqaUzeRv4WTRKgpUBSRXcjvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277390431918.1753854103886; Mon, 27 Apr 2026 01:09:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1y-0001ie-Sk; Mon, 27 Apr 2026 04:09:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1o-0001O2-22 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:20 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1l-0001vJ-P8 for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:15 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-48a3e9862f0so52116325e9.1 for ; Mon, 27 Apr 2026 01:09:12 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4899dc95920sm167976405e9.6.2026.04.27.01.09.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277351; x=1777882151; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0N5garPfkGQjAeUEzsjLtjevClXnBOjQBVGcUSmAQTU=; b=hUt31tiRtYBDDfMeg/P7McYqmi84LYz2qin14TvGwE+MbxvCUvpVAwqYAYNI66XDS7 sVGJap+KbPFxbUJBuDjkAEByEP6n0H4z47CVlHEBEVHHCBRf4sF5hyKSfp+5eMQYZ4oE 7kCxf39L7KF8iJ+TWsGy18ocyWgMS4Xkk+2UOh6Ct+4yOCrAlKEd+pk4MH+ceaoXPobl XPa8cB0xmzsFAzsC9MWpvZZMZhq7W4L958NjbmZMaAEm/Quyx8zgQQo9qEAEiITQetSe kvGyIDkbM3i4quxDq0ZeFXfhc+mzCsAKXLqWU8QXf3R4l61NzI79ffugm5LrqwjqP7ii z4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277351; x=1777882151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0N5garPfkGQjAeUEzsjLtjevClXnBOjQBVGcUSmAQTU=; b=FtYCpxCEcB3AhRuNASVIxwWJrOcYhPKAilQjz/dNS8S3z35kfkzfEeea4NcvtpolFK KDwUdSr2mvTsdbwbFMlJj9rl/9Y+ePrkgnV7S/5a1mPJotwNDCzUlQrUCZgK4H50Etz3 ASLX3kmxjjIsXaV9trpQFFFtOPi4JFWbE3CPJgt9LJxewZj5598Zh4qoVYMmxcfsaaKS FzDLG1N3JbNIvUadm0kR21ZwCFjrCGH9sG/U/a+lm9P8SOVW21a/n3bTkuLmhM7vJ9Dh lqUcI1UUDekrzsSVLA8hwQW9YX+meEAz9QY1ji+X0xp4VnQKXGJGBRrGiasOII97TVAD Wdow== X-Forwarded-Encrypted: i=1; AFNElJ8jjDJh+ZM8EMFR2oI+EnTiwETWflqef8Cwy12C3TS2OD8ZDTHPecTcwZujfsR6XlnJBUAMx477VUuy@nongnu.org X-Gm-Message-State: AOJu0Yy1lMuySIkyDvcvuT7SCq0shuy8dVDCxBXpI8LRgb9Z77mblyCn cvJgkZmRR9m0OvErJVPPpdAGAuP4PbCIZ9SuBTJwwDXaUj5thCWKvFyVSg3wEtCFLR6xMIIeat9 LxbGUdAs= X-Gm-Gg: AeBDieuE9I/v9xCn4Li9qp+BDtGNvy4nRilOdP92WndJImUVAyiN8lysrZ3ZEW8xnrJ 7OoDy0fcN2z41pOXFqsSaqiXkMwzP4eCyRnbL0+k4Yidr6bv9yfdM/hlVK2PQZ8EflD0c1h9CP/ YozhRu4Nmku7gPVX04QEOpuqK5ypaxbJWqNrQ3Ek2vWEO6VNazKPUO/jBkIh0OPeeSx2PoasZfR N7KXZCyXzWyhhM8YBznz6ORtSYAR9mGOkc6OTvDQ+VqEF3RM3Vxo55LC4rKiVtCUcFlZVn70f/d mkzFcvjEkyaj3JGAp9/szKPbupVMgCNsirga9VkJCFMKXq7H0es98NVkZ5WDV2qr6hT+8//zx2z 0EnQEKXMkE/08JzuiVXigOOzj56PVa+pj0ZMqXds/03F1FE2ovT9m4z8wMQhMR95bBpqvfjUCuf bfaAwzk9LhquWDeMFz58gUMaeXPsaWZc5kzts0zOFehllwk1yyON40oEQmL1JffcZYG6yEMNxml Pzy3T3c3jE= X-Received: by 2002:a05:600c:3ba0:b0:486:faa8:9e4 with SMTP id 5b1f17b1804b1-488fb8b91a7mr543470445e9.12.1777277351292; Mon, 27 Apr 2026 01:09:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 13/32] monitor: Do not check TARGET_S390X to build s390x commands Date: Mon, 27 Apr 2026 10:07:19 +0200 Message-ID: <20260427080738.77138-14-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277391637154100 These commands are filtered at build-time for s390x binary. By using the recently introduced HMPCommand::arch_bitmask flag we can filter them at runtime, making it possible to compile hmp-commands[-info].hx files once. Since the methods are used unconditionally within hw/s390x/, define them in the same stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Cornelia Huck Reviewed-by: Eric Farman --- MAINTAINERS | 1 + include/monitor/hmp.h | 7 +++++++ monitor/hmp-target.c | 5 ----- stubs/hmp-cmds-hw-s390x.c | 15 +++++++++++++++ hmp-commands-info.hx | 6 ++---- hmp-commands.hx | 6 ++---- stubs/meson.build | 1 + 7 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 stubs/hmp-cmds-hw-s390x.c diff --git a/MAINTAINERS b/MAINTAINERS index 8ed6648d094..5583df5087f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -122,6 +122,7 @@ F: include/hw/watchdog/wdt_diag288.h F: pc-bios/s390-ccw/ F: pc-bios/s390-ccw.img F: stubs/qmp-cpu-s390x.c +F: stubs/hmp-cmds-hw-s390x.c F: target/s390x/ F: docs/system/target-s390x.rst F: docs/system/s390x/ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index d694bfdf768..a29185741b8 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -16,6 +16,13 @@ =20 #include "qemu/readline.h" #include "qapi/qapi-types-common.h" +#include "monitor/monitor.h" + +#define HMP_STUB(cmd) \ + void hmp_##cmd(Monitor *mon, const QDict *qdict) \ + { \ + g_assert_not_reached(); \ + } =20 bool hmp_handle_error(Monitor *mon, Error *err); void hmp_help_cmd(Monitor *mon, const char *name); diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index f6dce326cf5..a222fd4c96a 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -36,11 +36,6 @@ #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-machine.h" =20 -#if defined(TARGET_S390X) -#include "hw/s390x/storage-keys.h" -#include "hw/s390x/storage-attributes.h" -#endif - /* Make devices configuration available for use in hmp-commands*.hx templa= tes */ #include CONFIG_DEVICES =20 diff --git a/stubs/hmp-cmds-hw-s390x.c b/stubs/hmp-cmds-hw-s390x.c new file mode 100644 index 00000000000..2b4f4cac79f --- /dev/null +++ b/stubs/hmp-cmds-hw-s390x.c @@ -0,0 +1,15 @@ +/* + * Human Monitor hw/s390x stubs + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" + +HMP_STUB(dump_skeys) +HMP_STUB(info_cmma) +HMP_STUB(info_skeys) +HMP_STUB(migrationmode) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 463038c302a..28dec25642d 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -717,30 +717,28 @@ SRST Show rocker OF-DPA groups. ERST =20 -#if defined(TARGET_S390X) { .name =3D "skeys", .args_type =3D "addr:l", .params =3D "address", .help =3D "Display the value of a storage key", .cmd =3D hmp_info_skeys, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``info skeys`` *address* Display the value of a storage key (s390 only) ERST =20 -#if defined(TARGET_S390X) { .name =3D "cmma", .args_type =3D "addr:l,count:l?", .params =3D "address [count]", .help =3D "Display the values of the CMMA storage attributes= for a range of pages", .cmd =3D hmp_info_cmma, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``info cmma`` *address* diff --git a/hmp-commands.hx b/hmp-commands.hx index 06d7b17bf25..ff65b39b454 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1125,30 +1125,28 @@ SRST =20 ERST =20 -#if defined(TARGET_S390X) { .name =3D "dump-skeys", .args_type =3D "filename:F", .params =3D "", .help =3D "Save guest storage keys into file 'filename'.\n", .cmd =3D hmp_dump_skeys, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``dump-skeys`` *filename* Save guest storage keys to a file. ERST =20 -#if defined(TARGET_S390X) { .name =3D "migration_mode", .args_type =3D "mode:i", .params =3D "mode", .help =3D "Enables or disables migration mode\n", .cmd =3D hmp_migrationmode, + .arch_bitmask =3D QEMU_ARCH_S390X, }, -#endif =20 SRST ``migration_mode`` *mode* diff --git a/stubs/meson.build b/stubs/meson.build index af4051e6c5e..99a89c00066 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -87,6 +87,7 @@ if have_system stub_ss.add(files('qmp-cpu.c')) stub_ss.add(files('qmp-cpu-s390x.c')) stub_ss.add(files('qmp-cpu-s390x-kvm.c')) + stub_ss.add(files('hmp-cmds-hw-s390x.c')) endif =20 if have_system or have_user --=20 2.53.0