From nobody Mon Feb 9 03:30:45 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=1769693649; cv=none; d=zohomail.com; s=zohoarc; b=bfZ9D7ZbFj2dae8CjE6xUr+MOD96Om4oTg9lk79OFqrKqx1y2NIEcYU1fOoisSGANJyQTroJjSIGWmgJaxcbgKBqbAKkIXKtoa+Y4cs1BXt1HnJSDo0OhgMFIetwQwppDgMVYLXaYUYIAbFd1KmvnDCvb5QRLMVfj6L1po6EHTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769693649; 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=XbQjc8ZYqWORXyizHA7cHB2eAOXerMSR4t/7ALRc1wY=; b=kLXc46pVMyCj8KzoWI9qAmeQVyKk7/FQBN4sUUKJ8/+psJMaLXaxuuaAotIRt5I8yQiZYH9C087QnJqEBgbFF6ao0hg0aHRyO7HaAl1NUmjXEx5X3aLCxKbvK1zbfsU/ggfu/nR4ZxKcqAQXFo5jinV8DsoXreEVb9dxTZ3g8gw= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769693649027882.4711732873399; Thu, 29 Jan 2026 05:34:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlS9m-0000Xp-AX; Thu, 29 Jan 2026 08:34:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS8p-0008ON-Sz for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:00 -0500 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 1vlS8m-0002Zk-EI for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:32:58 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4806bf39419so13237305e9.1 for ; Thu, 29 Jan 2026 05:32:52 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c37433sm179322285e9.10.2026.01.29.05.32.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693570; x=1770298370; 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=XbQjc8ZYqWORXyizHA7cHB2eAOXerMSR4t/7ALRc1wY=; b=cO6137HLfAyKYBmGYxWTMZP84d7+K/RqSyFSeEULnOZn9ovGR0CSjYJugKfJtTcgRU CNBAMvOslITkYYTG+6AC8Mf4TpFn0p6KwOUof/98fL3L3KyXb21TMS+GNOWiLnfqKK/S wuxwzebFewp5jwibEeqMmGuRsFt8uQa/kpHB6EbJ3fOy8YTHlKkQActLiiUJgEB0Hdnp ep6JwfUSCL52IR7eYQfL6X8IB9h073sLPQCZHurJU2cwMzKc6qNc4Hblk79YbPutcMKT dV2kiglJnTOq2frBIX8a27zbYv324lCPmyxhPRITZaiJoo28hEvBqO4FYhH6OQa59jbz 0wUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693570; x=1770298370; 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=XbQjc8ZYqWORXyizHA7cHB2eAOXerMSR4t/7ALRc1wY=; b=KGjz1jM+DkVSMFOGbtBpnmHT/wPT+XxBI6pns17wXa13n6G8Z8WtMqz4FPTCu1Vhhw 46zQme/z3cFtvkIwnwvuL5O3IyjeBa3k1yfO9kMKKkllxaDMTMUNiG2zd3KwVRn0Cmst 2WWMu3ac1EGWrVogcWAfgPapfOG+bN9HJSsOCSRaODHBhoHg22UmVtFD261AZ6E0CzNh Fx1p7nHawXAe0yyvSALbn1EbA4pJi+vxrWIQ5jsXY8FAwhOlaIry4yD4w4CtXUczSwxo nk27OiVLvqYXq2aQpnol1mO/L/WeRjRgIriZxN3E3wG+nqhp5JxBjNTFiW186gi/eIK6 /BfQ== X-Gm-Message-State: AOJu0Yw1xt9uYWdjYYOHTZ3rhWUJybVu7T1gjaqQnOG8L2fN2qwbGL2D 3+1GYpV3kE39R/ageMvPwUjnCGsTLWtbsDOqOe42VlZVAOPdZURT+BRqCFxNQnh5bwXiPaHPeDc pfsFUGN4= X-Gm-Gg: AZuq6aIy/E3+/co8TQbdxNTTaHBMLcEDza7D296OtPlJE/hStm9DhlcUTzL/Pf6sy5r ZDYGkc4tXgofX90Ni5r2VKiZzRGCV5sK7vwVlq41PZSopHLvs6XLLY/93flv3B06wuu/vrYRgTQ hom8mJUFQ/cuO6dHRr8kyqzmSOXA/9j/RH9WSBa7blcNaM70popN36brqKAvQXfJSL6kxLJo5e0 w3W7W4dpSzFJI6ej4yw8Da61zFD9xY0/Q70oGP1UYzLEI5HEWEyh0rykKqxHeQfTzYPQPdO6+0Z WLE0KStDuZaWi2hKGmKtLUhywmFYj6CaiWhTnk/4tDmlg6rzslRLmQrPfUk7L3Z+ib67E6+PkeJ 2reWf9n90uqrk+l1AiRM2rPE1kTV0FZcC+pI9teFw9SXlmNj/nBqy1zJOTFpBNIX36LkbinFcTy 7Or9TDIqbrfdoduWrItLPZ2IskEPeso3UuFvvBqeqJ4mJAbetmkUIR8tZ+jg67 X-Received: by 2002:a05:600c:3505:b0:477:a289:d854 with SMTP id 5b1f17b1804b1-4808289f9damr42646635e9.5.1769693570457; Thu, 29 Jan 2026 05:32:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 1/9] target/i386: Include missing 'svm.h' header in 'sev.h' Date: Thu, 29 Jan 2026 14:32:33 +0100 Message-ID: <20260129133241.35990-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769693650371154100 "target/i386/sev.h" uses the vmcb_seg structure type, which is defined in "target/i386/svm.h". Current builds succeed because the files including "target/i386/sev.h" also include "monitor/hmp-target.h", itself including "cpu.h" and finally "target/i386/svm.h". Include the latter, otherwise removing "cpu.h" from "monitor/hmp-target.h" triggers: ../target/i386/sev.h:62:21: error: field has incomplete type 'struct vmcb= _seg' 62 | struct vmcb_seg es; | ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu --- target/i386/sev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/sev.h b/target/i386/sev.h index 9db1a802f6b..4358df40e48 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -14,6 +14,8 @@ #ifndef I386_SEV_H #define I386_SEV_H =20 +#include "target/i386/svm.h" + #ifndef CONFIG_USER_ONLY #include CONFIG_DEVICES /* CONFIG_SEV */ #endif --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769693649; cv=none; d=zohomail.com; s=zohoarc; b=XvPhTNX9e19mUkFpzYxL7l0ZX4K/23N7bqAro4tiIx0RWfr9VsFy4p2T45ixELEglchKtYpo5MlcrFC9emnCPgyz2yN8JktmePYUuekrY93AYPvkoTQLdvfviZYV3W4pDnrli/Yw2BmiP7NfSli68Vxe11MKVjIdIzAR3DzwFC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769693649; 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=jc84jdH37KzF728Sj6zsRk41/3OawHC9hDcgf32rp1k=; b=l4ZaQzk4YSW4lPk3xIafF0SQ+rgNJd0TZpKeMw4Z4gPCDC02EJpzv9e6aVQEXGpJg7NrV+SNJt6pveQZRQSeMNJAlVrMpo9GlbrjbGWKFCVOundt44A9P0ytpmcpte1BgmX3Y4/MVeNxnd30E9N84sr11Zlu1iAiqSKpT8OEjGA= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769693649250621.5968781557747; Thu, 29 Jan 2026 05:34:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlS9o-0000h9-Qe; Thu, 29 Jan 2026 08:34:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS8t-000052-5y for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:08 -0500 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 1vlS8p-0002ad-Lr for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:02 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-4327555464cso818267f8f.1 for ; Thu, 29 Jan 2026 05:32:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e131cf16sm15539645f8f.22.2026.01.29.05.32.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693577; x=1770298377; 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=jc84jdH37KzF728Sj6zsRk41/3OawHC9hDcgf32rp1k=; b=eNWpIg1nE37hv6rXTzjeG2PlkdORohpiyMc0Ar8DUSM0YAfZH3D9yRLEGwjI/rQQqT tD+896ISvTc0gc6iJzPiFLbyv817Q2fuWMLBfdUap7fYQqQhrpJoY/0WEfpi6bFOUlsz P/lK3RqZ6AkcCoi0IFQZwALzblH0c6BEqxCoh8XywOt1OeYyf8f/d2WyfVvtOjIIozoV CCcMtcf/9qo9mprBN+33mwL2xhBmNYnz9lOBeP3at7fO/ZVmgtS1CBpoV2V/qr72cbV8 NRucf+yUYEOX6usrUsD2h+x5K4xv1YspAUUAbIxWUE92SYAX4VFRgSTAKe0vsLptT0mk bg9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693577; x=1770298377; 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=jc84jdH37KzF728Sj6zsRk41/3OawHC9hDcgf32rp1k=; b=JdLoi4NgoiJmBjqu5J0I+hY+CNUayXbTABDSPz6iB4KFJvULqhL1RPnUsxYjSYNxHM +NXk4R+OWxyWuNBpUq2G6c5o7Y9T9oP+R/afmygIdrZ36GDKxxLzPu+/dY6TJ3+awYzX LhpJt+6Q20Z5sOWqpIbnxa45hg+jTB0hkqQM3DgrS+PLKBhncBx0ewFOZwP/vdR8Ipf4 MbnZIdHPRYs0CSaJwTFext6Br3oTHd6tv0bGXFGLx8aSY5JkrGGYb1bxykB6zfghB0EW 2SfS946COzaJaq07sWagW9qCcQbHnL4bbd6bJIatKm8Ld0X/BlEEBI0dcIIoUBrdtC2A LbBA== X-Gm-Message-State: AOJu0YyUYJQdBo7/KYQwoypqRQ6n5pcfS3z/w6nrZw6Ilw0LPXy7a+8E xMPBYOIZ8GsJ+wj9zw2kRu/y7wFRsLXDwrwmFjRZH3r3g/dE+UxJEpf6/22etccTTZX3fIokOct gJfwIBdg= X-Gm-Gg: AZuq6aKHLSjINB7N7NwALli58yzXhrEIA9InGQkBxIBJrxUSFsZfYdkLUoISGpjre1t Ojt8xyd67FGflsVPJS1CvbA6JDRw6mlj0ypc8ieu9O/GqpzX5Gp0cHBv8tj+17B4t3djMN2RXBn muRdH4BzZvMpKIqDiPmoxu2kOBU15HqsCxJYXoO43Ut9DMxJSQ8EeLCLpNHJR0ISkfumK5rw/JS iUKDslANWG1Tx8Szaj4SURiGzDv6rVXnLpdF3bNh7QYcZwmBpb61TT2K7ZzJaRKqAi2UuSzIiLz yWbdYG8mV78ZYDaq7rGgg7SUAZO9O6aCRM0IU3C4VidI9s/6UnFIwSxid8xVbTJ9KUw4K3bP1Ms fNnPD14MtHHSy5ufgWV7qw1IzCOYFQQBGwRjJ7FQBasSeNptefEPWKDPBNXWv8+atOlVvAzYqdy lzy8nMB/xX9IUTNu//awkA+/seArtuJbsNliDOaaLn5fQy/1wgVpW5qYzm04fh X-Received: by 2002:a05:6000:40dc:b0:430:c76b:fadd with SMTP id ffacd0b85a97d-435dd073a76mr13761921f8f.28.1769693577318; Thu, 29 Jan 2026 05:32:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 2/9] monitor: Reduce target-specific declarations Date: Thu, 29 Jan 2026 14:32:34 +0100 Message-ID: <20260129133241.35990-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769693650735158500 Some declarations do not depend on target-specific types, move them out of "monitor/hmp-target.h" to "monitor/hmp.h". Commit 409e9f7131e ("mos6522: add "info via" HMP command for debugging") declared hmp_info_via() is declared twice. Remove the one in "hw/misc/mos6522.h" otherwise we get: In file included from ../hw/misc/mos6522.c:33: include/monitor/hmp.h:43:6: error: redundant redeclaration of 'hmp_info_v= ia' [-Werror=3Dredundant-decls] 43 | void hmp_info_via(Monitor *mon, const QDict *qdict); | ^~~~~~~~~~~~ In file included from ../hw/misc/mos6522.c:29: include/hw/misc/mos6522.h:175:6: note: previous declaration of 'hmp_info_= via' with type 'void(Monitor *, const QDict *)' 175 | void hmp_info_via(Monitor *mon, const QDict *qdict); | ^~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/misc/mos6522.h | 2 -- include/monitor/hmp-target.h | 14 -------------- include/monitor/hmp.h | 13 +++++++++++++ hw/i386/sgx-stub.c | 1 + hw/i386/sgx.c | 1 + monitor/hmp-cmds.c | 1 + target/i386/cpu-apic.c | 1 + target/i386/sev-system-stub.c | 1 + target/i386/sev.c | 1 + target/m68k/monitor.c | 1 + target/riscv/monitor.c | 1 + 11 files changed, 21 insertions(+), 16 deletions(-) diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index 150e30a2c11..82838d09106 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -172,6 +172,4 @@ extern const VMStateDescription vmstate_mos6522; uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size); void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size); =20 -void hmp_info_via(Monitor *mon, const QDict *qdict); - #endif /* MOS6522_H */ diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index b679aaebbff..5167d17d41d 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -47,18 +47,4 @@ int target_get_monitor_def(CPUState *cs, const char *nam= e, uint64_t *pval); CPUArchState *mon_get_cpu_env(Monitor *mon); CPUState *mon_get_cpu(Monitor *mon); =20 -void hmp_info_mem(Monitor *mon, const QDict *qdict); -void hmp_info_tlb(Monitor *mon, const QDict *qdict); -void hmp_mce(Monitor *mon, const QDict *qdict); -void hmp_info_local_apic(Monitor *mon, const QDict *qdict); -void hmp_info_sev(Monitor *mon, const QDict *qdict); -void hmp_info_sgx(Monitor *mon, const QDict *qdict); -void hmp_info_via(Monitor *mon, const QDict *qdict); -void hmp_memory_dump(Monitor *mon, const QDict *qdict); -void hmp_physical_memory_dump(Monitor *mon, const QDict *qdict); -void hmp_info_registers(Monitor *mon, const QDict *qdict); -void hmp_gva2gpa(Monitor *mon, const QDict *qdict); -void hmp_gpa2hva(Monitor *mon, const QDict *qdict); -void hmp_gpa2hpa(Monitor *mon, const QDict *qdict); - #endif /* MONITOR_HMP_TARGET_H */ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 83721b5ffc6..e222bea60cd 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -180,5 +180,18 @@ void hmp_info_mtree(Monitor *mon, const QDict *qdict); void hmp_info_cryptodev(Monitor *mon, const QDict *qdict); void hmp_dumpdtb(Monitor *mon, const QDict *qdict); void hmp_info_firmware_log(Monitor *mon, const QDict *qdict); +void hmp_info_mem(Monitor *mon, const QDict *qdict); +void hmp_info_tlb(Monitor *mon, const QDict *qdict); +void hmp_mce(Monitor *mon, const QDict *qdict); +void hmp_info_local_apic(Monitor *mon, const QDict *qdict); +void hmp_info_sev(Monitor *mon, const QDict *qdict); +void hmp_info_sgx(Monitor *mon, const QDict *qdict); +void hmp_info_via(Monitor *mon, const QDict *qdict); +void hmp_memory_dump(Monitor *mon, const QDict *qdict); +void hmp_physical_memory_dump(Monitor *mon, const QDict *qdict); +void hmp_info_registers(Monitor *mon, const QDict *qdict); +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 #endif diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index d295e54d239..1dd8d9afbfa 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -1,5 +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" diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index e2801546ad6..5e792e8e6e9 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -16,6 +16,7 @@ #include "hw/mem/memory-device.h" #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" diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 5a673cddb2a..bad034937a9 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -21,6 +21,7 @@ #include "gdbstub/enums.h" #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" diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c index eeee62b52a2..f7ad7b51394 100644 --- a/target/i386/cpu-apic.c +++ b/target/i386/cpu-apic.c @@ -10,6 +10,7 @@ #include "qobject/qdict.h" #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" diff --git a/target/i386/sev-system-stub.c b/target/i386/sev-system-stub.c index 7c5c02a5657..fb84aee94d2 100644 --- a/target/i386/sev-system-stub.c +++ b/target/i386/sev-system-stub.c @@ -13,6 +13,7 @@ =20 #include "qemu/osdep.h" #include "monitor/monitor.h" +#include "monitor/hmp.h" #include "monitor/hmp-target.h" #include "qapi/error.h" #include "sev.h" diff --git a/target/i386/sev.c b/target/i386/sev.c index 1d70f96ec1f..fef9f441c61 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -36,6 +36,7 @@ #include "migration/blocker.h" #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" diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index 161f41853ec..6d101c75df0 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -7,6 +7,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" +#include "monitor/hmp.h" #include "monitor/hmp-target.h" #include "monitor/monitor.h" =20 diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index 8a77476db93..478fd392ac6 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "cpu_bits.h" #include "monitor/monitor.h" +#include "monitor/hmp.h" #include "monitor/hmp-target.h" #include "system/memory.h" =20 --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769694382; cv=none; d=zohomail.com; s=zohoarc; b=IxBWFY+3kMZzDnHr+XHdYTqE4NGFQ3H1TldKyXyMj2kOQklST3Upgb8WddvM1AqFzuSIDgF48YhPShBvcBxvaYINYNALNGx4Z6t6I+VEayQz9aUZ5nC8emhnzB3lTVKN3ruEaBH2e3KCu1x/cwswsbgEzQrZXDdSjfrvfuxgV+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769694382; 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=2/5ri0x0HKOQ4AevWnY2CiNFX91P9a3QRDv363s7aV8=; b=ITIVnjCyGDRWxZWADV7Z2eBxBZ2aoQtmv5VEw3ijFGIXQXN8qocsx3LAvnhDrW+fzO2iQ3oiQggJJJ1rRRhE8Bc7diQks4w2o87bHpGWgt1Ynf+wZ2quj+aO3iFUoidSb+KQhpb6pq9XnpczKxXR0YpBg18r6e2Y/fRuJRHg8Ls= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769694382543631.7093015810902; Thu, 29 Jan 2026 05:46:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSA7-0001NH-D4; Thu, 29 Jan 2026 08:34:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS90-000097-Jy for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:13 -0500 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 1vlS8w-0002bi-4H for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:08 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4806bf03573so5458665e9.2 for ; Thu, 29 Jan 2026 05:33:05 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-481a5d30f09sm4270945e9.1.2026.01.29.05.33.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693584; x=1770298384; 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=2/5ri0x0HKOQ4AevWnY2CiNFX91P9a3QRDv363s7aV8=; b=ig1kMa0vzvBtkCk9tj/n4tW6fT3uJScxO81s0BrtzZ36OYvYol2YYYPHuKQYeRm3FI SnaeKECkAlM2UvZG99rB9FyrjyBdfLQINnAXRnSMa6QVKx5aAByf5Z/BRvL1F0awciQB SgBjL5y5bfv8i9Ti3HdXahl6aWBmAVhctd8MTjWnHhWWNRHtcoNPYL/ZCp5HbRkWoxd8 Qfp7Yacn9lH8lGH0SQmn0GIPrXQKkvwY5xs5JbJDY/pk+/fg3OcvWit/COMzSqjv6oGf rfNy+UdAyCv5IzzIXffWzcX6AIh7unvVdl5C+TINU6rxB1CSrxEUa2UCyD22/aP/BcEl mLMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693584; x=1770298384; 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=2/5ri0x0HKOQ4AevWnY2CiNFX91P9a3QRDv363s7aV8=; b=C7alOEee73FMnmmEStSBidoi/EJ0EUAu5idRIQng5dFpHSXadztbAoh7hSQfebzjSJ GksznMUmjan6UC/ZUltCmDlWBiX93kbXaR7Tk7IIogJGNZP5kLVRNszpfrntRLAl7f/1 ef7ZpWN9B5MecPN3S5VmGz6O34NaRy5Op8uuS1sWa2gBWUr12jUQnk9ToWRSyGt5/j64 lNWpgDLhRUnAmkXorW85uZg40KOjzY7++01GxgaIz/we3etNwtw3z2jrCqiaR3ZUL+GI adGDtmrtPjdS8VpmsFXG5qa2hvB37etHAiQQ6lyf8xYBTFP35l5c5s7pE9Bo74FATaNz VBqQ== X-Gm-Message-State: AOJu0YwzOMI7cdJ38cYs9uAAUPyU6TWgg6WhscJk3OjGJ42SRBRDrHgF NwTV1+Xp7gBnuGacPRykilCIb+vcj4Jya/dmjYYL0lZCPv0qRGf14jMGbAbmRzNaZ1CySnkE3fQ Y2rJZTg0= X-Gm-Gg: AZuq6aIRdbjG62m9auhUExebQu1gfW0peLSXscQmO1w/Z+bqQwdTczNyXsTU8uzEKDK INCSvnIAxRDq1ZGAbMHWTCEh/GepacOrbuxy/gflyVJkIrOMGtS9vUAVabIm33guiU99Bd5+KzS y0au+vstCFvtDPzaDBaPBLtTtLe70n+iWV/vsRbooRt6SrMG6ol56TYvHcMLhrHqukATrgOVXYx K2+P7WfU93jq5h86nENPRvDbvKIXZpICsR2jzWgEjJV6aLgF8GrYlxXoqPW6MosPXCA1bzMf8ER EqAqmtd73EomO3CcJcy6sOoZKjjIN4GoW3nvkDacCNYTYKr6/ivMUs5D9ElX7wq4BSm8T59wxZ4 YZ+y+L4vKol7S3/YU3Kg85zk23V8gh9kyCW+wHzzRJZF+hVUIlS2MhqU5w8Xi8Qbx2OCnSmL9mn NvY/Wa8Jz2BX9eMvXh3YJP38cE4OE2YM68NY928+UMjQz2FhMMRCCrsjDLu69Sua45uGeCxfI= X-Received: by 2002:a05:600c:6986:b0:480:1c10:5633 with SMTP id 5b1f17b1804b1-48069c86cf8mr97839845e9.26.1769693584271; Thu, 29 Jan 2026 05:33:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 3/9] monitor: Add hmp_cmds_for_target() helper Date: Thu, 29 Jan 2026 14:32:35 +0100 Message-ID: <20260129133241.35990-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769694384937158500 HMPCommand arrays are filled with target-specific commands, so defined in a target-specific unit. Introduce the hmp_cmds_for_target() to allow target-agnostic code to access the arrays. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- monitor/monitor-internal.h | 9 +++++++-- monitor/hmp-target.c | 13 ++++++++----- monitor/hmp.c | 8 +++++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 7735c731083..feca111ae31 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -169,8 +169,6 @@ extern QmpCommandList qmp_commands, qmp_cap_negotiation= _commands; extern QemuMutex monitor_lock; extern MonitorList mon_list; =20 -extern HMPCommand hmp_cmds[]; - void monitor_data_init(Monitor *mon, bool is_qmp, bool skip_flush, bool use_io_thread); void monitor_data_destroy(Monitor *mon); @@ -187,4 +185,11 @@ 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 +/* + * hmp_cmds_for_target: Return array of HMPCommand entries + * + * If @info_command is true, return the particular 'info foo' commands arr= ay. + */ +HMPCommand *hmp_cmds_for_target(bool info_command); + #endif diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 37dfd7fd4c6..59c60d13b52 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -44,8 +44,6 @@ /* Make devices configuration available for use in hmp-commands*.hx templa= tes */ #include CONFIG_DEVICES =20 -static HMPCommand hmp_info_cmds[]; - /** * Is @name in the '|' separated list of names @list? */ @@ -76,11 +74,16 @@ static HMPCommand hmp_info_cmds[] =3D { }; =20 /* hmp_cmds and hmp_info_cmds would be sorted at runtime */ -HMPCommand hmp_cmds[] =3D { +static HMPCommand hmp_cmds[] =3D { #include "hmp-commands.h" { NULL, NULL, }, }; =20 +HMPCommand *hmp_cmds_for_target(bool info_command) +{ + return info_command ? hmp_info_cmds : hmp_cmds; +} + /* * Set @pval to the value in the register identified by @name. * return 0 if OK, -1 if not found @@ -148,7 +151,7 @@ static void __attribute__((__constructor__)) sortcmdlis= t(void) void monitor_register_hmp(const char *name, bool info, void (*cmd)(Monitor *mon, const QDict *qdict)) { - HMPCommand *table =3D info ? hmp_info_cmds : hmp_cmds; + HMPCommand *table =3D hmp_cmds_for_target(info); =20 while (table->name !=3D NULL) { if (strcmp(table->name, name) =3D=3D 0) { @@ -164,7 +167,7 @@ void monitor_register_hmp(const char *name, bool info, void monitor_register_hmp_info_hrt(const char *name, HumanReadableText *(*handler)(Error **e= rrp)) { - HMPCommand *table =3D hmp_info_cmds; + HMPCommand *table =3D hmp_cmds_for_target(true); =20 while (table->name !=3D NULL) { if (strcmp(table->name, name) =3D=3D 0) { diff --git a/monitor/hmp.c b/monitor/hmp.c index 4caafbc7146..17e5756986f 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -301,7 +301,7 @@ void hmp_help_cmd(Monitor *mon, const char *name) } =20 /* 2. dump the contents according to parsed args */ - help_cmd_dump(mon, hmp_cmds, args, nb_args, 0); + help_cmd_dump(mon, hmp_cmds_for_target(false), args, nb_args, 0); =20 free_cmdline_args(args, nb_args); } @@ -1131,7 +1131,8 @@ void handle_hmp_command(MonitorHMP *mon, const char *= cmdline) =20 trace_handle_hmp_command(mon, cmdline); =20 - cmd =3D monitor_parse_command(mon, cmdline, &cmdline, hmp_cmds); + cmd =3D monitor_parse_command(mon, cmdline, &cmdline, + hmp_cmds_for_target(false)); if (!cmd) { return; } @@ -1375,7 +1376,8 @@ static void monitor_find_completion(void *opaque, } =20 /* 2. auto complete according to args */ - monitor_find_completion_by_table(mon, hmp_cmds, args, nb_args); + monitor_find_completion_by_table(mon, hmp_cmds_for_target(false), + args, nb_args); =20 cleanup: free_cmdline_args(args, nb_args); --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769694205; cv=none; d=zohomail.com; s=zohoarc; b=L/AK8dXwNG6mlRRYfzbSGPTn1lei5KMnHNaBBbnYkhGcbnFWJecju3/HX1Oi88BcdhS/foJ6I/tJr8Q9LwSvWnMTmEcIClg++rh7FkyrR9Axunr5GlvGlZs+uc7sg5NKkh8IPmfIQ1J4lUBEQC456P/3GK9YxXxM8d/a9cLTjVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769694205; 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=apOZMf0tEn3rJJPrSfMcVgYQ3RZZMtDVtwPqX5t6dIc=; b=X8T8ArvFdXyTPWR3clAQiFiaz871gJMmhEbwc4ukZ7pPYmRwMhDaleMoknV0ygoRhiHtHv1WQAv4PFJb73sm0Vbc6ii7GIh7JtqWorERRk1q7C1V4g5TqQHNOjPthPaRsgcVgrZEdzB3tJ2xGQ9dF8HsnExDugk89/sVmVYI0u8= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769694205008550.1473236031821; Thu, 29 Jan 2026 05:43:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSAA-0001oX-3A; Thu, 29 Jan 2026 08:34:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS98-0000G9-3Z for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:22 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlS94-0002co-5k for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:17 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-432755545fcso752772f8f.1 for ; Thu, 29 Jan 2026 05:33:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e1322f40sm14195715f8f.34.2026.01.29.05.33.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693591; x=1770298391; 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=apOZMf0tEn3rJJPrSfMcVgYQ3RZZMtDVtwPqX5t6dIc=; b=zcJ6YLxipDwzdZdCtToJ6GlOD3UcLF9huU0jCo1X+nBh9JRK77nzDFtDKWSENANhgv ZG2MUiieMLE1nUzcXpr5s10TjSKIhEE6j8/OUVxIz9mG+i8KIoaYJcbffpHSImWoyzPD +joDBCBx9dEo2TwOnKQxDxxudGHnB0Q5QyncTj5pMIEwVJOVf76coZ2SIk79HIKqVmd/ 5rFWQI5M3KYb+W4G94y7MTm0sEp3ut3hskOwgh9RDvgwCnjjEnhoalKMkP93Pv/k8yjB kesNx+WXvfRKF2oLSLM2uqO+Foe3tUzV1VMaztHMncn59SrV98ESX/g5n10zO2NsECOQ K/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693591; x=1770298391; 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=apOZMf0tEn3rJJPrSfMcVgYQ3RZZMtDVtwPqX5t6dIc=; b=w4cV/C6yHauKYqRFgoEeHKoYN36p0nHpdlGyAI4tHQWprFJ5opsK/PrkpVqjlwool1 leqba5EYaUQAtR49lmciuAV4bQFyrQueudzNEJjBh3y5i6TSNY+0CuVMOND3Q59Bhjrn t6IvG4OJhFTddoSeL7+kHg6rvTCHIGlE0/F9fC07xSk24ZuWzsoZZldgmrHfu4ab4ZbX BM3Lf07VfKCR98+qzFKY1tm2QFOSMRnlOihy3+VPADiPNZJEh0olgaMmlS4nIyW7Km7x npcKlXK1cJQB0OiMJMGfFX/Pq7xnc0LBdrT1hAWbBppdzL7sopWhuWkjFGkzIYOkOAki WVNA== X-Gm-Message-State: AOJu0YwhYNxxKWky9jB3fq1BlJt7aG1Hy8N3BCEItUrhNKTjGY0HqbCN XuOYLwLaG0QE21GTpvjkjfTtkwHdurDBCaT7flNXGYz5S7nrJmXSHdnttQuju+e+BYkeH2XUV2T XkYFTEWg= X-Gm-Gg: AZuq6aIOf8AzPcVd0kxv5lVU0BjSxHX9Xw8y2aaZiqEaoGGlN6UaKsfwZjM1k4csGCT xzktzxhwG4x8CyhvkvaS++L/Wt5BpclZmc3K35Fk0g+amdMEzY3tWktiSG79qQwKZwvmDXphI0C Y8rBK4sKEBcfD/I27cg8fxCNpAU9/W9oqHgly3xd8oN5nm5eb1wxZzkNVqd6qxWddw3G2zfUemT ZBbINBG2ch3Pbw5yH+SBbkyyF0Fk/jvh29myuMP0zEo7fV3XwruEMlb7imVFDjdd4xj3Bxb1038 WOH0Pfvf6t9ZC8yKNZxZp0mF4h3Xle4vStjoUZzJcRVZ2dBk2b5n+oD3h6FETjNJgKJyLlP8vOU UIImWMFKbLC1ipqoXZj4Cv7YmNAJi7s85737/vgbwDQDuv6gcXH2SfsIRikpqPBbdZ9/N+jqtuB svu19xhfO4n63R09/6zS+u1dA9899SVZ5ciUJ3tna8slHyVGbBu8lM+DFi/1av X-Received: by 2002:a05:6000:2401:b0:435:97b2:a9b with SMTP id ffacd0b85a97d-435dd1c0cb9mr12196567f8f.37.1769693591265; Thu, 29 Jan 2026 05:33:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 4/9] monitor: Reduce target-specific methods Date: Thu, 29 Jan 2026 14:32:36 +0100 Message-ID: <20260129133241.35990-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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: 1769694206603154100 The following methods don't use target-specific code anymore: - hmp_compare_cmd() - monitor_register_hmp() - monitor_register_hmp_info_hrt() Move them to hmp.c which is target-agnostic, being built once. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- monitor/hmp-target.c | 57 -------------------------------------------- monitor/hmp.c | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 59c60d13b52..420969bd6eb 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -33,8 +33,6 @@ #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-machine.h" -#include "qapi/error.h" -#include "qemu/cutils.h" =20 #if defined(TARGET_S390X) #include "hw/s390x/storage-keys.h" @@ -44,29 +42,6 @@ /* Make devices configuration available for use in hmp-commands*.hx templa= tes */ #include CONFIG_DEVICES =20 -/** - * Is @name in the '|' separated list of names @list? - */ -int hmp_compare_cmd(const char *name, const char *list) -{ - const char *p, *pstart; - int len; - len =3D strlen(name); - p =3D list; - for (;;) { - pstart =3D p; - p =3D qemu_strchrnul(p, '|'); - if ((p - pstart) =3D=3D len && !memcmp(pstart, name, len)) { - return 1; - } - if (*p =3D=3D '\0') { - break; - } - p++; - } - return 0; -} - /* Please update hmp-commands.hx when adding or changing commands */ static HMPCommand hmp_info_cmds[] =3D { #include "hmp-commands-info.h" @@ -147,35 +122,3 @@ static void __attribute__((__constructor__)) sortcmdli= st(void) sizeof(*hmp_info_cmds), compare_mon_cmd); } - -void monitor_register_hmp(const char *name, bool info, - void (*cmd)(Monitor *mon, const QDict *qdict)) -{ - HMPCommand *table =3D hmp_cmds_for_target(info); - - while (table->name !=3D NULL) { - if (strcmp(table->name, name) =3D=3D 0) { - g_assert(table->cmd =3D=3D NULL && table->cmd_info_hrt =3D=3D = NULL); - table->cmd =3D cmd; - return; - } - table++; - } - g_assert_not_reached(); -} - -void monitor_register_hmp_info_hrt(const char *name, - HumanReadableText *(*handler)(Error **e= rrp)) -{ - HMPCommand *table =3D hmp_cmds_for_target(true); - - while (table->name !=3D NULL) { - if (strcmp(table->name, name) =3D=3D 0) { - g_assert(table->cmd =3D=3D NULL && table->cmd_info_hrt =3D=3D = NULL); - table->cmd_info_hrt =3D handler; - return; - } - table++; - } - g_assert_not_reached(); -} diff --git a/monitor/hmp.c b/monitor/hmp.c index 17e5756986f..0a5bbf82197 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1497,3 +1497,58 @@ void monitor_init_hmp(Chardev *chr, bool use_readlin= e, Error **errp) monitor_event, NULL, &mon->common, NULL, true= ); monitor_list_append(&mon->common); } + +/** + * Is @name in the '|' separated list of names @list? + */ +int hmp_compare_cmd(const char *name, const char *list) +{ + const char *p, *pstart; + int len; + len =3D strlen(name); + p =3D list; + for (;;) { + pstart =3D p; + p =3D qemu_strchrnul(p, '|'); + if ((p - pstart) =3D=3D len && !memcmp(pstart, name, len)) { + return 1; + } + if (*p =3D=3D '\0') { + break; + } + p++; + } + return 0; +} + +void monitor_register_hmp(const char *name, bool info, + void (*cmd)(Monitor *mon, const QDict *qdict)) +{ + HMPCommand *table =3D hmp_cmds_for_target(info); + + while (table->name !=3D NULL) { + if (strcmp(table->name, name) =3D=3D 0) { + g_assert(table->cmd =3D=3D NULL && table->cmd_info_hrt =3D=3D = NULL); + table->cmd =3D cmd; + return; + } + table++; + } + g_assert_not_reached(); +} + +void monitor_register_hmp_info_hrt(const char *name, + HumanReadableText *(*handler)(Error **e= rrp)) +{ + HMPCommand *table =3D hmp_cmds_for_target(true); + + while (table->name !=3D NULL) { + if (strcmp(table->name, name) =3D=3D 0) { + g_assert(table->cmd =3D=3D NULL && table->cmd_info_hrt =3D=3D = NULL); + table->cmd_info_hrt =3D handler; + return; + } + table++; + } + g_assert_not_reached(); +} --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769694205; cv=none; d=zohomail.com; s=zohoarc; b=mWDpZPL69Gm5wXMuc7r6DnjXO7OvDa2+G3bSGZzR8/jfXPnhOzEtQ8zoAM5Hf+HQfmINikCcDg1/r7SbPLkUkOf5YuXk/NxCU7zZ9BIxycDaMy6SrEs2QMHEOohW274oAnDP8Af9ystZY39kVVGb9y9RKFqGHqhdDEtHMIooMdU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769694205; 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=D7onpzEg5oFF81Cr9JNPbzUwDH4GaGSfQFJXvSw5++8=; b=R1HNFnd0R3syeFIslbN5I6HfNpn1ZpxC1BxEsrRxQyyOyO7cbUPmNAtsOTZjEpbqN5YMy75tsN0Inm4ksAUGagEMs4V564i0L4m38c5g1Dm5tsTtxIYiMxT/5Dce6ndLwngd7dfh+Hshc8bgF6KR3FxCWnuggbge6oz/DrbpKRI= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769694205659703.0724348901001; Thu, 29 Jan 2026 05:43:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSAF-0002Xy-Uh; Thu, 29 Jan 2026 08:34:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS9O-0000SE-Pl for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:53 -0500 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 1vlS9L-0002dk-Oe for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:34 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4801c2fae63so7779905e9.2 for ; Thu, 29 Jan 2026 05:33:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-481a5cc4b99sm5046355e9.0.2026.01.29.05.33.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693598; x=1770298398; 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=D7onpzEg5oFF81Cr9JNPbzUwDH4GaGSfQFJXvSw5++8=; b=Y+G/iD/bmz2BkxzqEfcnZDCYBZzlKWez+FJaogfoPWjlKZMKTv++o1u/qUCAU2gLG1 JjP+YS+vTRrDGe6HKDdjS6ZWT7HcYF9mRrTHUs6u1ahgE2WGZPemiuN3rrODk9Bpo8OK 5GLm+4+B6rAIBjkVz9feEtGt1DJ8pFa+3rQ8ft8cWJoOML8KIPknwv5/q2LiSfibMapV 4PXNLVPrC/ev7D2zuvWHUzIMV03crAG32lnsG16ILc6ICx6AU9YpzFZxyAXN0WvgKbt0 K9CyugGZr5KYhQN6RzvyjvBj2LH5XesjRHsT8Ybxspxik9qqGNr50ZMyCabT2LWMMk7E MfsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693598; x=1770298398; 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=D7onpzEg5oFF81Cr9JNPbzUwDH4GaGSfQFJXvSw5++8=; b=O49i1qnzN/pcVq4RG2bzqBnIrqJo+9sPmwmtjZXiO/awKwCw9m7iVnflk0FVf4u5ip DEbw/IFJrc2SIRO0g2qz1/Ox9PLpSJnzILDjDnMPz7sGgokoQs/cpoLv3zyRLJVW4lGF 2uNYZSbXI+2b09bQ06pFlMNMrrVq+AvGWAlYoVkUHK4mTyztP+3xUWSxs8OTasS3oX6I GmWbSmoERYTKJAy6+0bzyVK1TiHMO7spk3f0MxT9Zsi/PuPEpSS0a2jQfQSrO9Wim42u I04SVSiao8K9/AFqii3lnV5vUrzWkxBZTYuRtZv9I9KkhYYPdFili0vcn6gP6ETG33AX QUBQ== X-Gm-Message-State: AOJu0YxPsBJuZ8k2kgrrPVtGB7lnIuRYpy0TykUlfUG600r0qYJxV3DZ 3UqiXlOHVA7U5gHIawAq/Ro7d+tQRUKGm07OLK59g7oqcLMP5yHFuynNGioosP5XPREcRHmdLZY 6z3G8AR4= X-Gm-Gg: AZuq6aIynXXXdL6o3cOIhPxSSiueEm9OQCbOQJcENtqvbY+/OPX9Pz4tyw6KyDIFqry 8769+QIMtYXqYyCGRExCsJB1vQtftEv+8uhz7RE/dWuwUtdxPb5CxIzsM7sDs8crgEc6azdHeqC Q20pbU9OSxH+A+J80jftiSCcvbi5bMp+msPJQQYTj6LaG7DeANt9uBOW9T4DR37XdBtUrlczgmh CaB9l9fw5pXdaS/9uzqVi0qVOnHbjuYIQ66ACFOqcGKT6JAIP6S7zmybuMLzOAAsq1XjNPZ8MFi 1Plhx/0qQ7duiblCQGTtqQhfarPzINXDv9MrnI/wNLVrM8tbi6jrLEHOpgB73O981XYpqkLJv6j HAq1ISuKNNuUpRj4kVVoVGYYi166OlJ2Hyf2hV7wuFvz2iF1nBkShbfLQZhgYiScFArWiJrlPOX 0XTzopOJKBwg9CeH9Ky7hc+uHvB0rgNPBfaNVrgys9tvikg9A2viwu610BTSNF X-Received: by 2002:a05:600c:154c:b0:475:de12:d3b5 with SMTP id 5b1f17b1804b1-48069c6136fmr94888945e9.34.1769693598162; Thu, 29 Jan 2026 05:33:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 5/9] monitor: Have MonitorDef::get_value() return an unsigned type Date: Thu, 29 Jan 2026 14:32:37 +0100 Message-ID: <20260129133241.35990-6-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769694208065158500 All implementations of the get_value() handler return an unsigned type: - target/i386/monitor.c monitor_get_pc() -> target_ulong eip; - target/ppc/ppc-qmp-cmds.c monitor_get_ccr() -> uint64_t ppc_get_cr(const CPUPPCState *env); monitor_get_xer() -> target_ulong cpu_read_xer(const CPUPPCState *env); monitor_get_decr() -> target_ulong cpu_ppc_load_decr(CPUPPCState *env); monitor_get_tbu() -> uint32_t cpu_ppc_load_tbu(CPUPPCState *env); monitor_get_tbl() -> uint64_t cpu_ppc_load_tbl(CPUPPCState *env); - target/sparc/monitor.c monitor_get_psr() -> target_ulong cpu_get_psr(CPUSPARCState *env1); monitor_get_reg() -> target_ulong *regwptr; Convert the MonitorDef::get_value() handler to return unsigned. Rename the MD_I32/MD_TLONG definitions mechanically doing: $ sed -i -e s/MD_I32/MD_U32/g $(git grep -lw MD_I32) $ sed -i -e s/MD_TLONG/MD_TULONG/g $(git grep -lw MD_TLONG) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- include/monitor/hmp-target.h | 7 ++--- monitor/hmp-target.c | 12 ++++---- target/i386/monitor.c | 8 ++--- target/m68k/monitor.c | 60 ++++++++++++++++++------------------ target/ppc/ppc-qmp-cmds.c | 25 +++++++-------- target/sparc/monitor.c | 10 +++--- 6 files changed, 59 insertions(+), 63 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 5167d17d41d..6d6653aee6e 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -32,14 +32,13 @@ typedef struct MonitorDef MonitorDef; struct MonitorDef { const char *name; int offset; - target_long (*get_value)(Monitor *mon, const struct MonitorDef *md, - int val); + uint64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int v= al); int type; }; #endif =20 -#define MD_TLONG 0 -#define MD_I32 1 +#define MD_TULONG 0 +#define MD_U32 1 =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 420969bd6eb..1600666ee92 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -67,7 +67,6 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const ch= ar *name) { const MonitorDef *md =3D target_monitor_defs(); CPUState *cs =3D mon_get_cpu(mon); - void *ptr; uint64_t tmp =3D 0; int ret; =20 @@ -81,13 +80,14 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const = char *name) *pval =3D md->get_value(mon, md, md->offset); } else { CPUArchState *env =3D mon_get_cpu_env(mon); - ptr =3D (uint8_t *)env + md->offset; + void *ptr =3D (uint8_t *)env + md->offset; + switch(md->type) { - case MD_I32: - *pval =3D *(int32_t *)ptr; + case MD_U32: + *pval =3D *(uint32_t *)ptr; break; - case MD_TLONG: - *pval =3D *(target_long *)ptr; + case MD_TULONG: + *pval =3D *(target_ulong *)ptr; break; default: *pval =3D 0; diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 99b32cb7b0f..427f1990399 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 uint64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); return env->eip + env->segs[R_CS].base; @@ -602,9 +602,9 @@ static target_long monitor_get_pc(Monitor *mon, const s= truct MonitorDef *md, =20 const MonitorDef monitor_defs[] =3D { #define SEG(name, seg) \ - { name, offsetof(CPUX86State, segs[seg].selector), NULL, MD_I32 },\ + { name, offsetof(CPUX86State, segs[seg].selector), NULL, MD_U32 },\ { name ".base", offsetof(CPUX86State, segs[seg].base) },\ - { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 = }, + { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_U32 = }, =20 { "eax", offsetof(CPUX86State, regs[0]) }, { "ecx", offsetof(CPUX86State, regs[1]) }, diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index 6d101c75df0..1bb5012da91 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -24,36 +24,36 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) } =20 static const MonitorDef monitor_defs[] =3D { - { "d0", offsetof(CPUM68KState, dregs[0]), NULL, MD_I32 }, - { "d1", offsetof(CPUM68KState, dregs[1]), NULL, MD_I32 }, - { "d2", offsetof(CPUM68KState, dregs[2]), NULL, MD_I32 }, - { "d3", offsetof(CPUM68KState, dregs[3]), NULL, MD_I32 }, - { "d4", offsetof(CPUM68KState, dregs[4]), NULL, MD_I32 }, - { "d5", offsetof(CPUM68KState, dregs[5]), NULL, MD_I32 }, - { "d6", offsetof(CPUM68KState, dregs[6]), NULL, MD_I32 }, - { "d7", offsetof(CPUM68KState, dregs[7]), NULL, MD_I32 }, - { "a0", offsetof(CPUM68KState, aregs[0]), NULL, MD_I32 }, - { "a1", offsetof(CPUM68KState, aregs[1]), NULL, MD_I32 }, - { "a2", offsetof(CPUM68KState, aregs[2]), NULL, MD_I32 }, - { "a3", offsetof(CPUM68KState, aregs[3]), NULL, MD_I32 }, - { "a4", offsetof(CPUM68KState, aregs[4]), NULL, MD_I32 }, - { "a5", offsetof(CPUM68KState, aregs[5]), NULL, MD_I32 }, - { "a6", offsetof(CPUM68KState, aregs[6]), NULL, MD_I32 }, - { "a7", offsetof(CPUM68KState, aregs[7]), NULL, MD_I32 }, - { "pc", offsetof(CPUM68KState, pc), NULL, MD_I32 }, - { "sr", offsetof(CPUM68KState, sr), NULL, MD_I32 }, - { "ssp", offsetof(CPUM68KState, sp[0]), NULL, MD_I32 }, - { "usp", offsetof(CPUM68KState, sp[1]), NULL, MD_I32 }, - { "isp", offsetof(CPUM68KState, sp[2]), NULL, MD_I32 }, - { "sfc", offsetof(CPUM68KState, sfc), NULL, MD_I32 }, - { "dfc", offsetof(CPUM68KState, dfc), NULL, MD_I32 }, - { "urp", offsetof(CPUM68KState, mmu.urp), NULL, MD_I32 }, - { "srp", offsetof(CPUM68KState, mmu.srp), NULL, MD_I32 }, - { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]), NULL, MD_I32 }, - { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]), NULL, MD_I32 }, - { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]), NULL, MD_I32 }, - { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]), NULL, MD_I32 }, - { "mmusr", offsetof(CPUM68KState, mmu.mmusr), NULL, MD_I32 }, + { "d0", offsetof(CPUM68KState, dregs[0]), NULL, MD_U32 }, + { "d1", offsetof(CPUM68KState, dregs[1]), NULL, MD_U32 }, + { "d2", offsetof(CPUM68KState, dregs[2]), NULL, MD_U32 }, + { "d3", offsetof(CPUM68KState, dregs[3]), NULL, MD_U32 }, + { "d4", offsetof(CPUM68KState, dregs[4]), NULL, MD_U32 }, + { "d5", offsetof(CPUM68KState, dregs[5]), NULL, MD_U32 }, + { "d6", offsetof(CPUM68KState, dregs[6]), NULL, MD_U32 }, + { "d7", offsetof(CPUM68KState, dregs[7]), NULL, MD_U32 }, + { "a0", offsetof(CPUM68KState, aregs[0]), NULL, MD_U32 }, + { "a1", offsetof(CPUM68KState, aregs[1]), NULL, MD_U32 }, + { "a2", offsetof(CPUM68KState, aregs[2]), NULL, MD_U32 }, + { "a3", offsetof(CPUM68KState, aregs[3]), NULL, MD_U32 }, + { "a4", offsetof(CPUM68KState, aregs[4]), NULL, MD_U32 }, + { "a5", offsetof(CPUM68KState, aregs[5]), NULL, MD_U32 }, + { "a6", offsetof(CPUM68KState, aregs[6]), NULL, MD_U32 }, + { "a7", offsetof(CPUM68KState, aregs[7]), NULL, MD_U32 }, + { "pc", offsetof(CPUM68KState, pc), NULL, MD_U32 }, + { "sr", offsetof(CPUM68KState, sr), NULL, MD_U32 }, + { "ssp", offsetof(CPUM68KState, sp[0]), NULL, MD_U32 }, + { "usp", offsetof(CPUM68KState, sp[1]), NULL, MD_U32 }, + { "isp", offsetof(CPUM68KState, sp[2]), NULL, MD_U32 }, + { "sfc", offsetof(CPUM68KState, sfc), NULL, MD_U32 }, + { "dfc", offsetof(CPUM68KState, dfc), NULL, MD_U32 }, + { "urp", offsetof(CPUM68KState, mmu.urp), NULL, MD_U32 }, + { "srp", offsetof(CPUM68KState, mmu.srp), NULL, MD_U32 }, + { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]), NULL, MD_U32 }, + { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]), NULL, MD_U32 }, + { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]), NULL, MD_U32 }, + { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]), NULL, MD_U32 }, + { "mmusr", offsetof(CPUM68KState, mmu.mmusr), NULL, MD_U32 }, { NULL }, }; =20 diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index 7022564604f..07938abb15f 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -33,26 +33,23 @@ #include "cpu-models.h" #include "cpu-qom.h" =20 -static target_long monitor_get_ccr(Monitor *mon, const struct MonitorDef *= md, - int val) +static uint64_t monitor_get_ccr(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); - unsigned int u; =20 - u =3D ppc_get_cr(env); - - return u; + return ppc_get_cr(env); } =20 -static target_long monitor_get_xer(Monitor *mon, const struct MonitorDef *= md, - int val) +static uint64_t monitor_get_xer(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); return cpu_read_xer(env); } =20 -static target_long monitor_get_decr(Monitor *mon, const struct MonitorDef = *md, - int val) +static uint64_t monitor_get_decr(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); if (!env->tb_env) { @@ -61,8 +58,8 @@ static target_long monitor_get_decr(Monitor *mon, const s= truct MonitorDef *md, return cpu_ppc_load_decr(env); } =20 -static target_long monitor_get_tbu(Monitor *mon, const struct MonitorDef *= md, - int val) +static uint64_t monitor_get_tbu(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); if (!env->tb_env) { @@ -71,8 +68,8 @@ static target_long monitor_get_tbu(Monitor *mon, const st= ruct MonitorDef *md, return cpu_ppc_load_tbu(env); } =20 -static target_long monitor_get_tbl(Monitor *mon, const struct MonitorDef *= md, - int val) +static uint64_t monitor_get_tbl(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); if (!env->tb_env) { diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index 73f15aa272d..378967f8164 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -40,8 +40,8 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) } =20 #ifndef TARGET_SPARC64 -static target_long monitor_get_psr(Monitor *mon, const struct MonitorDef *= md, - int val) +static uint64_t monitor_get_psr(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); =20 @@ -49,8 +49,8 @@ static target_long monitor_get_psr(Monitor *mon, const st= ruct MonitorDef *md, } #endif =20 -static target_long monitor_get_reg(Monitor *mon, const struct MonitorDef *= md, - int val) +static uint64_t monitor_get_reg(Monitor *mon, const struct MonitorDef *md, + int val) { CPUArchState *env =3D mon_get_cpu_env(mon); return env->regwptr[val]; @@ -154,7 +154,7 @@ const MonitorDef monitor_defs[] =3D { { "otherwin", offsetof(CPUSPARCState, otherwin) }, { "wstate", offsetof(CPUSPARCState, wstate) }, { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, - { "fprs", offsetof(CPUSPARCState, fprs), NULL, MD_I32 }, + { "fprs", offsetof(CPUSPARCState, fprs), NULL, MD_U32 }, #endif { NULL }, }; --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769694068; cv=none; d=zohomail.com; s=zohoarc; b=FbgNagJ5XrAkMu6JIVaaxttlzyWuTgzMNZyvEHMFfpb7cgN4fMLBAamDX0aeG2W6sJnYBm2x4tjzjrpuHLX6Pd77LuchI7ru/9A+uJJHdWAftqaIR0P7aPYql//i8idkZZD2Nhg6K5q+7StljWSfxrFks9ImlqBYRB+KfzSoihw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769694068; 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=31vcExfhyxITyDpAatH4IsbdJjBgBKYHjZYCzAjc2Rk=; b=QRDhgV+dQQOhfz8DHkDmbcRdyYFOADWHu4M5KlLGFnSXVGGSw6GNFV2pdkO5mXcrTsmoxlhgyHx0lctKvU9wePd8CRuzBbtuVp0D7a+9kKxZ57Aqpld2VzLxmJ6vnKxlHwqSYOpZh2HrGaWBqyzefPthClJ76LnI8QFvzWyKm/I= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176969406814491.06662054390131; Thu, 29 Jan 2026 05:41:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSAI-0002pi-94; Thu, 29 Jan 2026 08:34:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS9O-0000SD-PA for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:54 -0500 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 1vlS9K-0002eL-E6 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:33 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4806fbc6bf3so10451405e9.2 for ; Thu, 29 Jan 2026 05:33:26 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-481a5cd32dasm4733865e9.0.2026.01.29.05.33.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693605; x=1770298405; 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=31vcExfhyxITyDpAatH4IsbdJjBgBKYHjZYCzAjc2Rk=; b=v72rBlp9uUc6nG5ir2Dm9eztV7SDDekkLt3Pw308rcbMkspaJN2yAPWpTg2ad+cxRs of+MWjCWmmKKN36kYzH6v+kT9Oc4BrvcO8vmm0iCCmf0G9WoSYniU+gVPCuQIudpPKEJ wX1U1z4z3hp9+qYKrzLphX/ydCEFDERiJM3HnDGrwkmzB+3rNVSyuhE3NjjAEZHY/0Lp OSWPqQmKbW/2T0v+IADysdR5VOZl4l7GWoDDCGaFT6rAkN7yoYCEc8HKSfdLeLvKurSL j9Ew+c/nmidgaLYi91+AXgbln3P8g/mLDQ/cbi5YNcNXkDM8b76lwy1wO+vYZUBB0Zdx yz2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693605; x=1770298405; 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=31vcExfhyxITyDpAatH4IsbdJjBgBKYHjZYCzAjc2Rk=; b=CV9eNuIFE02hT4WexB9fTONeNsi6PYKk3SjKT5/IrD4b9sn4ihCEf8F2viLCQqXT9d P54VA+m8v4tDla452STIxtihzk1srstVq+T3Z5T5uH13kT0230bqAtEEFnUlOanfmpBB MFeN9wzmlsAKBhM0Ni9p5Qhbo3dj154+EF515N0KLHRGbSsXkGu+Wcb/kyNCPQpPuQVG tdYSR7tgWyxliRcji0cZnl/Dv411ZD0TDmhUGa+8BPUIUznc2egNsdTkLwIUThDzuqml /U6+K8yE9Jecyc5R1fHkyBjCo9sVLfqoZQbb2zKDSXeGjdT6swdaq6zCRWIHN1slYShZ 2exQ== X-Gm-Message-State: AOJu0YzM22JpakkpNGRg/d59oCsviZ0tAxMZYMfoX1QxqbV8cc2FGkwa duPixM8keNgIM0s9FBfqJrykyJKqIPpgWb+2zJPm1bVyBTUO7Sb7unp1UOmUHDsXqa52nUkl849 yWqcz/44= X-Gm-Gg: AZuq6aJHDlPgQC3/I/PCjUQ1HVm+TAgRekICZ+YGdNpxSkZXn2QSQCWBSMSfGFGZOUH kLWItt6lEnU2UZi07EqFG5BSlIRDlEVwogj1vZuP8fO/0bphLGL3w0FTU1nRepmLfb6WMQM/Clu h4Vcn7juRG3ybXbVQASXE6VO0f7F+QRvnVbapOwrNcqSvppt58uC1NQ2z+Ddp7EhgaXlDAZHBhn 0CD4IP4eRmEcaVBnBSejXS6MAY8xFk+DO1qe+9dq6hOsuqpGUiBX6jNO1DLCigdE3w1zFilT0ss 7XSCvyTH+wyzLAtiCG93RO9eoVJjgIfAC2z7gyCDgkwMjw64xdEcYS7dJa8fdm/bnK+/Hs9hVgK UMlWjPFOjWF0/jF2JfMBvIrLMXPLKf59T0CReVT5jljms3mok4q88CPESz3XZ3wK5YV/gcIrBT3 L8imR+B1/gNMr0CCeIsuc4T1cWf9Nip+H+xhM+wUWLnkGAUsjZMmhWKSKFSfOSR39/vttNazA= X-Received: by 2002:a05:600c:450b:b0:480:1e9e:f9d with SMTP id 5b1f17b1804b1-48069c0e151mr95318785e9.8.1769693605118; Thu, 29 Jan 2026 05:33:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 6/9] monitor: Have *get_monitor_def() fill an unsigned value Date: Thu, 29 Jan 2026 14:32:38 +0100 Message-ID: <20260129133241.35990-7-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769694069399158500 target_get_monitor_def() fills an unsigned value. Have get_monitor_def() fill an unsigned value too. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- monitor/monitor-internal.h | 2 +- monitor/hmp-target.c | 4 ++-- monitor/hmp.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index feca111ae31..8dc88963630 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -181,7 +181,7 @@ 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); +int get_monitor_def(Monitor *mon, uint64_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 1600666ee92..5738b47bb03 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -63,7 +63,7 @@ HMPCommand *hmp_cmds_for_target(bool info_command) * 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) +int get_monitor_def(Monitor *mon, uint64_t *pval, const char *name) { const MonitorDef *md =3D target_monitor_defs(); CPUState *cs =3D mon_get_cpu(mon); @@ -100,7 +100,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const = char *name) =20 ret =3D target_get_monitor_def(cs, name, &tmp); if (!ret) { - *pval =3D (target_long) tmp; + *pval =3D (target_ulong)tmp; } =20 return ret; diff --git a/monitor/hmp.c b/monitor/hmp.c index 0a5bbf82197..eee8b7e964e 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -376,7 +376,7 @@ static int64_t expr_unary(Monitor *mon) case '$': { char buf[128], *q; - int64_t reg =3D 0; + uint64_t reg =3D 0; =20 pch++; q =3D buf; --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769694218; cv=none; d=zohomail.com; s=zohoarc; b=LdJzldn+x+NlbOrVB/fRlxbnTNNgapmjkab4DC7sB4gf7H6eG4/WDzzzATvA4f+eZihcjR45bL0A5Tj174U4Sx5nrFeHSuXayLifsmAkKvA8yYmYUW6cJaOcsBo+z6CULmFBB4kdH4G4Ns4eI74v/7LY9UrJfqPDNjI6owKwGOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769694218; 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=ohAv9/55/NIDQzfGujars5nrP2pYPm1zRQkvZvftI7s=; b=HMi0fx4M8pvF11yvuStey/SBzTmFwFKZSSMSp9VTj/58vGMN+MmAu10oi+NICyTBskWcfcwZ3L01C8oTZnro1kLbk4VgXSvYSiNVmhsKXEMuIQxAtVkWMuu1etIMKFT2XVi/GD6pPBBD7tfEgkKEbLjoZmSF8hbhBbWncCX+2oE= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769694218918173.40446075909233; Thu, 29 Jan 2026 05:43:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSAA-0001oL-1s; Thu, 29 Jan 2026 08:34:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS9R-0000Se-0s for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:45 -0500 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 1vlS9O-0002iW-I0 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:36 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-430f3ef2d37so841758f8f.3 for ; Thu, 29 Jan 2026 05:33:33 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10e4757sm15066367f8f.5.2026.01.29.05.33.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693612; x=1770298412; 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=ohAv9/55/NIDQzfGujars5nrP2pYPm1zRQkvZvftI7s=; b=AkkDOs2GHVJRWonutUHCF5G3xK8Nz4EFmAgwARQaFkssXxp/JnAg5V5sVLf9xBgYNB K1Z+8HrUnrLfvwRV0ixeqtjtDPibhKCuk+7a2LMsBnstLTQhrowuIO/xK/k3WzWEwC+x d6pcig5AHNnJjU1x0Sm//MGBVGFPqidDjTQqhhKeIMnQnnMsvVuCXpy91liOJJi1bQFS S7k8SbAJLbdbUXs2i+ujI4VRMpcMUF9W0dWcZbZRPWualKqpg4WAtAbzurUBqlaZHogG +REfvLXDQKewnmkGhmWVrTF+rSL4l4sFM3TMP5DuY96HXCkwY44IBrD+yrVNu8TkCUEF drrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693612; x=1770298412; 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=ohAv9/55/NIDQzfGujars5nrP2pYPm1zRQkvZvftI7s=; b=pw5wewhC2+OK0pFkVrrkwjJOFTuNQJRqJYrDFGfOjwm60uyMZdf2GLkBGnCnPEEUQL wBBSubWnMagDacFPOVsbZBlJVQ5dIdZ9tr9H0MwgRcgIkeK3fpJnSamEMvd9ca6WjwRk cpIPzi34UWiMjJJQOlLPki+v/sJTw/Ne5zuX66c8ar/RB8mduSO6DE0Cs1TqydkiqzOD zvWgI3G4H25syul6VCwMsXWiOcvxFXMuKGdYQkvqwYr0wg0QtiR98/fdcH025GAr3+Hk P+tfUcDPwyS2bX0iitMEfaNEcKdr29c31XwFgnDOVg6A9Dsjxorx1n55q/an5w6r8f2z rtRQ== X-Gm-Message-State: AOJu0YxrfDNPT9ZCRPNoXaSju4SlyweAVwKPHbXvqgyv2cdF/pD1lWq5 Fxs/12rsyzGt0dePmyliRCFd29IAJRmy3BM+Tl/VeTF7VIj/TLNFZqiO5b0gBYvo8eXUv4YKWPk 9r+nmQiQ= X-Gm-Gg: AZuq6aI3tEtr4N0Lm8JJ3dMkLWmYsBLklWN5s5Nt9sZSL9yWe5tMpXIO9VAuQD4uwcU i83uelMMkzKYG52mALT3BA9cxALyH+GiKQK1G0mNwZ1ECODX5gfd5dqBhT5z82jKDZKL0fP/Kw1 Lt/Gp/dUDRCEr09lOqelYBXSKGF5e179I7Q3HFAP8HFlraUkabk1YEjl7QD04WRw5y8jGD3J6Hi nzogvAITVDYzb868zPnj7z60HGdf4cDQH5RWZU/ejSUW2cRdTNtBdOPl6gXH2MoCU75lwdcaTPO YE4pPuntRqN1khcZxuKG/qLqog3mGZ3JOb2xGMYfb3KsyqhGrc8lqTd3mAth+3VcsY8p2RdykaA LMYcNJU+9P1ogAZKZ1utnek8dkiY7iM5j52jhR875Z3Eya/WjZxWO8vXJijH/Vm6Q9yJ4DTg33s mX9SGByVVTh23TRl/Hzu8vv2YIElfaOiQ6BHj78fMlhVrjOpczkdVcxQKqw/+kKUwJ4DDbO5k= X-Received: by 2002:a05:6000:40cb:b0:432:dc23:368 with SMTP id ffacd0b85a97d-435dd1cded6mr12591202f8f.49.1769693612079; Thu, 29 Jan 2026 05:33:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 7/9] monitor: Truncate target register using ldn_he_p() API Date: Thu, 29 Jan 2026 14:32:39 +0100 Message-ID: <20260129133241.35990-8-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769694220045158500 Rather than truncating with a target_long cast, use the unaligned load/store API. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/monitor/hmp-target.h | 3 --- monitor/hmp-target.c | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 6d6653aee6e..788bc9e330a 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -27,15 +27,12 @@ =20 typedef struct MonitorDef MonitorDef; =20 -#ifdef COMPILING_PER_TARGET -#include "cpu.h" struct MonitorDef { const char *name; int offset; uint64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int v= al); int type; }; -#endif =20 #define MD_TULONG 0 #define MD_U32 1 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 5738b47bb03..257605a1c96 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/bswap.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -65,6 +66,7 @@ HMPCommand *hmp_cmds_for_target(bool info_command) */ int get_monitor_def(Monitor *mon, uint64_t *pval, const char *name) { + const unsigned length =3D target_long_bits() / 8; const MonitorDef *md =3D target_monitor_defs(); CPUState *cs =3D mon_get_cpu(mon); uint64_t tmp =3D 0; @@ -83,11 +85,11 @@ int get_monitor_def(Monitor *mon, uint64_t *pval, const= char *name) void *ptr =3D (uint8_t *)env + md->offset; =20 switch(md->type) { - case MD_U32: + case MD_I32: *pval =3D *(uint32_t *)ptr; break; case MD_TULONG: - *pval =3D *(target_ulong *)ptr; + *pval =3D ldn_he_p(ptr, length); break; default: *pval =3D 0; @@ -100,7 +102,7 @@ int get_monitor_def(Monitor *mon, uint64_t *pval, const= char *name) =20 ret =3D target_get_monitor_def(cs, name, &tmp); if (!ret) { - *pval =3D (target_ulong)tmp; + *pval =3D ldn_he_p(&tmp, length); } =20 return ret; --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769694069; cv=none; d=zohomail.com; s=zohoarc; b=kNpfEYoZwkL674Mp/5oVKQqf0PzcNp7m3XSQdi375NYCABueMZmGc6lRVLKc8ihvL0vQOCmWIm8IhDpPHx3h5iJtGVNkV0vlmUA8tlVbLUu71MkXPY76INzKJUiMmR46uDhRIUhfj1G9wci36BPfvtRujWVK8/V/Tytg6RuKytY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769694069; 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=3VIB+OpBInAaNY2pTDrwIlQ5aTfArsqavUF/QiPi1mg=; b=Go+Zofl2qz54U4KwTBfpYyAg4exQQBOpCQ8K2Ci3UpN9itwMCMVT5ZJkhe1UCiMHQP0WSBXs1dsJfraOS6pMcKqwJsq+323bmob/3SeF5WjHtkHyAt67pqbj1umNZEydS3MBT35liXVGtAhoUQ4hxdJS1xzXED9ukVQ98GrzJGs= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769694069896495.5926873006241; Thu, 29 Jan 2026 05:41:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSAD-0002BI-Ae; Thu, 29 Jan 2026 08:34:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS9W-0000Tf-Pa for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:53 -0500 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 1vlS9U-0002jr-TA for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:42 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4806bf39419so13241695e9.1 for ; Thu, 29 Jan 2026 05:33:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10e4824sm15493348f8f.1.2026.01.29.05.33.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693619; x=1770298419; 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=3VIB+OpBInAaNY2pTDrwIlQ5aTfArsqavUF/QiPi1mg=; b=WMGqY7qjXHCXKBoLbyWyRQqUTmrP7+XX4xSy57+eM8lqoyXS2Y5fRbvq9iHzBtt9qj pLS8UJdIiOpcv0adFJr1sr1sJFlAPoR9uH2qygWXSa7MWtZd8i34BowtvS0qXp3FHmNj Vm9LOc9NeMnvOIO8aEfWMesbtuSw7xJupzaqZSf9zvkLblsR1kUGI0edUomdu4esNB5F 5eQI2LcoGyns/Is7C1A/QBCM5oPsq5ArpOuSnat/hf/Q4C8+xr1lZxtNU1z6CksCkSiv nnHrkTRE+OpAqIDTxUqmGI/40Lj5gQCiRZSsIAF71OIV2OSQdJKhTijmRnKnJGzm1PhR LCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693619; x=1770298419; 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=3VIB+OpBInAaNY2pTDrwIlQ5aTfArsqavUF/QiPi1mg=; b=LImbOsCjvF0SPq2DoIKY+MNUAFgCiyqJXZAA5jJheECvKgnrScMsCZMHIblgc7iuoj C3v/qAiLv1D8Zhaa01Vrl6MRxD+W1OLK6ZS/clR1PKc6/UWxSym9//ILLA2h/e7cewEP ZHpQgfQcJX2ti8IC38DO97fucc9IiZ7Zd7j9WqHdOARtBu0FQwqrbTSkSu6LAqdsKgW4 iPSNnBg0Hld6WRogvEOXpktPTnnM2H5c6iqNSN5NX6dnld7mNXnsFg8lKId9se65QwX8 Vaf8HTzFU2/m0yfc8IQTfVXuOgbaHEu5dH66cuS7mUaVfA2cJaSKplYiV6ecQsjQMtdT hCvA== X-Gm-Message-State: AOJu0YzZFCL26cPFiRRG+gS0WNkiOOFtg+kZGCF674VgFbmPK5foVkQN ImEZtGfoTfPV/A55HJ9+0InGKGhDZ/laZe18vIExiXPum9Oy5qfii+e6OUHuDMLWjmuks39qHCs 4ax3FZ/I= X-Gm-Gg: AZuq6aI3gPG7dnbYTMvqmrqarOqbhOUoobwuoEIOkzDOPfZLBea2Rs6oh5lvNV4Z+Ue rysIu2aUjCgVPCyOODg3wibit/eqcu4Tee6AtzeIOoGsyWIh2HJtZk0g0Nu/PLBXpTWa5hl+lrN 6/B8PKmKbwY55Hr8OnLCoh8dz/dvZSRi13RHLmMsfiyBSebapY8kgrfb6QExVbcJquBvQRW4f8y rl0P1ht06Z+mbiqlI0DctW8fSMTVvlQvlyxC7tBLy+XLhpfMkg6GuVF4dOWITS96H+RNfTt2lzm kLUFVHeZpR333SaUX9OoB/JyM5oDfn53wgMn3UsbtAsKP6WrkYw9tTvFQTw8lfBDicu2GPCeHF8 6cXoqYk7QnaBGNVy3qNZ3EyMt9uI4pbiR3azJCFLADreX1vOp/rmmUF+9wkRyyF9TfM9l9f+wHT 6FtKZrg/u91BrT1IxZqcHbjcHPmyChu+iqcCK/YEGmVBAVrjCn0sFt0UdBOguX X-Received: by 2002:a05:6000:4011:b0:435:db9b:5885 with SMTP id ffacd0b85a97d-435ea0672c8mr4435602f8f.10.1769693619055; Thu, 29 Jan 2026 05:33:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 8/9] monitor: Reduce target-specific methods further Date: Thu, 29 Jan 2026 14:32:40 +0100 Message-ID: <20260129133241.35990-9-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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=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: 1769694072759154100 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 | 49 ----------------------------------- monitor/hmp.c | 52 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 50 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 8dc88963630..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, uint64_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 257605a1c96..a3306b69c93 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/bswap.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -60,54 +59,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, uint64_t *pval, const char *name) -{ - const unsigned length =3D target_long_bits() / 8; - const MonitorDef *md =3D target_monitor_defs(); - CPUState *cs =3D mon_get_cpu(mon); - 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) { - *pval =3D md->get_value(mon, md, md->offset); - } else { - CPUArchState *env =3D mon_get_cpu_env(mon); - void *ptr =3D (uint8_t *)env + md->offset; - - switch(md->type) { - case MD_I32: - *pval =3D *(uint32_t *)ptr; - break; - case MD_TULONG: - *pval =3D ldn_he_p(ptr, length); - break; - default: - *pval =3D 0; - break; - } - } - return 0; - } - } - - ret =3D target_get_monitor_def(cs, name, &tmp); - if (!ret) { - *pval =3D ldn_he_p(&tmp, length); - } - - return ret; -} - static int compare_mon_cmd(const void *a, const void *b) { diff --git a/monitor/hmp.c b/monitor/hmp.c index eee8b7e964e..36e58c54670 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -27,8 +27,10 @@ #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" #include "qemu/config-file.h" #include "qemu/ctype.h" #include "qemu/cutils.h" @@ -311,6 +313,8 @@ void hmp_help_cmd(Monitor *mon, const char *name) static const char *pch; static sigjmp_buf expr_env; =20 +static int get_monitor_def(Monitor *mon, uint64_t *pval, const char *name); + static G_NORETURN G_GNUC_PRINTF(2, 3) void expr_error(Monitor *mon, const char *fmt, ...) { @@ -1552,3 +1556,51 @@ 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, uint64_t *pval, const char *name) +{ + const unsigned length =3D target_long_bits() / 8; + const MonitorDef *md =3D target_monitor_defs(); + CPUState *cs =3D mon_get_cpu(mon); + 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) { + *pval =3D md->get_value(mon, md, md->offset); + } else { + CPUArchState *env =3D mon_get_cpu_env(mon); + void *ptr =3D (uint8_t *)env + md->offset; + + switch(md->type) { + case MD_U32: + *pval =3D *(uint32_t *)ptr; + break; + case MD_TULONG: + *pval =3D ldn_he_p(ptr, length); + break; + default: + *pval =3D 0; + break; + } + } + return 0; + } + } + + ret =3D target_get_monitor_def(cs, name, &tmp); + if (!ret) { + *pval =3D ldn_he_p(&tmp, length); + } + + return ret; +} --=20 2.52.0 From nobody Mon Feb 9 03:30:45 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=1769693695; cv=none; d=zohomail.com; s=zohoarc; b=SPfDCmC4ismOncXHUDJj3x9t30QPgm20P2jfWOxlG6KDN3JQlNnn+FOMDZBzn1ZcxH1MSmcamL8KIRO+GO1ylNCqqGgR5WiGxyPH4vZjF+KMxe9iHOHd8C/zxpVi+4pc7tH03o4IBLY4Fse01PmKX1xx1f3cqsJhVrFuoBpOsg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769693695; 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=Hq4FdROzQMT1FITLEs5mQOhgWXAvATG5cfWFccAK6cg=; b=iJCxfIgdeIXRVjyx71fK32Pd7ZWE7JHuHAe4EPUw5DqdTt0zIM24BYnCdI/ui91iX/NBjs4kf+chpEhsDoXZALdMxVg330oA+4eQv5z4CCjNim9FMX3JaRnqR9Lqkt9wTeZX9oJNtu0htyvarY4eyIGeXuOzZld07ZRD+xPOW+Y= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769693695536644.7232332283356; Thu, 29 Jan 2026 05:34:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlSAG-0002bT-IX; Thu, 29 Jan 2026 08:34:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlS9g-0000Xm-Me for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:53 -0500 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 1vlS9c-0002kS-PC for qemu-devel@nongnu.org; Thu, 29 Jan 2026 08:33:52 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-48069a48629so10486855e9.0 for ; Thu, 29 Jan 2026 05:33:47 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4806cdd78d3sm133908465e9.1.2026.01.29.05.33.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 05:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769693626; x=1770298426; 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=Hq4FdROzQMT1FITLEs5mQOhgWXAvATG5cfWFccAK6cg=; b=O4ae0lXKJ1j5U5751NPYDHBRfOKLKcF42Kc6ex4wJEz5x/KwsoRJ0voMrSzoiJnQ6J L0aLN2DPyzLx0PA0a8Hv8/St/hW3lkDffxkrGO+ljeJ96AMO3gxRiwR1vxTYTxk7rr9s oPZ1sladZoGFX/zwpkuxahllRrhq89VTp4FAE/WMCVkvnNqxgTocvlztZsh1eYMDagsM USNegCWuiS9/0Lc7f3KP2334mtet8dFbLi+MqLIZmPs+AZEQK48rbpKXAwaFFUzNKMuP dh56tQfXIhUBP2wJMubDN1/wrbP/bTOf49oayDA4bL0HkX0Ys2JgWdJqDzY5z3w3Qj+w umRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769693626; x=1770298426; 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=Hq4FdROzQMT1FITLEs5mQOhgWXAvATG5cfWFccAK6cg=; b=JiLxpy7te+VF0iDZG0TgPdgBQMMERSwVDBHPjUQhvAm94H7AEaqpWozLux/jwgMgP3 nqSoPPDyoTa2vQTBfTPhaguNNearOD5KpL7YKOxlph5A67B/p1DWIh1S+GLN5Vi0ZuS+ nCz+hugAHNyE+mHzF7D5lcfJwoVpr+XfG/SBfXkqsmcKyK+kvFvGkTpWuM4mpj5il7jQ 5ppdVfJsHTKfZzmdyexoRaLz7DPe+FaMzyTUEqe1hUufqovRLF0x00VU6PoiPpFiLZR0 EHJtJVspBXKzJuWV4qWQZdNmkiO0Q+kA30oz7eKUS6/rkWsQ0VagJLMlRhV8nLHNgYwC 1Hlw== X-Gm-Message-State: AOJu0Yw0cPKKhDWvv7SBuSVdg/ngfUQ2qv0a2nZcffKJJuI3IW5Z31/b 2mNHzUVxFu2So3+l0vZKiYm6gVA7NtId/1kZNm+Dgyd4mZ+4/VeQzN0I0PGWkzSA+XFrxm8eRH3 7UuUsz0E= X-Gm-Gg: AZuq6aLYkyGlQyKzXOOhfk8LaUdGFHKGbwRwVIDKE4MsYT/u2WBFm8rLYpB3HLm8BiM 5PuJzuHbsdRe3gGByaeNB3/BrNXu9N1Oqdq/XiEdWgH3J5iDsSHwXQwQl4n2/MpYUslEGdtolYe uQA3kJzET1LWlbWNrDJDSLyGF2qM9vi07KDrJQ8EJTNAtqYMQOPRMgdBfR5shNI7DDATCVGVMcT AydCc7SsgWK8fGAVLJNNgXssmK+vEyB5eHukw3wEMZLQ++hxR+HlwJ2ByRVgATLIhS0QEBeL+eE UNVb2jVvgEt74uT/GMVoti/U7jtFs5w/ebHYbxebhEwwNN2IXKgDxg5U/X7HRWOHZxjE2OpKJBs rffUQt5G+cU/bF6HPuqeCVSZnHutd2StuzVXWvncaFpMSpl6ciM0AqT1amwi1uI2jYvzJ0J2YVb 8xb5y3gLEHl154+3fnHIpIvqSUorkJ5EujiZKDTqqOzPoXazo9sNNLiY2KN6E5 X-Received: by 2002:a05:600c:4f06:b0:475:da1a:5418 with SMTP id 5b1f17b1804b1-48069c0fdfemr119806935e9.1.1769693625867; Thu, 29 Jan 2026 05:33:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" Subject: [PATCH v4 9/9] monitor: Remove 'monitor/hmp-target.h' header Date: Thu, 29 Jan 2026 14:32:41 +0100 Message-ID: <20260129133241.35990-10-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129133241.35990-1-philmd@linaro.org> References: <20260129133241.35990-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: 1769693697189158500 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 | 2 +- include/monitor/hmp-target.h | 46 ----------------------------------- include/monitor/hmp.h | 17 +++++++++++++ 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/ppc-qmp-cmds.c | 1 - target/riscv/monitor.c | 1 - target/riscv/riscv-qmp-cmds.c | 1 - target/sh4/monitor.c | 1 - target/sparc/monitor.c | 1 - target/xtensa/monitor.c | 1 - 20 files changed, 19 insertions(+), 64 deletions(-) delete mode 100644 include/monitor/hmp-target.h diff --git a/MAINTAINERS b/MAINTAINERS index dccdf478886..f19b1362cda 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3385,7 +3385,7 @@ F: monitor/monitor.c F: monitor/hmp* F: hmp.h F: hmp-commands*.hx -F: include/monitor/hmp-target.h +F: include/monitor/hmp.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 788bc9e330a..00000000000 --- a/include/monitor/hmp-target.h +++ /dev/null @@ -1,46 +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; - uint64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int v= al); - int type; -}; - -#define MD_TULONG 0 -#define MD_U32 1 - -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 e222bea60cd..83889ab8ed2 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -17,6 +17,23 @@ #include "qemu/readline.h" #include "qapi/qapi-types-common.h" =20 +typedef struct MonitorDef { + const char *name; + int offset; + uint64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int v= al); + int type; +} MonitorDef; + +#define MD_TULONG 0 +#define MD_U32 1 + +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 bad034937a9..a85c5243a40 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 a3306b69c93..2574c5d8b4b 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 "block/block-hmp-cmds.h" #include "qapi/qapi-commands-control.h" diff --git a/monitor/hmp.c b/monitor/hmp.c index 36e58c54670..2d9f870df26 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 f7ad7b51394..3b73a04597f 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 427f1990399..1d04978c43b 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 fef9f441c61..946aecd0408 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -37,7 +37,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 1bb5012da91..c148926d827 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/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index 07938abb15f..08314e3c1cd 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -26,7 +26,6 @@ #include "cpu.h" #include "monitor/monitor.h" #include "qemu/ctype.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index 478fd392ac6..bc176dd8771 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -23,7 +23,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/riscv/riscv-qmp-cmds.c b/target/riscv/riscv-qmp-cmds.c index d5e9bec0f86..79232d34005 100644 --- a/target/riscv/riscv-qmp-cmds.c +++ b/target/riscv/riscv-qmp-cmds.c @@ -34,7 +34,6 @@ #include "qemu/ctype.h" #include "qemu/qemu-print.h" #include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "system/kvm.h" #include "system/tcg.h" #include "cpu-qom.h" 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 378967f8164..83257a18717 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.52.0