From nobody Mon Feb 9 08:05:53 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=1769704882; cv=none; d=zohomail.com; s=zohoarc; b=jYsSFJPS9iC8QDqjo1hvZ7etTTYna07wBef0yI3gtZ3Rdp/xSKsWbWRQRroxCy1xcfOutKyWHpWNgYvu/B7KO9YGoyZSr7D/8fnygDIWzTOyLZKvZG3HOTV5KkHncg/1c4FSJz385E5LjG7/C1fT9PQUPylTXUhxqOfsHx4Ox9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704882; 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=Zo2d3FeKjszu4PGN8SchfxUa2t5M9IDgEiFoOLL47Q/1OfSaAHN7m/Jj2G7jzkHHZe/fkYgWQc7uFVv5u3ZscyvPHMDUXZkeuR0MYu58fUGLv+lTedCEYpV42e1nQM8segg405TIHQfQgQcMhGLzcfX3I+7RX/xejOQV/aeknRo= 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 1769704882353410.88649281974017; Thu, 29 Jan 2026 08:41:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV4h-0008T4-FC; Thu, 29 Jan 2026 11:40:56 -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 1vlV4d-0008NE-1x for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:40:53 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlV4b-00059l-9u for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:40:50 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-42fbc305882so843064f8f.0 for ; Thu, 29 Jan 2026 08:40:48 -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-435e132303fsm15886456f8f.36.2026.01.29.08.40.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704847; x=1770309647; 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=swJR7z31Y9k8iHy7moermWFzaVrkxUf4Nlvds42E4b+JmWcUo0l7kpxTHfBoeFHLAm TA+qChGpEeY7gBf+mMRBT2cqYQ0Tbnv1JhlhIbBCC8jeYqc/1y9ose7wSYbNKHJDds2w DRn8vbsjovIFjsI7DqC9kL68IYUGm+4n4CKzb/ia0ujojLqbdgLNOtBFjtxX/PRi0GM9 Ec4QqY+25M511rlp6G2lsn+Zbb0XiylO11z1PY0RCpgXsMQ1O1q3qXGezBmzPxfkKzT7 P884+MVC6g8cwzi3/Q00WhRMNJ33tmdKBZ60myjKv2ZXQcWZ+RTs/u66OpHWw+pgflJ1 sM0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704847; x=1770309647; 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=vgCtcb0qDsdJziaYMFhVnoWKxUBcKP27KHkTl3jj7MeOVuS0Fs3+slfcK+VPjDYCnh MUJFN5Yh25n7KNFZAxXrMTSF4XJihcfvlfXLi2GgAXtC121F+s1OfdFAMAkESuF1wdcl /cV7mdeGEzNfVkRJwLi5sroCYgVrzXGlcSD1oi8ExaODd9+mxRWozE9Q/qYOlpkKfC4/ oZUyQQicKHlB++sUZNUNlrrnfc8yww+MpmzOtj7r7f/vfIb0hU7anylc0bf5Up4sMN1b GCnv8+PRWQgPXAysfwGo6juWi+FE6ZLG+sObIUNs54DIMddOneeTWYKVCRl/KYkYH3rm YfZQ== X-Gm-Message-State: AOJu0Ywi2CwBAgm8Y7yppb60num0tqV8TZTZbR0d6ExsMfeKrxUTxQSd g9mAJsYzZj8Jo4UaoaUwf3zOnqSDvdD83k//wajp4FU2h0iKa4sRaeH5DKadZrXxKlLoqBE6Qjo Yw36KTAE= X-Gm-Gg: AZuq6aKPv39rla87ifAvW/U/FH81xayJtEpfqKT9RdcV9qQDUb3fy+J5J5PqSjpyYQa L4vSXOq6YSrKJU8Z8HGn8mKovwm3WHxFpRuRgOQrLE9oWNbv3XL0GelauadouNXNUJCFoTY/26G MkN0tDx/3diahOkKh6GkmGzY7IQ2RwNx59bzTf3BHhRi1XXIgGc/RndeqxIBZ807dalCu3AwIgf I69vZdqkQZA1fp2Ghe4LPEs647pNeDIEuUnV+MtJf1MvD5GGusLMleLAZfzLpPR2JHkiRqNqbXV NGdoKRYLEXmnf/2NxHTC6RuohKwXR3vYrcdMkQQf+5IIl24kfAmly2Rx3Ue1Psm3Wr6PgQn+EGO NcBFp1Ke5p0pZP1MRU8T80F7z5va6H5N+G715uehZPRqFtSibV0egzKbs788hSESFm74rvu6quT KeXPalWruHrX+fwzhsjpvquXK7z56AqiHqzdSXD9PA6tYAamrclbd91kVoigP2Wl7CFHeyGgQ= X-Received: by 2002:a05:6000:1885:b0:431:53:1f49 with SMTP id ffacd0b85a97d-435f3aab0b0mr309463f8f.41.1769704847451; Thu, 29 Jan 2026 08:40:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 1/9] target/i386: Include missing 'svm.h' header in 'sev.h' Date: Thu, 29 Jan 2026 17:40:30 +0100 Message-ID: <20260129164039.58472-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: 1769704884958154100 "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 08:05:53 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=1769704921; cv=none; d=zohomail.com; s=zohoarc; b=oKCklRjSXBNLkxaAoKMdJOLoEFmJ4M6U+LkSneIFjbUHOIjvby1+qXIH1fbYDuo/3EjCcho6ulXe+qI1SX4ACaDAPtlzsZgKt+t7xUEAkCujiNGZqCg/7IOXDTIlJaBbfJf9LiVtgju0rPQ3rfaOgg5oiRSoZICc2QEJMFjBxHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704921; 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=X1UoOXSd345+Yrkj50EsnPijQtO64aETH2CSWFxgMNg1tP4gmqHTuK0FJU3fgUkRfpjiFP0V4DQbPWIifiyHAsbwBv3372vvBD/zzmW9iVma5LRNHej3pM93IWmlYZURD7HDIdyYvBkVl/43PCDRYwDGX2ZZDLdUKxHx16CXIa4= 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 1769704921153209.91976298709017; Thu, 29 Jan 2026 08:42:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV4n-0000Ez-JQ; Thu, 29 Jan 2026 11:41:01 -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 1vlV4l-0000Bv-In for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:40:59 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlV4i-0005Af-9E for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:40:59 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-47edffe5540so14927545e9.0 for ; Thu, 29 Jan 2026 08:40:55 -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-4806d98c8desm118821435e9.3.2026.01.29.08.40.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704854; x=1770309654; 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=hBvJp3CwGusc/qvRBR8lx2s6Y8Co7syxSgMHMWXilVflyJYlapgzVnIPt9aCG4h7zh CoKDQUjMOJ4iTxMlrN1WgTQH4MVYk7Y+vWHNpp/+aCrFOJfQLKUCX5+oG11CxiaQf3vR F6xAnCjTgJquPdEzWKC9oFj3n68TRE7z+uLVRFjcDEVI1AdrfFbrfarof3a4b7z3fDya xMHcYYgpMgo5xmIOOP18ISDTQCbPIQukSIgl7bnTJIfxwQLOv/QnYkXqrptmlyTG3vnV eVQemWniKF+hL83cJymSlJJ9yeKh52gxfSSZpwcov14K6SY67yoS+6XPAY/prhL5H2Lz t/YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704854; x=1770309654; 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=FnyI16eWnTze5q6dPCEr5DfXqtgWMMy/HnOZYmuWVuZTS1JLuOk7Qpbxj4BLZXn9jg xIbJ6KUMfLh6yq8eJqps0d8t7inu28hY1vpsMzMxRnLICSLJ5cqRXqqjk/Gfk6q2jOlW 1QXziCRIQRYMvUp7+5XjIQmr9T3zNAc6TniQ6qlNhfkgGWEd/rBf5fe5qhNFWvY4lUM2 +t3OXl4b8OTjNemjnxm4ZS6yPf60o6ZTJOGf/nD+olaWXqg+2AVQDALANczKJjZ2Uy+/ wguFojmNLHGen/dVbJHxxYklfzlYeOopBGi9i/yCpJX956ceIfVmzxJ654rHv81Az33v N8aQ== X-Gm-Message-State: AOJu0Yx8IZjHXAzWieBbr74Udao/P0xPTNd3MYdys7bhQQgrKjeNPE5a IN5k4Ge6wldGTe0TlejB9SbOA3IjCP+YZjzoMnF/G9xYu6wSr1z5BLeWuFpNV16GVQaqm5nFSgv w5XObyVI= X-Gm-Gg: AZuq6aLArKST/Em1XZIYtO+dwTHlTNflDi1fh0OS2fjy296XTWNKpPUr9p+huWk2Y3Q 8ylzA9arHL8XdeS6KN54BJR4tcLG0nKpmhJFMb7J+i97orRWAPeIyiGb4wk3YxAc8ICKXsLz6u1 pZ/n5Eh4uUTdznoOAmVAs9YcGjoLuuNpITGISyIbJiHb+l0eGqsnUhik/l0aFL6rQofG2QRfPqK kXVlK3t1L36/kMzMB+jfYQp91xoKmgvIzHUsC5uhuyb48CiPnPxb1lOkSQQsqpKiMz/bA81s0aR YEOOvoD6K3/0H6G/Er5W98e0XBOwoA3ziAzX3IaNR+U8LpqP+baanO//4FL7YMrRhBQwIrBG03p ZQSehtc8p7FkrehcgH45LLEhWFL1uJCS3D1m/NfWnliKkqZwczQIHOQ4OcolJqJGT6rHswoteRY E38LwiWQkx7BmBth5+tq2LK0YRZhRne+YWldJKpGaYyMhuReYMg8pY6KT7310/ X-Received: by 2002:a05:600c:8714:b0:480:3a72:524a with SMTP id 5b1f17b1804b1-48069c5bb10mr113359535e9.19.1769704854112; Thu, 29 Jan 2026 08:40:54 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 2/9] monitor: Reduce target-specific declarations Date: Thu, 29 Jan 2026 17:40:31 +0100 Message-ID: <20260129164039.58472-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769704923005154100 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 08:05:53 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=1769704955; cv=none; d=zohomail.com; s=zohoarc; b=mF/pjFUPoDO7mma33ziQieBQiH17LGcSOulgZL80LHeJbDo5SUjsgx/EHS4FLZ/32CJsn53y8u1jquf5E/5lV16T69wW01quVWJED4Rh+Va3Co8+82adkQZXzoPzITEpZRmE+/odfXvlynpecGZULhGD7evAttNwFDpfuvQtHxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704955; 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=IDvNWa6MNlPEJkY+QpxAxDFb57bDOVp1PReoau/NDXKRaL9tYCQUvT0Hi/jxymKwdOcVbTuA77x+6y406WCnA9bqNrdnjHMZc6fEK6fQG+WNZK3XTRTWqG9xzcqA/AVQyULbBFoVBJzfHLlSaUeyondU7is6cQXMXNjUzQl8JbM= 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 1769704955382455.94669347046124; Thu, 29 Jan 2026 08:42:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV4u-0000f4-2U; Thu, 29 Jan 2026 11:41:08 -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 1vlV4s-0000VC-2J for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:06 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlV4p-0005C6-14 for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:05 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-430f3ef2d37so1021024f8f.3 for ; Thu, 29 Jan 2026 08:41:02 -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-435e132368csm14359910f8f.31.2026.01.29.08.41.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704861; x=1770309661; 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=kiAFKySkBMrXLTZwgavZueliq/6dukSt5nYF+cLVicuv/ZAdIRwplI6ms0f8kfkzgr jBXiQ4CIPUrZV6BpTdVeldTTPKn+xWTuQUs6BoBckemQGgXn+4Qke/DV55m/sIWOxAkR XA868fn/9lSSXt6lrLvaA20abIEFzXqdAifJ4AKJ+2vuuxzjaeDZQmVnf26CLjmqNiw3 DCwKfd2N+M5EoWBYnmSbcFouH/rOa+byLlab5abgZZgj0duVB6NaJe2GMFxQA3rdOLz5 HwfPvrywWU++1uioVR4cwGFzhYSb02Fe9ZbNETZPUrUUwrvE/UTlnqP+v/iig6VWACqt yJGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704861; x=1770309661; 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=mC5CbXaGgKA6OhH9eubcbNarx5BGPxiyHzFv0MrAbxJVqqHXA3eU/4PJnD1/ERckKL 1gd6SxsdwYadp3ygNEPhj87nNsOAqfbhsrsz/+KwTJEf/IQh/LorbxghOaNLYGYSc9rh kPF2tbTR3t40fJdCB+tY4OLOCjMOQ42zJxAM02ODbAch1mrjLVDCbHXr6qxavl8OOtlr oLfVekz50iekvwKeB2DB74nK9L/WDnrA01n9By5tKYSyNccBkB7ZBCCDbi6QchLcL63+ NVwMNh3CiCIoze+9y1SF4rFipzdZTJjUnnqSdOwo9ZzqPg1E5oPKWqbEjMpuLxh8NzE/ z2FA== X-Gm-Message-State: AOJu0YwmH8qcGchz98nnNgDBdm7dnhnuszP1RxHBj9YlcJfwZ8RQVhyZ 8zjYnNSRvwaugl7Dxf1/TSAjTRT+IOFpC3SdyTKXqgSCsFcbTUtF2RFRl9iTdbwEzECc0lsY/z+ +vPYsR+0= X-Gm-Gg: AZuq6aKHw+M6SQZon6ZnNRosE7gHwVujoYcIpuDQWmS1iS3c2A6m39pVvW9eFOWBnG/ Tt+UL4vovQJeVyRsZniaDOu0Hb77VrRjA+GvdoDUvJzdzik8/w2U2T+iyVzltJINp09f+jjXRjx UH0J4/5nXmIxySe6kcGDPLZY4QFaWnpgKrKSuTDRguR+cx8zh80dDBWr+GUTk//ok0+lGDhR9k3 DxS0/2lktohxeXHE9JkYpxgz1ttSVTwH34fetLCiPBjAXMtv9gs4d3SWOcyVGumFr3mUoVn3RYy wjcLD353byruAA1MfDmnM8+4kBgBd+R0IpaD06aWUrH+a8lKswwJNgdotFMwT8NW7TDo5WrjdOY KScy+uJEHxtqHISaipF9YfiKCmvAdLliVrnV6ufnOZX6ep0MkcUsNd5eX/vz1eGp24DmCMo5BR5 +b0jZZiop9DfJO8IyXiVF8u92leRAXaeKEvB7JDKldo8G8KzIuyA2s8HTeIfp1 X-Received: by 2002:a05:6000:430e:b0:435:dd81:4f4c with SMTP id ffacd0b85a97d-435f3a63167mr302299f8f.9.1769704861142; Thu, 29 Jan 2026 08:41:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 3/9] monitor: Add hmp_cmds_for_target() helper Date: Thu, 29 Jan 2026 17:40:32 +0100 Message-ID: <20260129164039.58472-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: 1769704957069158500 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 Reviewed-by: Pierrick Bouvier --- 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 08:05:53 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=1769704928; cv=none; d=zohomail.com; s=zohoarc; b=OamF0wEXCmgoPNwBADWO+di/F2JG5LThTeSlLOdTl5Mb4IB2QtTp1bH7E8aTTAJwNZxSkw6BrtdMgqzlVx/kbZM7fxwgBRO5L/9G8IdFFDlUmqazHqNB3tWPpJYzalc4RBkDqe1vxTQh7l4n8nT39HgET/a9qXEtHylaGXM9Iwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704928; 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=HdIrcym9exdElFgFIYTautVmjWkQcIoCFcCOjhgCjBAzMySEmU8z6xx//9i7X2QDdCJe6tLPjdGmv3guf2lyLjdmMvHrfNzyWcsGEA97oIebiiuYrklLTUfImBN5nHKEn/SeS0vhKxsy6T4f+fKWOvwUrcIH9fr8lQG7xv29aH0= 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 1769704928714390.2265777946312; Thu, 29 Jan 2026 08:42:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV54-0000rL-6X; Thu, 29 Jan 2026 11:41:18 -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 1vlV50-0000pC-Fa for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:14 -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 1vlV4w-0005DA-CL for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:13 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-430f3ef2d37so1021124f8f.3 for ; Thu, 29 Jan 2026 08:41:09 -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-435e10edfe7sm15267011f8f.14.2026.01.29.08.41.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704868; x=1770309668; 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=nSTtIq5mI2EdcNH4EX/maPJ6OlioUUB7Z1Xq8uUOhZZw4lGMKzkOHYhy7sO3zDZhLG zoZfPKLC497RO5g2qbdO7Rr6emgQhw038YnA9DUUX+C7qsvKLrhoSon6QsrnmPDz8ZN3 jGWWawK8CjYKoeb2f964D143MzAF6trorMRIPfE//lVH6atYvlbp/WxXS2JsB0cwBXGm CXggFqdFqtYpvB40j0tazKoX3WfvnyyESil5CM4ew82uAfzWBP7cTxrP/5SussPBa/VX edCUk9rr8Rqb6MR21EEwODZWMlCvTmhHtdDMG+/VljwDYtIU3X4ywEQ4Jy1Hlnv+e/gd uRvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704868; x=1770309668; 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=cdT+Mqtf1On1dCbKvKwaXHk3miCKWR1D2GBBlj0fx1l8BUgoHGReAVa0kJI9rYr6hB pBd6k5mBje3Zeb0lMov0X8/yaOvnVKpxMVOLmsZYVzMCFoOVLdK6kjoo619+oi3wpig7 KKrbyfjgouZKNdWvFItg+R01Gzcx1Xaw6jLtDol5uuQ2+heUzuP5fhDFxNlzEPLzWYjf nduxxS2qe6XApu3iDzbFwTUb4+Fo4MSjSRzGsZsRWb1sgcXLTDVq7NHN+QKHfbjVXrse OFpEv6vK9qsEHPicnmQjnOjNZIxFtW/6vVD72Kc0HWU0WYbdx7zfLSBqcVX7LQqJCla8 y/ng== X-Gm-Message-State: AOJu0YyGJUBLpaYnkZeRWaAeS7IjYGyO4sFAd1c2fi4s9nILqJTabQqs ZXeJ1Z8LeQYIHUXL8upOsRjNXNrD51WEMdZaficR1CXBcVxxWx7ImjukuzcZ9ALUK2ITBj0BN+K pduugSV0= X-Gm-Gg: AZuq6aID1coWJNKwMgYuXbkRoOLSfngX7HDsFb2+BbjGQ9qbTA8OdL4SwRyA6kJu+YM SHUXUT4VxTCdbF5On42+ODa92k/UOuq6VNCWx5R5yro8T4nSgZvYieS9MIG3zEpaYMejNBKT5LS JsAwZUpYsx6lFdTTfKXm6xF/LSJoVT+6OSN5KdqojFn7ZMyWJDelc8KhBtxAAsgxeprV+hZ/8MQ +AHEUL4TTSJAjKnBCgFR4uHIv/QJ9cdAdzCNiSJVwS8sB/lOqljGjQUJmGRgLa0qkBDJ7zoLBCV UCmqtcmpLmJ4MxN2JVQWJVuG5RYM5n1DlLQFc2LUoYLlAWCfowRj4fM6HDhjUxwgWQevsjjJMMf LYfymG99Ezngg5bvbPmoMhQD7/xQW/XHUr0jCJIE+QkKQgHB0JyO2C+AMD6XWOrlWAbxz3YE0Mu O3yrJaPjCsZZmKnzDL1ijHDpfPg3/oNa6nOmEkVfVHK8feS2cQvd/kSn6W/jpqDXGBov/y0IQ= X-Received: by 2002:a05:6000:3112:b0:435:db9b:5882 with SMTP id ffacd0b85a97d-435f3a62eefmr264688f8f.6.1769704867997; Thu, 29 Jan 2026 08:41:07 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 4/9] monitor: Reduce target-specific methods Date: Thu, 29 Jan 2026 17:40:33 +0100 Message-ID: <20260129164039.58472-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-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: 1769704931058154100 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 08:05:53 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=1769704899; cv=none; d=zohomail.com; s=zohoarc; b=Mgv/etxrlhA3/623PhQh1uLok8Nd0cYvsJOw9v9e+wI6XWUguA8YVEIWkOpZeFCxRmsg4TDL6LmEVsl6dVCfqzG/mVY1AbqQYmwhneAKI5AN98tbRvHFNEFs19Co0LNAd5L0yZfiumzAauWRzd6lU7TVi7JVxOQ/PVh9tTXK9CY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704899; 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=XjDxs9dzPKbxH0VGWTWlbIYeQ0uW6YxwD8bCX92DJYOTKqZAg3DaSQi0nQPk2WTB+vkirrrPKt+sXZ5yEYMoHPkL+4TfelUSvqAl6+XSMPbS3qkoaIyPVT5JDHxZy2WckJytVZVFkTAaRqz+cH5dh19g955I0qeHdU6E9GWZBL0= 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 1769704899330846.3470357259656; Thu, 29 Jan 2026 08:41:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV5B-0000xv-Q8; Thu, 29 Jan 2026 11:41: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 1vlV58-0000vC-3c for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:23 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlV54-0005EZ-3Q for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:21 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-47ff94b46afso10738345e9.1 for ; Thu, 29 Jan 2026 08:41:16 -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-4806cde00e8sm146475515e9.6.2026.01.29.08.41.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704875; x=1770309675; 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=fJjlxiTRewpRQgXskZ0pf4WljIYUslMD0BraJt1rbuKI01oSu4YO4xoStjCuL/wULF S6VJVS04MC1XWGr5H0rtoPLvz358kCRZ41hW/aWDo00S5EztKPxkHO3xFyXluLpChtqf yvKFLLDbYM9Ex1S/gm6Scqtn8tQhfgGw0J5TnvctK2cGoo/0v0OZvz9IV7YCEIk6JXOU FNTIpuwwj1OFvo+qZsvNX5+/zmMF3G2c0VXmy6Wf4YLcaGOvVXRUaA/J4rx88jgDPmsc aLm6fR4Hkk2byBPEmUiSiSxHvLQvpECQVKMMvaFntW/4TtuXovNoLCykpIa7CXCt7HQJ aUFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704875; x=1770309675; 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=evN3eJzmJtt4I3tBH80VOQ3xzHGbGfu7wxMNEx4jOJb+MmQXoKG/F94+BuaMQx7SDX TeHuPt+Df+kbcNBLo20ldvPUPjyHdI33r6j/cNem72OycTvVpUxO1RkQxjKw3NbLcQ/w z23/4eyDKUuE1yi6UQRfS/3Aa4LpzS+O8srYXH4c4qrbMyl/7sD0Lx6q9UMF+XHefMBs iUZ5QTxwebf1rM8PCxAw0PdLhnxELdioqL71tqcuLcHX9eobA9itQa5mHoetv2xI25Yo N/WHc6V4p1YeGxrogEZe1DzYIAMccM/Wrs7xiaumb6Zwj48njk05UJbmtM5xn1+UlH10 P+qg== X-Gm-Message-State: AOJu0YzHv90T3jv/2e3zS79wpPLI2HWzRfzXcnLKO5x8zbDO1hN5kmOS Vr7hO53GxwR8Mnyt9edSLooJJzHPRavq1RuZkbgCv3MZoMOLaF+rtXZbRDt+sipn4mLDLJh4uQv WfM8kHtw= X-Gm-Gg: AZuq6aIUe/14zp20a2cJaKj44zsK8uqJc0RwSEHspfJRALyVflzEbscMrbl+53iHagu 6/PLsjeV7xjh5i4YGivQGvsmc1ptUfXJVhsNnlj0eBzgmK7OErnA1gUONMux/sXItLAwdLS4fHZ i1WXjJ7f7eYd6QHxMPPdlI/2G7KC8fA4G4MsH7Ub2CJJpEMHuMofVGvQCjbP/jsfmimw+hzmK1S xTEm37r4gCCu9CM23MAwLAWN22pMabfPc3A/Q2TGYax8nYtdpYfmbW4ZBPxX8DigfFCeqiuhhLZ d6x8Dt2bGhQ0JH/c276mPcTgMESEGcIneMgh12LOvv1wrJeE0Iuyx6ANk4lIQVp4aib41EBo63a zkPOdckM7jJagvV8uwQoSK1KnaJV9yfQAe+Yq6vo6NBif2S8/2Sr+1er27Kft6iArBARjiJQsl+ MGj2RbwlhkmQjYcVJzKhlm87ru8iBEnEmgFXcMCVCSvlGO/L6rair4iOp9zecb X-Received: by 2002:a05:600c:a10b:b0:47d:52ef:c572 with SMTP id 5b1f17b1804b1-480828745e6mr40202315e9.1.1769704874775; Thu, 29 Jan 2026 08:41:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 5/9] monitor: Have MonitorDef::get_value() return an unsigned type Date: Thu, 29 Jan 2026 17:40:34 +0100 Message-ID: <20260129164039.58472-6-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769704900997158500 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 Reviewed-by: Mark Cave-Ayland --- 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 08:05:53 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=1769704919; cv=none; d=zohomail.com; s=zohoarc; b=bqRaR+31rG3Ba/hSY4VoGLcxqAdQqbjMcc8C76eZd7xXm5GnsmWISZT8Guh2OCIbzjqmQcNXuUx3+aIpEM0VJXVMc2YZXfYHD+Hnq/WeVX0AEJAlbINIE7r8P5q/n1B2zntAmOArLBSRce5tlQ65a7XNaATjA8ilt7UhlYD1Qq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704919; 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=QeB7JsxBVO4FOinrZuO7dzhUV1KOxo7RApfP3t7zvB3bIucUZuWqn0xVj1gE6NqMsw+XTvAPOQbyBxu38AbYzV48ElGArcFuxO1F4Zsffex9tnzI7ZPemoP1HiJXHAbIXjwjJoi9pmCBN2nClul3G8HXiSX/5ukk4slp1blFXr0= 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 176970491953417.578677647135237; Thu, 29 Jan 2026 08:41:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV5F-000169-1d; Thu, 29 Jan 2026 11:41:29 -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 1vlV5B-0000yG-Oh for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:25 -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 1vlV59-0005GY-AT for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:25 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-48069a48629so12476435e9.0 for ; Thu, 29 Jan 2026 08:41:22 -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-48066aaf235sm197783265e9.0.2026.01.29.08.41.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704881; x=1770309681; 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=D7F1/3UTHtGBHvFphEKySINqBVR+MCDy71a9/iuIV4YkioUmpGeAqixFsxhIi9H1YK F5OmQOulwSzx+h8n7mxfqbt0DubzEGjl+IZD8NbFyivYj1my5u/9RbdMLWr28lpJVe63 CNw5Pt5zw8xd5TQNP/LkeoTnGnqcRjMqBC3lDxFFV/RaYSO8P+R+LRvKuc+6HT7dSlCx w8mGHJTG2iaJs0C7rQh1kYhtEBe1MoHOdpR2GKHqy9TBUjWJFQlGgcDzDUBqNCstY3sG 52m+R4DUPXJBzyl5JDCUTroTzn1DxapgvZOL2KD0jNh3E/5BacCIF+eawHb0tcigJOD0 HQ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704881; x=1770309681; 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=ui5xkZkhcr/F12fiQA2pT6+Xsgt5pI+FtJiReaOr2yATLBTuXZ+IXpW8TX3koKytgs 7ly/K4Juz+r+SVql/uyrPRDgz06FKii7E/OrgAmJWWv73HsQkP1AAVtQiHkey7Kmptd9 1lMr5x/94+FGWHj65T5bZixJKHbQwU1JLDP2KucGyr2FaLzB4qHKB45MZfTsLJzjzuzX fYwV3P9RsWb/Z6oC/jhneGbBQ27axt/TSwhEIj0xS9A5f3JjPFEHoVnmztutJccO2AxU 6SNCQLPTdhYBufzttVcWf8+Srq9Bpv4dp0HfqZCKbyNC2GAS49jGe/MunmRC/GsjzW8P Pw7w== X-Gm-Message-State: AOJu0Yyw+snZfc6bfqV+WOjwCGR0zgT6WdEA0fSPdvCyQDl2wuJnS0Ob H0iahIOoGgeG8+KhAjx8k+Del8X+cNqXB8zI+q4JXE8nugiS7nhFeNlhxBoQIfS/1068im3jp6b K+kPc5fE= X-Gm-Gg: AZuq6aJiQsZ7K3JzwSj9qfLPPV9W8QlNYMXo2Z5XyD00jhceRcj1b24hN/LRN9wWPAw yP+TUwZIQD8PA+6uYZ8qXIPWdGppPTGpVRmKLjCtW1hR8dPXV3CnS3IkqoaC2/kqibtdx1ch4JJ 9GZKlRf0fTHmAMQGjjzB7Vnbm+Y7OATEFeQTkgBW6evqzvbjdMHz+UlaTCnl/6qv5H+wFn9JDGY HKPUZcsz/f0T8y5J8aIFFAEnG9KSIWSkiydMZOVcc/yVDv5RGn8q8+6TH4D2k5RL95ITeAWkGkD YAG7smLJnUQRfwf8mZ4emKphhALpvaTmKvs8jeWAkh9w2J2NbXGZqUI7ndVKnTtAhNONYVsAwHh rZ8jfFQYVsi34YbDCKBINEKwGOOkQDgpjM68ix5Aq8mXEQYUrxa/BC2/14ryne2HB+4BQhUI/Ai Hj/KBrk57yaqG4LctEKUagqU0GRQRSaXozQpOt+dFDM9FVtcdZhiMaaZqV+TvJ X-Received: by 2002:a05:600c:8211:b0:480:4c45:aff5 with SMTP id 5b1f17b1804b1-48069c755e6mr104928215e9.34.1769704881533; Thu, 29 Jan 2026 08:41:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 6/9] monitor: Have *get_monitor_def() fill an unsigned value Date: Thu, 29 Jan 2026 17:40:35 +0100 Message-ID: <20260129164039.58472-7-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-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: 1769704920953158500 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 08:05:53 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=1769704918; cv=none; d=zohomail.com; s=zohoarc; b=G3A9ffzDrMl2xsAwjyraUdR7LasF+Qvmyj8vKmpAJ0hcM8YsONeNZi4nsTbVQ7oWkPEG0EYV5wrkETZlRvHixMiySZSJ6ZE+IVY+Dfi54Cd4dKzobBwIEYGMAJpOxThK/KyHSe1ipXOX2dkIbJRMNmGTpipkOPSUGwofx3GOY7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704918; 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=70PrN5oP3fnguScyTi6SybftFcNtq8z4NK4DbniE0B4=; b=WVNmkygTtirjrYV12twUHZYGQpIFQIehhy/PrN+uLkKtFShOFe40eR/wHRPC1RKE/u5NV9XhyeWawfX1WWPtzXKFwayZOPVh+M4ziqTI7yOCFmhid7Q6e6TWO3jsWneq+4aAVPKeDuwKX51BD+phYQZ/OfRKmQKBG7AYzS6GisI= 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 1769704918525173.10828204437428; Thu, 29 Jan 2026 08:41:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV5K-0001OY-4C; Thu, 29 Jan 2026 11:41:34 -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 1vlV5H-0001LM-VN for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:31 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlV5G-0005JU-Ev for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:31 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-42fbc305882so843441f8f.0 for ; Thu, 29 Jan 2026 08:41:29 -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-435e131cfc9sm15677547f8f.21.2026.01.29.08.41.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704888; x=1770309688; 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=70PrN5oP3fnguScyTi6SybftFcNtq8z4NK4DbniE0B4=; b=cXGQrNyVkCoxH+PyI6SFruOaSxxJE+s/sGI7rtyDvGR7sp1+eESAo9m7h4t0rTJqFk h1Fn+J/f7ts9RuLqWv5iWTUAOL8p0pbYVXnW9t1DeM3+L1PpB2ZO1wi+umbDYVgF6xRc zwp5TMysIjJKVbbHZvewU+O9oadTzg1MCVPMq1ndlQ8cq2HUl8tF4MFXJhn6oadBq8aF CUo6r008/6FtUNOh0QBRbCyiFGU9lVQIU4dmiugpJkalwLtnn5agT4q8zk5kGU6FNTF9 xtb3XAWBVjE52LyNO2tjJwuA7m0REXkO0k8kr1xIYEBC+VQTlcB7Igp0NXH62Umqr7Rq FSgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704888; x=1770309688; 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=70PrN5oP3fnguScyTi6SybftFcNtq8z4NK4DbniE0B4=; b=e2/Jarmc4eJ5QRdvPZkO89TaCFVRRPeFsIQWN/5uIM2w1+XSY10C2N0pEgDLZru4Ad pqDbNomhwNh9rktHWQ5YB5g+DawNBlv6uW97AIKkd3UnqV0/b17bM3CspUbTUs6HBtAW GhyY75rp/45HW4iyvl2z9Zs8SVbMQNfp9t9r1++dAv3TwbWEreglsASmu39/yKYhxlfi 0RYaBafnC2uyMYS5nMfl9s/SjAiLO9+o4ieLinemSmmjtnCkHohkJ0ms2B47NQLz1+ZD a0phVxz03za8HpZ1dINolb60hzvjcfA8pWZinUxaLzhtGJ4AjrcmhT4v9ta2Na5aPm2K NZaw== X-Gm-Message-State: AOJu0YywHbpPQLV+wGmRRFavIaRlNdqyl5YRepJA8S4o0AoEXTM94Saw jkVZSNcxHD1b5F7XTrOF7z3QKfifRi0syH/Vez/EuZ/crCN/88uLdPk/iasz8G4txm7zJFmpKLh JgzotheQ= X-Gm-Gg: AZuq6aL8Ye9YQoBvFPAw7u2yVcGoOSWhtP99UxYef8i6+AYw+0OZQpyah821xrnd3kN kTvnkbE1JTIIJ1f2mrDyP1rSrZdYsKr2z8IAnQV+8shnV4n9fmVVpWvu9aETPjGdXi/ZHpf+fDf OuPIDISQjo2W2i9d64/I9uVZcBEXe4uow+hOjwtH2Zk4t9Ntz6BMBA3fdB3s9JYwfzUXdszv0LV lWKp7ZF6nqRtBDI9pECLpyukIBP0vRk1NjZMvYZdNdO53d76/Gjy7y0dedJOd4fLNnOTwce1brp ezjpXc+TzsmeHFkjvqRnbHHjdsyQOZKYcf2J2B0Nq2a6i/DFuwb4c0FR5UP/5Ovq8rEdW7YrwBS 5PsvfQS2sREp6fFLT0nAAbhyzLZdp9cx9NgBxsfwFzfnpUj/9whn/i5uBDW87NylhguBHEB0+Hi u/xuegzXJHdzcIMqp2/0sy6iV7qDwsrFOiw3hY8+A2SJjMxKP7wlonl+z0Ur9D X-Received: by 2002:a05:6000:2dc9:b0:435:9d70:f2a2 with SMTP id ffacd0b85a97d-435f3a880edmr334811f8f.25.1769704888205; Thu, 29 Jan 2026 08:41:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 7/9] monitor: Truncate target register using ldn_he_p() API Date: Thu, 29 Jan 2026 17:40:36 +0100 Message-ID: <20260129164039.58472-8-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: 1769704919238158500 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 | 6 ++++-- 2 files changed, 4 insertions(+), 5 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..4472c122108 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; @@ -87,7 +89,7 @@ int get_monitor_def(Monitor *mon, uint64_t *pval, const c= har *name) *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 08:05:53 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=1769704926; cv=none; d=zohomail.com; s=zohoarc; b=eLzR5+35mcWa+OBj+f6dMOPTTUSgaR4sa+tRSTfdlMWXCFXcTn0kMNqXOkqEIMiKxlKPb9jtYf/yU+qpEHo+8j2NwI8u20e6jhNO+kEglPdC2Pi091nuftuWur5ToVTKA7lQ8+9fXfL9n0iYKbXiRRKYc6Dth7hNGuraYqsf38g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704926; 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=TGK+LI5OV6mWFPj78RfCGcDXkjf/Lbx4vCU4mtQCOqM=; b=JeqSRAa/Sf/w0zwbtex2rPQVMwxhyqg4fDHFOfDVSubcJqbdOhshYlYrD8C6Vrz4MMiWSL9TmiWXm+vP5KkERCEnEAFjKFj9YYSr7hv852CUcI/Ue57W+RyAOk/51R2P2HdUmI8B8x+ZMZplYHreNYmwxJ+N9036fVxlM50krro= 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 1769704926968414.36285517907277; Thu, 29 Jan 2026 08:42:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV5S-0001ge-6H; Thu, 29 Jan 2026 11:41:42 -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 1vlV5P-0001WD-OA for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:40 -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 1vlV5M-0005Ls-Ow for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:39 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-47ee3a63300so12115135e9.2 for ; Thu, 29 Jan 2026 08:41:36 -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-435e131ce58sm15512664f8f.20.2026.01.29.08.41.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704895; x=1770309695; 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=TGK+LI5OV6mWFPj78RfCGcDXkjf/Lbx4vCU4mtQCOqM=; b=bwKlAAa+QM9rravqGs4+d5OkPEI8/H6fqdbrXMLpgLRTWbasC/OnZ14UIHP4HJcW/W UfWjksDL4qw0IgFGOR+niOvX0NJ6XJxpv7VgdZHgqk2H2cLS072DEu1hYsmZCHWJlfek QFdC0czGANCHEWNFRBfywWakhPL43lo7MyN/rcMIp29GxzqEbd0P1ieI5TVCCKIQuG6f mpHm0dpM4f7NWtFJl6XRYJVFeT3uLDdGbLmgZtbkG20xu8rGIvC+F/AfxikXyLbbKvqq 6o6bqtLolHZ7g5aKJYvXoA8H0UuDoE7qDcqLNpVcy9m0i44K5Y5a6tvAGN1pULriJYTK +N/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704895; x=1770309695; 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=TGK+LI5OV6mWFPj78RfCGcDXkjf/Lbx4vCU4mtQCOqM=; b=ZnH8fsPwjEa+jqc0XNkqgIDUflW2owi+46rKjXJk8E3+r2NMIIGGIEDBsobLVfbZxg gE2BShAXZkX2fsJj8BgRWfZM35GbdJRWVWKLoCN6/QlQZDfrwrQnGRMs/liSyIimV6mW uMW4lKb2ra77xRA+UTuNL6UHhhXjG4rdVMgHkJBgl53rg26fBxGh9xtb/F0FeXfo3xMK Ml3BPwJC75R6DY0SMllgeJnhxU3EOS5Tb6ZNzC1G2c4wmWOxcZzXZDtvohadtkGGUlOk jESCCFJdExbIRVA1B/KhGdqhH75jNyEz8KDIr82ylDrfcQdKIX1bJ9SehGwMxiWxuhu/ VI8Q== X-Gm-Message-State: AOJu0YwbkTxWzWa4aT/BcVh65QhDm2HN9+dg3Qx9x4kt7m4z9OF/bxEm Wve9d5I5CWXi48jZ5WeBXiSQn25N2P/eqUN1M2O+PUiu/tMDDfqN0UXTH0iT5mvPBJ6qPhQpq/i hiDHTqps= X-Gm-Gg: AZuq6aLE3SyHgerRfxpS6RzcITJwTsOyB+OHDoaLUUCIPfzJf66mU/ZOcJAbgL0eNjI sdM3lzITIQ7nJxUBHrQfob91R9ZwwSwYmNpPcRTLtRNdla7+kPfNqOVKYpLD+qosLEIW7o10aeJ vr1I0Li/AgPJmqZ9fYKkXvtv1Fm/TMG5P8/UbwHyNyylQNbQLff4qXtMeF00ksXNUkYakC47ZAQ LVXrmBZTeaIcO7B8sXlURyWXaisIToZhAx0423PdshEchVEaMbmQso6lhPJRcRrK/htOr6JvWGF ywoRUTgjf9xCXAqecN8+wxOfVJzzCkt9TBQZNFmktZydXtIYELSHgWTgKRYqGKsMvVcUtBKIccW yG3PhdiGo22ule/bTjKBL2YM3NBWPANV8eCoxZmp6sy6JjFEMtQBl+7uS5q7fsPDysiokLAO2ss BF8E9miOnZyEffkelQBs7EtjGGhPDlwg9FoKOShJLIfmDOkAC8jXNjVOCjzGqA X-Received: by 2002:a05:600c:6989:b0:477:6374:6347 with SMTP id 5b1f17b1804b1-48069c5a2bcmr127602175e9.22.1769704894952; Thu, 29 Jan 2026 08:41:34 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 8/9] monitor: Reduce target-specific methods further Date: Thu, 29 Jan 2026 17:40:37 +0100 Message-ID: <20260129164039.58472-9-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769704929059154100 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 4472c122108..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_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; -} - static int compare_mon_cmd(const void *a, const void *b) { diff --git a/monitor/hmp.c b/monitor/hmp.c index eee8b7e964e..bd6a097dda0 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 08:05:53 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=1769704944; cv=none; d=zohomail.com; s=zohoarc; b=b4/lP6tQOpRpWzeoNKzkXDyfBQVukrkXM1u41QIGSs5kXiQWVQ49Hf5GOZoF7YddyHHhT5XF7cEnL89h2GuyAsdncxG3D6Rdqr7UZSnice8lGKrdAoNkJJ1w7HcTaBnDF8n4Ui7YMgY82tm/iKt54fXAAFvHPyNB8xLAK3nBPlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769704944; 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=hiVr0sTvX6P08TAJDFAb0RhLOJVpGzBeScXXXQL0X0E=; b=LZsjtuWGnzYyyWZczcdHuvCevmQwAG47O45tjphNFo+iciPFX+o7dvGSaHn8BbqT/MoHow1qMd9oi6+6T7arDH5Qwg7HA0WLtjYzwLblxWQJLhsuSMK2/ytUVDEN5hLStyY2ZKFj/Sczk+Ti8sk16azkKg02DSVNUtGKEiSjlKk= 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 176970494470061.33532687234651; Thu, 29 Jan 2026 08:42:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlV5c-00023I-2Q; Thu, 29 Jan 2026 11:41:53 -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 1vlV5X-0001of-IS for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:48 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlV5T-0005QE-Qo for qemu-devel@nongnu.org; Thu, 29 Jan 2026 11:41:47 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-48069a48629so12479845e9.0 for ; Thu, 29 Jan 2026 08:41:43 -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-48066bfb59asm193357825e9.7.2026.01.29.08.41.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 29 Jan 2026 08:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769704902; x=1770309702; 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=hiVr0sTvX6P08TAJDFAb0RhLOJVpGzBeScXXXQL0X0E=; b=cYFO1sZEH1mH0SidXGhHSgkFf+252YtkyrWosW4oxdl5h2vQiaIyowvYKaYDqCmieW QF8RirwCBHbnk6xFRU9ky+3q2y4qnr5org3DY2bzjizA5javUgt7rFmBppBqJbuTlx6s Dp1LvYmkffWajzyIgkjofdG6m//gaUGuPhrfO6NgpZedp/+K79h9VBczjb1vXAGhxou+ j+ICTuPpV9nMJ2XrgQvehH+ZW241wETpaMrt8R4rJz9m9MM1DmE03JkKilYBzs2ra3Bn i07RlIUYXPAb9fzgcNtSOXw462StyDwt3nZpiZI5w27gJ+l//LVF/RopeXwEJ6aDzxqB nEyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769704902; x=1770309702; 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=hiVr0sTvX6P08TAJDFAb0RhLOJVpGzBeScXXXQL0X0E=; b=V3FpEXhPka22yJb7e5iDPeukHtvvFp3Nne0F2hsGYBy0GOBYVcRqQ1qET/1goWeGfb O3hDoecyPnx3xFiLmoE4Eedywm9Zb9GPggpxDMqXxl9oX8FgN0Ux/3sFnAnJjIeSo88J nxeSASt4wRU1w3brQ59TCgL862/N691Auy53tD5OWMQaVC153T+4BZEbXz4GBvnuGyj3 G7WIuH1F+JpUYEoaXj6GGhytQmC3L3z6Fhxgo56lllLXIGMBBoM9/F0szq8DD/2OCXiK BHIvEbggFFxb4zPDXh6jtN/XCiMa8J/Hg5UDN6lZvdkVuv75P4HDuv25HK+aiwwlG0j4 hIGQ== X-Gm-Message-State: AOJu0Yxtcoi94q2OORGv2bymaMb2QzCheOzvihM/YKdJPFZdDbmogMJ3 wogl7koY/jUeJm0KI9MZDa2kkHXSK0V+AnKVBx1ZHZnMsXvNw4eWbnTq1+hJVSFUwzYfh8Tg8jC A24nyivw= X-Gm-Gg: AZuq6aLgIXxYT+41Sp9hUf5dd8j5mB2LZuUN+jjMZB1xh4mmlcLb7eL4e0+wydqoSWe 7j+RphICEZLF0jHfiwq5HdTs8STkwivde45uzymj6SGMwAsdRYLnwLr2xqZmiEf5ru+3Ecj6FUw K7F7ziXTO16TLvMOS+veLzCSwe7YfJlWv2g5UFqPPjDnB8F9MK/88Juqfp72mvSCsWGN51SHAy+ oBesZaAULLwOk4U3bVcaB9HC8vSp6TD0JBfI2FxufvpLU2Rc6jZ16S2iqPiqnj80zgkVStumyjH cWZ+I0iG/wZUpXuW+9LNDrq5NEzNnRt0peuyB2P9Jc4/a1EC4XZT7cAeN/hcKoDS2H0njmsAxtb E5Mx6T3ciZyqMMV9LHjT/wyjo1+MyK3rXtZogqsuYYPSeutDuu9T/ulYrmbvAils9XveVmS2Wnl GGQCUcemiLq+txLXg9sbg04gzPkif1BlKPsUvgibkJ+ET1u/FDRNwQA9AtORJ8 X-Received: by 2002:a05:600c:6989:b0:477:9ce2:a0d8 with SMTP id 5b1f17b1804b1-48069b9de7bmr119949445e9.0.1769704901684; Thu, 29 Jan 2026 08:41:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org Subject: [PATCH v5 9/9] monitor: Remove 'monitor/hmp-target.h' header Date: Thu, 29 Jan 2026 17:40:38 +0100 Message-ID: <20260129164039.58472-10-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129164039.58472-1-philmd@linaro.org> References: <20260129164039.58472-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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: 1769704947221158500 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 bd6a097dda0..85577c815a6 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