From nobody Sun Jul 26 14:54:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777277373; cv=none; d=zohomail.com; s=zohoarc; b=Y0UWF34H8IOXU1LRdqWBzFVeyYkT3tQ8GJJ+w8otwV+OnvW6afpQQsrQR8lvLlOdP8CL5ftMNQ5UaV3OM1+i0B458EkTWK6+LDilkp5ofWbRomxxb+u0hzyVjm4L+SbxCTr/yEPhbkTzE9g49E9O9491ec6gpy3pyz2qDWXHIe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777277373; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=O7UCdCKJ1c5qVGsxeGNM3DP4EYb+8E6FPBO3612XPg8=; b=NIT9/sp3i95WUU0+Jk9kc0AXkIw7GH3kHZrBNfJ+02kldcZoRVie5u9R1uporwEYsg4KhSIp/00IHZ8LqgsHSk12MjXNvABfRnTeTgAvZ6gSZblMKHVL9xWds1htU7rBLp2+A3sRJWnDczdDgJ5UoalhE5Ai0vnxU03YpryxHy8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777277373713572.8297413282672; Mon, 27 Apr 2026 01:09:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wHH1z-0001lr-91; Mon, 27 Apr 2026 04:09:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wHH1t-0001QQ-NX for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:22 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wHH1s-0001zJ-1b for qemu-devel@nongnu.org; Mon, 27 Apr 2026 04:09:21 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-48a563e4ef7so65805275e9.0 for ; Mon, 27 Apr 2026 01:09:19 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc10019bsm797040345e9.4.2026.04.27.01.09.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Apr 2026 01:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777277358; x=1777882158; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=O7UCdCKJ1c5qVGsxeGNM3DP4EYb+8E6FPBO3612XPg8=; b=k2fx1BVd0JdohBqCRPX/OnkgLDcJQ8HagO8csgISU4zGlGPp69MdSNs45LO9i1oLdg ebL9IbwrO9Qy1IJQ6aP38HnSCqaOyxfc5klpb+5kcXmWXnDPKZOYGw0Fxnt4E8vE6FkS NM3HJCXmYI1pDHbtsEhK9toBgvYE+o7d6lDU84Uq+IhUIOZg5N6KxmrC2XkNE+0SV/+z ygkfXP+EKmYXkvK7rVyg8GCs5CZo2PGLJIkkYoZLsHvZfOu+Wb8SL+a2E5gH/ahMt7hD BGgPJ69utj7Ohl3cQ5lY1T2CJL0i3l5kmWTWC5Yg92pJdOezsa4po+EtLnNy0pGBhyqj u9qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777277358; x=1777882158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=O7UCdCKJ1c5qVGsxeGNM3DP4EYb+8E6FPBO3612XPg8=; b=UnDvN9VcluiVgeT2r/tdjdxfKpCVwPZoE3b3ZwoUJzdkobPPFE9zbp1bw2/kRPCZB4 bZBsw0ohz7X8kq6fqzq/G6oCJxaWp4C0OmJLwEU8WggExAZBHW8r2JdG5e/Zhg216O4w o9DFLXsOBWvBeLf3QskhetiFxuI47CN0RhvUhRGv3n8RQgUQTNko4Ysb1co4S+3TQAj9 M69mgCxWVb+nKoPk7M+a/2M+Lft+mEEcFVeXjHVC3IByKNy2a07gbDF2cF8bxAKAvr1V q5mhbp1WEHsPRQfGKG1rRwZd/9XT9zhzctKRqsiE2VBzgODqF+PScetKbWX3ryYcvty8 46OA== X-Forwarded-Encrypted: i=1; AFNElJ/jxQs9ame+Nqjgp9eK2JeqnnZOVHlfKjDRnunwcxZTJuL/wG/LoljXhHGNHmP3u+dpIf7wZzXlbeGD@nongnu.org X-Gm-Message-State: AOJu0Yy3dD5JyO8KCGy2sUZ4siJtu8u6zuDcRoOeQOmtFbPgZrssnRV/ ZgOcxfhcFa5NYMC8gdqJA70IR+nS52RwuPqod07i9LvFOVARFXffSN+939yXzQEmOJk= X-Gm-Gg: AeBDiestYr3lEBZccVtYzHLRn3luEYEsjwEC8jFR5FlGeLN403vlJrWHm2tdiz9BMJE kQMIndJdQXru2NHXComv0sfC44wWhOpV/ae+2QuIUWh3m6k9tvociIpuytJETlYbTWTuvA8hyA9 +RM6WovKZooVoMgVjiFll/FmP6ZfpG6nUlazi9kZi+npi0IHVQ7g4M0xlww3t/yi3d3sdehK+bH vFu8z47kRcEDCT9ihGQfCWyiSr/46l1AhXI/dzWFrIS9S+v+8Au/NSb+uZWHvY3Nl1CIhzGRH+t wVxdDKUBLeo0Lfh4apv5P5DmM7pTAe1aqrUlnTFdechb6XaWbA39KjhGFPbdcmXka4S6nsVBR02 Uuc1H3g4Fb+F3v3X3u1+O393Lua8F57XTtJl6+SfSNf4iKGAEkBNL4ZdNUValyg2E3alx99Vn5D ZvDpN5E9/z2qGXM6ty6Aelp6qvk5xcyOkw72XdF/bYgRZkRRL/vms2CC9MGB044QYolKQD4EKHs cxokjvAAas= X-Received: by 2002:a05:600c:a30a:b0:48a:581c:ead with SMTP id 5b1f17b1804b1-48a581c113cmr262189365e9.10.1777277357847; Mon, 27 Apr 2026 01:09:17 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v4 14/32] monitor: Do not check TARGET_I386 to build target/i386/ commands Date: Mon, 27 Apr 2026 10:07:20 +0200 Message-ID: <20260427080738.77138-15-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427080738.77138-1-philmd@linaro.org> References: <20260427080738.77138-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777277374129158500 These commands are filtered at build-time for i386/x86_64 binaries. By using the recently introduced HMPCommand::arch_bitmask flag we can filter them at runtime, making it possible to compile hmp-commands[-info].hx files once. Since these methods are used inconditionally within target/i386/, define them in the same stub file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + stubs/hmp-cmds-target-i386.c | 13 +++++++++++++ hmp-commands-info.hx | 4 +--- hmp-commands.hx | 5 +---- stubs/meson.build | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 stubs/hmp-cmds-target-i386.c diff --git a/MAINTAINERS b/MAINTAINERS index 5583df5087f..8493b12a342 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -148,6 +148,7 @@ F: configs/targets/i386-softmmu.mak F: configs/targets/x86_64-softmmu.mak F: docs/system/i386/ F: docs/system/target-i386* +F: stubs/hmp-cmds-target-i386.c F: target/i386/*.[ch] F: target/i386/Kconfig F: target/i386/meson.build diff --git a/stubs/hmp-cmds-target-i386.c b/stubs/hmp-cmds-target-i386.c new file mode 100644 index 00000000000..43a167056d5 --- /dev/null +++ b/stubs/hmp-cmds-target-i386.c @@ -0,0 +1,13 @@ +/* + * Human Monitor x86 stubs + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "monitor/hmp.h" + +HMP_STUB(info_local_apic) +HMP_STUB(mce) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 28dec25642d..b575e4ac993 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -113,16 +113,14 @@ SRST Show the cpu registers. ERST =20 -#if defined(TARGET_I386) { .name =3D "lapic", .args_type =3D "apic-id:i?", .params =3D "[apic-id]", .help =3D "show local apic state (apic-id: local apic to rea= d, default is which of current CPU)", - .cmd =3D hmp_info_local_apic, + .arch_bitmask =3D QEMU_ARCH_I386, }, -#endif =20 SRST ``info lapic`` diff --git a/hmp-commands.hx b/hmp-commands.hx index ff65b39b454..cfd53bdc744 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1488,18 +1488,15 @@ SRST Stop the QEMU embedded NBD server. ERST =20 - -#if defined(TARGET_I386) - { .name =3D "mce", .args_type =3D "broadcast:-b,cpu_index:i,bank:i,status:l,mcg_stat= us:l,addr:l,misc:l", .params =3D "[-b] cpu bank status mcgstatus addr misc", .help =3D "inject a MCE on the given CPU [and broadcast to o= ther CPUs with -b option]", .cmd =3D hmp_mce, + .arch_bitmask =3D QEMU_ARCH_I386, }, =20 -#endif SRST ``mce`` *cpu* *bank* *status* *mcgstatus* *addr* *misc* Inject an MCE on the given CPU (x86 only). diff --git a/stubs/meson.build b/stubs/meson.build index 99a89c00066..6142e0f4d9d 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -88,6 +88,7 @@ if have_system stub_ss.add(files('qmp-cpu-s390x.c')) stub_ss.add(files('qmp-cpu-s390x-kvm.c')) stub_ss.add(files('hmp-cmds-hw-s390x.c')) + stub_ss.add(files('hmp-cmds-target-i386.c')) endif =20 if have_system or have_user --=20 2.53.0