From nobody Sat Apr 11 18:34:34 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