From nobody Sun Mar 22 14:22:12 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=1773997861; cv=none; d=zohomail.com; s=zohoarc; b=VUzFp6b/Z8Fzbr3F+lCd0Y5Y9hJU+9dNwnuLnN8/15RAAaEUKApAqHrbtKLkRyosfrUnXnWsuVO9DYkn7ep6I4+HfXwZ5xloXUNtJJJQsCBu3zlomNQaOGFxyMTrxyDTm0ewp9HKuiowHtveOiXxABCUQkX4BTRrm6mCYox2z20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773997861; 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=sv98Vp0Ut573GNvv6G17UiqXbw0gx4JbJhCfFG3N2Hs=; b=fhmjlpnwSizScUUlVTd1lNvC1ARhKpkvCfHzJ43eFl//HN09WxTKjKmwPzlfLlvZI+3MIChVErcCjhz6NCDkZb1OSs38/3oYDzBDpZHjAQZjci7Tpk4Z5fvu7HlIvcNO6seIy3iQ3J4iKQ6tnr/r2IyjnhUL7pfdWe36Wi+zcCw= 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 1773997861662739.4473221402047; Fri, 20 Mar 2026 02:11:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3VsI-0006yT-H8; Fri, 20 Mar 2026 05:10:34 -0400 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 1w3VsH-0006yF-7z for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:33 -0400 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 1w3VsF-0003eN-CN for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:32 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso13790745e9.3 for ; Fri, 20 Mar 2026 02:10:30 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe6d91fbsm47001445e9.3.2026.03.20.02.10.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Mar 2026 02:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773997829; x=1774602629; 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=sv98Vp0Ut573GNvv6G17UiqXbw0gx4JbJhCfFG3N2Hs=; b=Nxt2857pKfEO5wVZu9fgvFw/DxLFq83ynMyp+eBL4jsRZfstT8JEjaHPHwQ87yOA85 8E/Rwc7kTUaUPh1axqmO3swqT15hZYtm67TfyCETcrEP9XEOs7LhKc1hq7NGT5PkxOuM yvB+qsFW/ygEjTbEBObXp0ScSwHRz1Pv7EGvyY94j1Ky7zBYci6i8ppzWJdokimzFd+l 2IVmZxfs+zjwnE1jKQGduyqfXieTUwCjtjFqbCtorkwFFC3PltATju6iyOebPsZPXhDb 4rnwT9cDVF79XpHHXuPGFU2/Q+kS7gT/yHRo3rudZOUrXtPHZciNxpanl3PITuuoG6ip TBow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773997829; x=1774602629; 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=sv98Vp0Ut573GNvv6G17UiqXbw0gx4JbJhCfFG3N2Hs=; b=ssWy0DYUx3BRj8+29KMC6eUfcWl2el4al7ZniYALMYLkS2DIJjdAA++zVWF5jCA74W QHwxechb9QREPnkZDy6pbthQ81Gm6MTaXTTtohqcaefO+C8EqthRy2lPvWA4zPINLhRY s7yv2WrTTxmoRONk/khVkJGhE743gAwY25maaPX54vJyz7nQobNbWdYENnF+ndVg7lm7 lrewyKCcMmXhj3g05Fd2z5nHkD2Uv00YPTRiz5b9S0NFR4yNvlOVS/V8Np6CqeiuoTrT cWO8hP7R+YeXUPcVaPN463Rv1G1ZznGQq/yEb4+ZFQ5C+Zv0ew3DDj65oAZ37wr1o/S6 em+g== X-Gm-Message-State: AOJu0YwB5UamQoNTwKe7JB+ocr2uimwoF95G7YkC99kEV8q4SlnAq6/7 aaPtTFBKCFc6UDHcpiigpuwW8V6gzHda/EEr7yyXyR3Dtru7zhA3vf+9akvVdiT+6D4P2V8yl0/ s79xzfGk= X-Gm-Gg: ATEYQzw1dQ7M/3R4EaoyYvgCvv5Wn0f5PCleyKwnVF7LjunOdJsMcLOOI1+EKgDzwcD 5Zeg+s9WmjRD9uENuFiwWjkmTF8+YQ2D0HZ2nJAAh2ec4K4VkqJIvZ1QJqmrX1mHwYgzlFL4arF 1rRH75YnmPNwjq+yAIGKBP2++ZtRWHwIE50M4dd9DdBWzGIDxJpPUNlKi2jzZhzadQBop5QpVQr VtZP6cOOQ+ofQ6bF/8RVPA7bWmuH01rTZzagOatLHBFRg8K0bIp7z3BbSzm77py18RSJHhHS40p XEC+GRwMg0f3/wkBNhkgXgrcnAopXQTdjz6C0mlCXbUwOSqS3558Dhs13/4QTmWYgaSVd2O3jq+ O0IBaAnoGVnG0WsE7DUFAz3qkiF7/xnrj2mxnOx1U9doV8XJr0Jt7RENrmusfUxg2z/WZ1cUlak W6ZLJcS4bunWdZS31ET9loMIZ6p/gP/cov678vDGttNKy3V+NTBq6lyJ5SVwuRecVpqEnoghfR X-Received: by 2002:a05:600c:528e:b0:485:3fe6:2209 with SMTP id 5b1f17b1804b1-486fedb2f72mr30276945e9.11.1773997828776; Fri, 20 Mar 2026 02:10:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Paolo Bonzini , Mark Cave-Ayland , Pierrick Bouvier , Artyom Tarasenko , "Dr. David Alan Gilbert" , Richard Henderson , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit Date: Fri, 20 Mar 2026 10:10:13 +0100 Message-ID: <20260320091019.59902-2-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320091019.59902-1-philmd@linaro.org> References: <20260320091019.59902-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773997863486158500 All these SPARC64 registers are 32-bit since their introduction in commit 3475187dd81 ("sparc64 merge"), see target/sparc/cpu.h: 511 #if defined(TARGET_SPARC64) ... 515 uint32_t asi; 516 uint32_t pstate; ... 519 uint32_t cansave, canrestore, otherwin, wstate, cleanwin; Set MonitorDef::type to MD_I32 to dump them as 32-bit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- target/sparc/monitor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index a60671a60a4..e9300ded4ad 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) =20 const MonitorDef monitor_defs[] =3D { #ifdef TARGET_SPARC64 - { "asi", offsetof(CPUSPARCState, asi) }, - { "pstate", offsetof(CPUSPARCState, pstate) }, - { "cansave", offsetof(CPUSPARCState, cansave) }, - { "canrestore", offsetof(CPUSPARCState, canrestore) }, - { "otherwin", offsetof(CPUSPARCState, otherwin) }, - { "wstate", offsetof(CPUSPARCState, wstate) }, - { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, + { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 }, + { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 }, + { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 }, + { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 }, + { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 }, + { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 }, + { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 }, #endif { NULL }, }; --=20 2.53.0 From nobody Sun Mar 22 14:22:12 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=1773997922; cv=none; d=zohomail.com; s=zohoarc; b=e8h+fCwEK5cMJoBMyQjLyLy+o7m5rV/un4tmljrR5n/RzyIyM8fSzIvkE21uJGDa95jNiO9xaxhMahjDSPuBjGRLwwWMYay7dLt2WzAPGwwZ2ABYbnGEM0TbnQF5yvn5yOSR9Y44QmRvZEGLjJC32cdSrIqchWgFWoE/1I46hlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773997922; 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=hK6MVq5BCRm3GyrK2RzGIife9yAh2ZpRT6sg7CANAuI=; b=FVsHRb9kry1gv9UEGxrq0q7cRAMmcJYD9kH2jD6hu+MZIbdpLPTY24HkHgsYao/UvJ+UztfZc3P6JH/tjpVltLDLUw4lUnkxJ9UNqyl74Q1+CfLtiXhECjdLtAH1deguxfZRaVQ1DtD0ypcb8JX8JMFTUyHt9xA0sOKmhC5MsDc= 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 1773997922714957.5640564359285; Fri, 20 Mar 2026 02:12:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3VsQ-0006zA-FK; Fri, 20 Mar 2026 05:10:43 -0400 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 1w3VsO-0006yy-Ln for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:40 -0400 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 1w3VsM-0003eb-3O for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:40 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-48628ce9ab5so4449005e9.2 for ; Fri, 20 Mar 2026 02:10:37 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe880c21sm13404465e9.8.2026.03.20.02.10.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Mar 2026 02:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773997836; x=1774602636; 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=hK6MVq5BCRm3GyrK2RzGIife9yAh2ZpRT6sg7CANAuI=; b=u6y+4yJLB9T2cHSiL+SLWuNdTheZSMhkw2gDaPYL9gLvHCEsGL4NK7+V6J9LvXx9lY YnIqxfDH3iiMyz48myxSJzrTZ+0B7LcNaow5653w4R+1LKVpUstVSeC1p3eQKt9u5HAH i8zXo7Q/tQzuJfON7GLj8OhYzv04fdZXxaDmXYAuBJxwLt0xddN2JFpDa9q83FeZCfvq WtfUo3joF2dooSzJEIs9yEi61VZW0cj0BLeSdj3LctMskbGqk2A/dAVqAOArZlbVWULC iSCzj1B5qeePYmnCnl0H/CvckSvGrf5TAn96unqaE6UjG0jVniHqoH4Z7WhSGmcf/H4n T+Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773997836; x=1774602636; 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=hK6MVq5BCRm3GyrK2RzGIife9yAh2ZpRT6sg7CANAuI=; b=jH7xanpSlD2syZXX4tm3xxZX+o32hCxed6siVE8dFusUoV+e/0K/he95o10EDc9G9i r2BjPEoFdD/RoAi8W1Rn6yoMCd3W4TlVCZ2UmPm0sDMpDkjL11iY++r2pjt0vXYkZqzJ tNHv7O2pv/rcHW9F2PjOK823F/G2Ytf6d7jjqVEmp3dhDpCYyjSl3gKMKzRbCg38uf4f UAOv4Ln5qMeFAaqHzb5IlXGS+NCWFZN/7b9xlr8idQHDhMtbOoLgPyoDG8JA5FtTm36N VJsalOV+tk0yavhvuw1NeZjc1Gs4IJNvNHUfMPH/2hoVkNNnN7HTbzWfMHk/7yNZdzh/ cLvA== X-Gm-Message-State: AOJu0YxhxTMwo+DeZKS7W13groHfGEaxse2x9pKAfZz6WR0RdOAv2TuZ Wmlnhusi6ohfopG5aB4RbMUvgq9/0c5d3xz/LYkSy4J0JJNdO6zxOrdYZ9N7pmHJ/dMvgFpTTeQ c4Lc4Bxg= X-Gm-Gg: ATEYQzzOzNlcz6Z9JhzwOzfiTFQm0tVfNLFHOHLfOgN1tE2LwlJNCliub54+MtdS1C+ YXP9ookTutlSIIcyJ26r3hYAEMDo93JX6PlhshGZdsi/cMqgeYfyZnvzC2sS/lK5v087Hn9qHVf dhAIoWNy3LsU9iy6pwrFKflPsVppZtuUiwND1vMcaB2I8x+dgzb62OEmpzO7XTzNLJ/Z327VT5z Pdnb5RdIgAg5BJv9kTEysImSO5rC9iw4j8TZqEHFyA7ncC9vXtVhhIrzXOi3VNZLBVojs1uAbH5 bKc2Ha/y3KBDVupdJbUFKB4PCCUa3sEACvps6iAP2TYcKA9ljCFP9R90kWiYQ38OCxqmeaSzF7w IPYEbBbQ4r5t4idhaRBOZAiH5bQtCp7P9HPRXlQDMc3NeO2A1BSBACCCkiwMn3Igfl9f5e+gXay JeFEBbDCqwPUt6ohyhggIKJA0uTzb1BBI1OQxlCUuL8A/sO8giK/xRhVP1VqDVjZ0DV5rHQo2Z X-Received: by 2002:a05:600c:3f19:b0:483:badb:618e with SMTP id 5b1f17b1804b1-486fedf70a8mr33296675e9.8.1773997835939; Fri, 20 Mar 2026 02:10:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Paolo Bonzini , Mark Cave-Ayland , Pierrick Bouvier , Artyom Tarasenko , "Dr. David Alan Gilbert" , Richard Henderson , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Laurent Vivier Subject: [PATCH-for-11.1 v6 2/6] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32 Date: Fri, 20 Mar 2026 10:10:14 +0100 Message-ID: <20260320091019.59902-3-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320091019.59902-1-philmd@linaro.org> References: <20260320091019.59902-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=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: 1773997923725158500 None of the few targets still using MonitorDef use MD_TLONG, they either use MD_I32 or the %get_value handler. Remove the MonitorDef::type and its definitions altogether: simply check for the %get_value handler, if NULL then consider 32-bit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/monitor/hmp-target.h | 4 ---- monitor/hmp-target.c | 12 +----------- target/i386/monitor.c | 2 +- target/m68k/monitor.c | 24 ++++++++++++------------ target/sparc/monitor.c | 14 +++++++------- 5 files changed, 21 insertions(+), 35 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 5167d17d41d..56322ceddd4 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -34,13 +34,9 @@ struct MonitorDef { int offset; target_long (*get_value)(Monitor *mon, const struct MonitorDef *md, int val); - int type; }; #endif =20 -#define MD_TLONG 0 -#define MD_I32 1 - const MonitorDef *target_monitor_defs(void); int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval); =20 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 420969bd6eb..3f019ae2a28 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -82,17 +82,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const c= har *name) } else { CPUArchState *env =3D mon_get_cpu_env(mon); ptr =3D (uint8_t *)env + md->offset; - switch(md->type) { - case MD_I32: - *pval =3D *(int32_t *)ptr; - break; - case MD_TLONG: - *pval =3D *(target_long *)ptr; - break; - default: - *pval =3D 0; - break; - } + *pval =3D *(int32_t *)ptr; } return 0; } diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 446428602ef..977f65fe16c 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -602,7 +602,7 @@ static target_long monitor_get_pc(Monitor *mon, const s= truct MonitorDef *md, =20 const MonitorDef monitor_defs[] =3D { #define SEG(name, seg) \ - { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 = }, + { name ".limit", offsetof(CPUX86State, segs[seg].limit) }, SEG("cs", R_CS) SEG("ds", R_DS) SEG("es", R_ES) diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index 08ced037b47..94bb12833af 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -24,18 +24,18 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) } =20 static const MonitorDef monitor_defs[] =3D { - { "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 }, + { "ssp", offsetof(CPUM68KState, sp[0]) }, + { "usp", offsetof(CPUM68KState, sp[1]) }, + { "isp", offsetof(CPUM68KState, sp[2]) }, + { "sfc", offsetof(CPUM68KState, sfc) }, + { "dfc", offsetof(CPUM68KState, dfc) }, + { "urp", offsetof(CPUM68KState, mmu.urp) }, + { "srp", offsetof(CPUM68KState, mmu.srp) }, + { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]) }, + { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]) }, + { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]) }, + { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]) }, + { "mmusr", offsetof(CPUM68KState, mmu.mmusr) }, { NULL }, }; =20 diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index e9300ded4ad..a60671a60a4 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) =20 const MonitorDef monitor_defs[] =3D { #ifdef TARGET_SPARC64 - { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 }, - { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 }, - { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 }, - { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 }, - { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 }, - { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 }, - { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 }, + { "asi", offsetof(CPUSPARCState, asi) }, + { "pstate", offsetof(CPUSPARCState, pstate) }, + { "cansave", offsetof(CPUSPARCState, cansave) }, + { "canrestore", offsetof(CPUSPARCState, canrestore) }, + { "otherwin", offsetof(CPUSPARCState, otherwin) }, + { "wstate", offsetof(CPUSPARCState, wstate) }, + { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, #endif { NULL }, }; --=20 2.53.0 From nobody Sun Mar 22 14:22:12 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=1773997869; cv=none; d=zohomail.com; s=zohoarc; b=h7aiGM20UoZAlGrSqbTYXxqzFDb7BvecEoS2kbBNcfS3tOOoUgICjU8Sb32l7c1290UWaSJvj9nFCQIYV6tszA+nBvOS92S/q9bvbHVYOQoaAs8WoAfd5PwPYKGjKB+zjy0i3l3iUV8TJ7tYCXuzF4M2dDfnMPThuMlXbPFZdn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773997869; 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=TwEd3SP96owfBxqUTnmeX3xBEcgEs5+tbDNNCkTGnRE=; b=ljAY/1YgrzN0iWKa6keSFuo4fHpfR6kgHqWNdOE9v+6GWcsGf2KAi28sn/3WjpCJn8tAhjx4GcRimEc2jVDx5kL3xUKYrA3snjcO6EYhRD/rdmr+LYwbkcE4LITV5Uj/wB8ioCdsm4vODYLOHvNnD8Jz4BH+4YFMi2Tp7swVnf4= 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 177399786951327.159977812096372; Fri, 20 Mar 2026 02:11:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3Vsa-0006zv-7H; Fri, 20 Mar 2026 05:10:52 -0400 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 1w3VsV-0006zd-Th for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:47 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3VsS-0003fK-VL for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:46 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-486fd27754bso9328805e9.3 for ; Fri, 20 Mar 2026 02:10:44 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe8359acsm48255075e9.12.2026.03.20.02.10.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Mar 2026 02:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773997843; x=1774602643; 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=TwEd3SP96owfBxqUTnmeX3xBEcgEs5+tbDNNCkTGnRE=; b=VDX6dJWYFpIg4ntdDYVNGRbCCP+Od3cNA1vCzOH/hkS3MLhZqKGbwL9AoOKqP01m9e gg6a5WyljONVHZwkItXFi6ngt5lA/eBn8/isacr63WpWlYZvYzpP5kv0nRFUCX5jLrb2 9TeJI+owD1fjXLmcvx+tonj3LFuVh8Hc8Ehgg2g4/GmzxQ2O2H/IFwCMVlKf61t4dX2a z58Gob0nux0v5EKAnPiCNjJIPxZWqUfA7dtWOpi76nj7uRuiuml0UqRzDKhIAhlcIH++ OIF9NPjMHAN6pPHcZUd1KrRwvjEQMvybN8SV3qoV4hq0Kpqs+PBEA4A1qiK2CsiNrTlD 5kww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773997843; x=1774602643; 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=TwEd3SP96owfBxqUTnmeX3xBEcgEs5+tbDNNCkTGnRE=; b=hTQmTIl9bKznclxylObd3XoQBoYB4qNUrLBYJjExmg4U8WItUiIw8Us7ZSes1aTnIR l0YjZsHcfjIHKSx5TnJIOao2TLjMZKZIwRNy0C0DnoQrcGzuO6LlLk1G1aH+70ki+Bsp DVY1dLhGvDdEaqalw+z5jFriByUQ9rnJZ5rqGqrNOhkTH6TO4A3I4ewlJAsAYUaKgsKz tw/KPSnfkFa1437CzKiuTQZiZQ98hH/HJ64ZtI5mLjSpmmyOe6muyPV8qipeBSGT912v +C6XJHH6Ol9t+2YQKkNZUaBwf/rFLZ9U7TYZ/2XQh2bLGXBNP5CzDgv7Ptlypc5ZQz9r pAaw== X-Gm-Message-State: AOJu0YzN8j3XCxpmPzQh9Xsq9wnEH5ruQnpG2HenxOvKIUVX/8kRYpiQ suNUENiQnjCmupdzt+knDZnLIu6IttQKvvIkZrUc2Ez7NLKM3LwnWtr7s2cmZ5mhN8hTARU5lzo aC/MIsW8= X-Gm-Gg: ATEYQzz+J9lakp3x16sZ5ARyN6JVsezhCJ5JmsEFqOQ1Ge/5IMNaE38+WWMPb2udZjE 24/gfm4OA5IGmicE/Ynswt5DkVTDHv/Ajk3ivgNt9X5vIBzKPfENFOE1jSz+UgFaIJYrpckBTdI /jEd3r4AIx9c/SozUgH1IxShX0u3Myb3oFOUJshjr24aX4QVY8G7xIGcMXW+a69EKxbZWG74Afv PwxspSShELGGNT0w23zzqSQUXb0HuTaAsi+7HgumPUOrvrHd5CvosKEDHCopndlHATgGmtxQ47u IlqUHLlSGvaQy0ofH2BF5ARWnPpbi2hBWpkakBsCP3qF3LRjuQEaMbm0d96bfC8PYjHn1ZdLN/x tRuFML5WOZuEiwF66QU3VH5WvnbBFxMSVxzncVF5dJepi4EzsmrBORDs5hl7Ms4Sgguztfhdgu+ xjxcv/v1zWiV2VDDKCND3QXTt0l+UkLr7bBzsNeUvuAuTusKBO8x9CiVczszrUC06PVc7R9lRB X-Received: by 2002:a05:600c:8b18:b0:485:3dfc:57d with SMTP id 5b1f17b1804b1-486ff01ca8dmr29809895e9.30.1773997842770; Fri, 20 Mar 2026 02:10:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Paolo Bonzini , Mark Cave-Ayland , Pierrick Bouvier , Artyom Tarasenko , "Dr. David Alan Gilbert" , Richard Henderson , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type Date: Fri, 20 Mar 2026 10:10:15 +0100 Message-ID: <20260320091019.59902-4-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320091019.59902-1-philmd@linaro.org> References: <20260320091019.59902-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=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: 1773997870755154100 Simplify MonitorDef::get_value() handler by having it always return a int64_t type. Truncate to 32-bit in the single caller. Note, this handler is only implemented once for the x86 targets. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/monitor/hmp-target.h | 6 +----- monitor/hmp-target.c | 5 ++++- target/i386/monitor.c | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 56322ceddd4..6364c94edf8 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -27,15 +27,11 @@ =20 typedef struct MonitorDef MonitorDef; =20 -#ifdef COMPILING_PER_TARGET -#include "cpu.h" struct MonitorDef { const char *name; int offset; - target_long (*get_value)(Monitor *mon, const struct MonitorDef *md, - int val); + int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int of= fset); }; -#endif =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 3f019ae2a28..155caedd784 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -33,6 +34,7 @@ #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-machine.h" +#include "exec/target_long.h" =20 #if defined(TARGET_S390X) #include "hw/s390x/storage-keys.h" @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const ch= ar *name) 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); + int64_t val =3D md->get_value(mon, md, md->offset); + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)val : va= l; } else { CPUArchState *env =3D mon_get_cpu_env(mon); ptr =3D (uint8_t *)env + md->offset; diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 977f65fe16c..b128334e571 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 int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md, + int offset) { CPUArchState *env =3D mon_get_cpu_env(mon); return env->eip + env->segs[R_CS].base; --=20 2.53.0 From nobody Sun Mar 22 14:22:12 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=1773997869; cv=none; d=zohomail.com; s=zohoarc; b=IUg2wD5lMrJxnobuC3bgxNYXjTgpxPYkCERNtg5VqvC3pvz6HiDXnM20oghT54gJGZXdW/socr5ql+4C73kiB839m7UvatgTLFR77sThR11qGCfA80EI0mfk69LvjKulJVwa0pWfjwh/dK8/1iStADVXr8GlU/Hz4pbfh2nO+Fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773997869; 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=oi0H+6KseD1hRtBZv6iO1IsvVSa42TMjSazjxCizyJc=; b=lG26ZOjnU1kPkfo9VPkpfCOC4v65ZOJdVVZlvTHwXjChIzoOnaPqIBKIOcXGIbtBm08ikNZH7OAz1yRyygIZd1BSWGPpnnbbVxvSlkOrOZgE5wEjlAbIxbyPmCcy3aQQcjwZ9HfamLXMbJVpUvutA7Ll9mzgNz0RhaEhSaqohTE= 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 177399786981595.47969949055232; Fri, 20 Mar 2026 02:11:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3Vsf-00070R-B7; Fri, 20 Mar 2026 05:10:57 -0400 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 1w3Vsb-00070D-FE for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:53 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3VsZ-0003fZ-Sv for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:10:53 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-48334ee0aeaso14845855e9.1 for ; Fri, 20 Mar 2026 02:10:51 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486ff19d387sm11884785e9.17.2026.03.20.02.10.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Mar 2026 02:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773997850; x=1774602650; 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=oi0H+6KseD1hRtBZv6iO1IsvVSa42TMjSazjxCizyJc=; b=jqyRNjtqoPJlAzNEM/FgPJBYnXL3kN+JNox9lJPtg3qZ6nUlhfFYV4YAFtjUFxqY2C +llZosO0DLE3peCvKrMdkpkEDL0zlATHtaknfty+dtq5f1hFDYUv9NCIvKsF0s6N+hay mQx6PGB+A0WLEwd7wN+WvuJjjcFtZHvSv5i8l/cxe8FqeArIA8oodv0/JZZMMaZ5X5tb lX8ik/hoZoHk4RwvM6GBByKP47a1EM5v6Vq8keGuwn5cwHIlGF5qXufRoVD2qbIh7OnG ZMksH+j3rJT1It0PuqS+qkIUPVLJJnatMEBFiobHG9/ZtFUDheFk5p1X4mzWmvftuDl4 sjSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773997850; x=1774602650; 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=oi0H+6KseD1hRtBZv6iO1IsvVSa42TMjSazjxCizyJc=; b=MZQoYzQVLcs59CmP734hrchp4ZVXSWVEsG5rAEGP7fPM/nABoO+3j/ZhdrnUr269BI BCEJ84cfqVXcxy+Qn4FWSgoFnLRr6Jg81a+g4LhzGIG6eLA/omAI2NWuGK386tRzTSqy GbQ8TT7OhhjavHB957VRWicC9agDxLPis4EF02vDJjGoaEK4lVWWKX64FdVLIDRzOgya UBKk8J1GdCQZ8vzLRXT7A5t0tqIRuTxwoqqoltI/B00MW3L562jN/kCtqy+OY5z+lo/a GceP/VoGdCVgU+6yuEQhAm7A3S3wTHxzZdVpwdXoU+WFsqa70Th/vjfLALIKPtSbWFRd wtIg== X-Gm-Message-State: AOJu0YzQSnF3ZT6RKhRPPb1h18PEUh/Hj0QVRKddg4swXXvVANXorqKY OBSM44a5ltBwZfHOfyLzjmYtPjBD5Uk1DcRO4I4HYAWvNslMg1br5qRiqqbNlqzsTM5h4hEhcHz jZR2VeeY= X-Gm-Gg: ATEYQzwrQT/hN459COfGjxgpKPVF7cHA4GbawCn/0F5giTH5YNA7yfpCPH2+sCKwxry 9u6VxVyXKFYY9S4zXrVpA9tU4rZcpTj2iEL+XEUQdsqBe/Cq4KYiz7USQSvFjqNxMvJzRyWow9d 0o0sKN+k/gnxTj3T9nEIaFnaU05eCWbii5r/tmknBinW0J7F8DneO6rYUd/V0b+vg1rQTF1G+Z5 TSmiOD5I0Zkw80Xxu7IT0XwOeDdt8+DZLzRc21VRc9OvDqlqS4UQJWrZvKEi3jn88Z9k826Dk6J 6lRzx0xY06SlGXUArEgZWmHwGTbdUinIetD1/uqpgeoqbUVqQ3qJ0P639nXJicxSrfcO8wlZA4o XytdilQFYiBSuuB6fue/EvYSIt47psBT8CuKztadZm5F/bvTm/+HB2fUBMp9nr1TeS1PuMKGgCB mtck4Kiodj4jU022kwNtY8lDzxhZGSAh7g9ASbfAKKSrGJ/c6zpHeQe/nH5JfQHzuHtavgjSFY X-Received: by 2002:a05:600c:19d4:b0:485:4278:24f0 with SMTP id 5b1f17b1804b1-486ff03d9d4mr30032235e9.30.1773997849701; Fri, 20 Mar 2026 02:10:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Paolo Bonzini , Mark Cave-Ayland , Pierrick Bouvier , Artyom Tarasenko , "Dr. David Alan Gilbert" , Richard Henderson , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def() Date: Fri, 20 Mar 2026 10:10:16 +0100 Message-ID: <20260320091019.59902-5-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320091019.59902-1-philmd@linaro.org> References: <20260320091019.59902-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: 1773997870726154100 Truncate manually, removing the need of target-specific code in get_monitor_def(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- monitor/hmp-target.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 155caedd784..5e9f1b0db5b 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -34,7 +34,6 @@ #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-machine.h" -#include "exec/target_long.h" =20 #if defined(TARGET_S390X) #include "hw/s390x/storage-keys.h" @@ -93,7 +92,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const ch= ar *name) =20 ret =3D target_get_monitor_def(cs, name, &tmp); if (!ret) { - *pval =3D (target_long) tmp; + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; } =20 return ret; --=20 2.53.0 From nobody Sun Mar 22 14:22:12 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=1773997927; cv=none; d=zohomail.com; s=zohoarc; b=ZGUtGJuaxFZBffHNNBXaTqSMGXZ7pz8U6NZKARf4whQMBlj0wowCn8QLeAg1q2GMe3rvVwFs+FUfk7kgPbNZvU70BgRJGQ/qQ4q6tgxn8xi+hTx7HgmltaxgH/dQus0OEBvkyKlFdgaqMRzykhmzLKf2hqK5SClluzHErAopik8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773997927; 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=XdKq1U5rW3dRPvw71lLGhSrUWkJgSl5smUUmGKvqjzo=; b=NuMdQ8nSBlE+xIMvKP3E2JX5Q9uYN2Z2K/E/g0HCC39RnJl3FJsi3L8i5cYBKaWN2YMrarGPkSjxpWIi25cM7vG7B5vApnVkcSMeTIDliPc2LTUjWIWeZKsuD31XruhqrdvKo+z/bEuw0EDsbAisQJIhZmoOBS+s3PC1FboYXjg= 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 1773997927334332.6741928004353; Fri, 20 Mar 2026 02:12:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3Vsv-00078S-Cs; Fri, 20 Mar 2026 05:11:14 -0400 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 1w3Vsk-00073k-05 for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:11:06 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3Vsg-0003gD-Qb for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:11:01 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-486ff3a0fc1so3641395e9.2 for ; Fri, 20 Mar 2026 02:10:58 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe7dc4a2sm53051385e9.5.2026.03.20.02.10.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Mar 2026 02:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773997857; x=1774602657; 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=XdKq1U5rW3dRPvw71lLGhSrUWkJgSl5smUUmGKvqjzo=; b=HU2i2bDI1fQyeu2EuJiIx/l+RO01sOWpI1RiRzwprdYEby3yur+KCq+mr3YKq7Ke6C fqqOgxG8VjgZESzVeBH70nwNkPlJBdGEzQKWWJbhm8yp2ed/FMuXHzc7CLpz38bQ7Up7 QlfHHiqbmGOZt5lcZhZkDGLNRc4tvou8+wTiOsgOwvKPeXxH+34pXScmhryqJYgq3Rsg Vj7Tn7tecK6SoMa7Di4woFbqTrdwk3sE0uLpoVlKwmAXWCnmJAX0NfBuyheJ3/eEAvV2 n/dOMMw+Ib2pgSn/dBizLFO+RBwA0o+LqEch1TUgaEQN8F0uxsRLCuLUVAiEh8FB7O6Z xAUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773997857; x=1774602657; 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=XdKq1U5rW3dRPvw71lLGhSrUWkJgSl5smUUmGKvqjzo=; b=HMO/Xujdzy53K0tUCrAPd+f77CbpjLWC+GdoE9UWTqHNLjqqe7MzTu55xMIL0OoNs2 aYc9a4oNre53oxCLOkZCOnI844L4pVXDMu4W7+85HqEBd0UVD06gHESWhAQPSFUcq7jL VNYJ6DNVCw7TLH0Hu9bLBFhK7R4jWho6DtPWeOefDDxyu3ja3BPBku/Hm8oIW1xEuAzv oJCXa+vnft2QNtDn2es1CU/GqbDqWFHuec0IJVFiXck37B/HzFcO+/F/n4Blvh5zr1ly EaFE44CQ+aMVwm9ys0tbLFm7WCMptBYN/DuBFWVlQo1x8/1qBuM6Q76Krebf0GySUznI Hodw== X-Gm-Message-State: AOJu0YxtrUWDp6MmKcXjVYSJENQ8QsGqmepb+sz8OAeGEhTMXOsE8ZOq AA9Su+FfKjSvcgcQOYFeLe2gvy+jZaakVGxDbLPCfZ2qxX5HWd6OWj2QQ52F2NUGBFLpheCEZW0 Nc4HiGSU= X-Gm-Gg: ATEYQzxQyLLauJwEqarLSEN5Ekp1BOAGIk6yBTNGMbgxs91y+Q6RgteUxuor7MFGvmJ c9Hxoj7xaj7/TKpRu86of7W51rPzYhH0rdnRk8qMLyqSl8cXyZajo7ywxV8WTNC3+3CJvSKau+l txWViTeIqpGcPk54NDO9mqzefkMqqU7sWZkLuJ2CipN7mueYd3YOTFDNcuEO64BHHLwpaCi9xMG OG8Es5RIVJYnJRZlUYNbqtdTgKgCaEILy76AbWLVuxbAYVZ5qxRqfjRLlqJD3OrcbSBd/Zwvghp oX8rjSJysVfpWDfvta5olq/IPgY2qbwiDwYhV3C+6ay0A4OZIE6Oj20/pfzHjdcIM1qzcyq8BFM 89fpLRTpkz15hyGX6+JtAN37MukoFH/F7idohzRqMfkVwfUghUiLLB0V7ewKAV3BVaYUnv9V9sr SRqjsb5wb9cn1S7CuzgK1jWx/7EqIBuARhFRcvWIYe9YLRCOX5mZOSzNhaGByYrmz49dmOt8ro X-Received: by 2002:a05:600c:548e:b0:47e:e2ec:9947 with SMTP id 5b1f17b1804b1-486ff029336mr31658215e9.33.1773997856588; Fri, 20 Mar 2026 02:10:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Paolo Bonzini , Mark Cave-Ayland , Pierrick Bouvier , Artyom Tarasenko , "Dr. David Alan Gilbert" , Richard Henderson , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-11.1 v6 5/6] monitor: Reduce target-specific methods further Date: Fri, 20 Mar 2026 10:10:17 +0100 Message-ID: <20260320091019.59902-6-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320091019.59902-1-philmd@linaro.org> References: <20260320091019.59902-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: 1773997929464154100 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 Reviewed-by: Pierrick Bouvier --- monitor/monitor-internal.h | 1 - monitor/hmp-target.c | 39 ------------------------------------- monitor/hmp.c | 40 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index feca111ae31..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, 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 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 5e9f1b0db5b..a3306b69c93 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/target-info.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -60,44 +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, int64_t *pval, const char *name) -{ - const MonitorDef *md =3D target_monitor_defs(); - CPUState *cs =3D mon_get_cpu(mon); - void *ptr; - 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) { - int64_t val =3D md->get_value(mon, md, md->offset); - *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)val : va= l; - } else { - CPUArchState *env =3D mon_get_cpu_env(mon); - ptr =3D (uint8_t *)env + md->offset; - *pval =3D *(int32_t *)ptr; - } - return 0; - } - } - - ret =3D target_get_monitor_def(cs, name, &tmp); - if (!ret) { - *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; - } - - return ret; -} - static int compare_mon_cmd(const void *a, const void *b) { diff --git a/monitor/hmp.c b/monitor/hmp.c index 0e5913fabb1..1d645090667 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -355,6 +355,8 @@ static bool gdb_get_register(Monitor *mon, int64_t *pva= l, const char *name) static const char *pch; static sigjmp_buf expr_env; =20 +static int get_monitor_def(Monitor *mon, int64_t *pval, const char *name); + static G_NORETURN G_GNUC_PRINTF(2, 3) void expr_error(Monitor *mon, const char *fmt, ...) { @@ -1595,3 +1597,41 @@ 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 + */ +int get_monitor_def(Monitor *mon, int64_t *pval, const char *name) +{ + const MonitorDef *md =3D target_monitor_defs(); + CPUState *cs =3D mon_get_cpu(mon); + void *ptr; + 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) { + int64_t val =3D md->get_value(mon, md, md->offset); + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)val : va= l; + } else { + CPUArchState *env =3D mon_get_cpu_env(mon); + ptr =3D (uint8_t *)env + md->offset; + *pval =3D *(int32_t *)ptr; + } + return 0; + } + } + + ret =3D target_get_monitor_def(cs, name, &tmp); + if (!ret) { + *pval =3D target_long_bits() =3D=3D 32 ? (int32_t)tmp : tmp; + } + + return ret; +} --=20 2.53.0 From nobody Sun Mar 22 14:22:12 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=1773997911; cv=none; d=zohomail.com; s=zohoarc; b=BmgS8RXVk/s/F4zVNRINrEFZKWM+gcptAcz8OyjIxTYgh8TkI6KJDXEt1vxSX7BcrQAvV/Ub5QqtykBbqnbCnFgA5OnW0KZzVW5X8qsi4kZ8MAQAACA20t12GuH9RhQyNcRM7Fm1cgxA+Mioq34o4TVVtbiXER2OU6UrRJRxnEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773997911; 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=OSjJLHf6QZ6otlVl4S28eFxoMW617Z3itEErL+k5Pp0=; b=ZYjNX0lIxTXn06U5faBBr+LDncW1uRoaho7RfcjN8MgGhnEtPD4Xv4lYyWkn+N76E2ql59WXRTq0L81Au5VkHN3TYaPuZnlIEohKWc1v2LUnVhvXAbk0suF/kgK2Lq0QTFo5Cjtzhmq/xSNSsSs3ZESsrEytuEKYIm1ljKkd2KI= 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 1773997911071172.17868427574706; Fri, 20 Mar 2026 02:11:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3Vt1-0007AN-DO; Fri, 20 Mar 2026 05:11:20 -0400 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 1w3Vst-00077m-LS for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:11:11 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3Vsp-0003gk-DU for qemu-devel@nongnu.org; Fri, 20 Mar 2026 05:11:11 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-486fc4725f0so12019975e9.1 for ; Fri, 20 Mar 2026 02:11:06 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe6d9896sm57523785e9.2.2026.03.20.02.11.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Mar 2026 02:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773997865; x=1774602665; 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=OSjJLHf6QZ6otlVl4S28eFxoMW617Z3itEErL+k5Pp0=; b=XndgRiHjHYCC670+YzcFcx66V4tIkpqKQKa1xT+6Laom02MzgMFxFdo4Vg26WkZoC3 meCIhPbMWvEY4H8LOYcfr9o1MdLIHqj5St+lIkRD2rdqruDafcsIw2uNJROBcV7Rm+k5 kpd9MB0s/oeDyL+hL+vwUygr/xMWxwJMD2TzZ3nJhguMKNeMju2cAEUUurxwiBjMDM7u APKf1zeBWmxav3q/8OPgHePWy5rnaZ1JJgXNUapn+oJKciWXGWaxxLt59CrkKLOfwJVn +inGEH5Z98OO8l5MfV/M/oi+hv8sfZlHcQawB3zuPufl4NkEQRF6VQN5Fo1frYrJgRsf lkhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773997865; x=1774602665; 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=OSjJLHf6QZ6otlVl4S28eFxoMW617Z3itEErL+k5Pp0=; b=lyjq1m8uuIBs836O8X+F4/OyMZ8b81ksx/1wv2jlSfLsAbc24ItpRGbomN4lF4K81c VxNB8UwT7yy6RL8uzCa14nDTwigrIDxbIlN9pL3qtVcIFxig8xqbIvtsPLs7NoCCb1DG KHcxsMzNQ5pXFO5kEL0PqKPrvXN4Mz3bbIq55TYZwkXxH/jRZyYyCqV3YBKsYtnVHGvd VCm9bUKuOu/Pl0eQM0M7I0m0fHzDiK64NiqmBbbRMiBVuODrkOzYU0LnJANCGVLjH3hS RlGuIB5mOOyMFIoICvbxZWVOq9QbutTSOssro7/Bdlk27fkNC9eQQFPyA94zcbKF3P2f TVnw== X-Gm-Message-State: AOJu0YxhExu04pIWSKAkUU+JnG+gRsmih2QRp05uUWl3CwelJMKW4xzG AOAL9tYLR/m4ZtD79EhclQLikrkrJe9+7tRbDNJBVTzz5Nzp250dkgC68ZbInpg5KhagJaEci6u 8bCd6XWs= X-Gm-Gg: ATEYQzx3QFloN0DIupBDyIicf6d5XT338EwGCmHS6ZW5SZk72Vqs/VRxDeHk9HmqLu2 r/QiuZA2DmnbRRTI2U/M70z4cYmPtkqi+9U38cNzgYv82hPWQv2NydsKg2M+fKmEcMMMmGxVlgc PwEMR79oD6gs1Ck4zR8C8+Ja+5CEKGuoWNyju3ZcMyKaUH54bLaG6QuJ06NCKuTQy8k56Ozpe4k mMhUfqAmMwkVkMiHCGTvmyfQZHtFf8vzimxX9/zI6BVfhnvpNmXjBQULnf27xYRDYeL5Jn2mW0y dwcV9bVU8MybcIorzckMBVE4S7KX08WmU05hT0+qi4wI63WK7EFmHJqGhEM0ba2alw+02dDUCWu vY8mvzZlt5i3Z+j2S8ZN/kmfFzt6yLzB4uYV6sLGeawkoG23TGPSnSkZzSndrjqEu9RhmfdgMnW cGXYpnXNfPSGEWo01l3e4IwIq2bpzAO7ru3IhsywoEM0nOCcra7BDem4qAEMKIEBp0NZlkwTdSB Dps4TWTOPg= X-Received: by 2002:a05:600c:350b:b0:485:3f58:da2 with SMTP id 5b1f17b1804b1-486fe8fcf64mr36117125e9.16.1773997864476; Fri, 20 Mar 2026 02:11:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Paolo Bonzini , Mark Cave-Ayland , Pierrick Bouvier , Artyom Tarasenko , "Dr. David Alan Gilbert" , Richard Henderson , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Zhao Liu , Marcelo Tosatti , Laurent Vivier , Nicholas Piggin , Chinmay Rath , Glenn Miles , Palmer Dabbelt , Alistair Francis , Weiwei Li , Liu Zhiwei , Yoshinori Sato , Max Filippov , kvm@vger.kernel.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH-for-11.1 v6 6/6] monitor: Remove 'monitor/hmp-target.h' header Date: Fri, 20 Mar 2026 10:10:18 +0100 Message-ID: <20260320091019.59902-7-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320091019.59902-1-philmd@linaro.org> References: <20260320091019.59902-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: 1773997911802158500 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 Reviewed-by: Pierrick Bouvier --- MAINTAINERS | 2 +- include/monitor/hmp-target.h | 42 ----------------------------------- include/monitor/hmp.h | 12 ++++++++++ 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/monitor.c | 2 -- target/riscv/monitor.c | 1 - target/sh4/monitor.c | 1 - target/sparc/monitor.c | 1 - target/xtensa/monitor.c | 1 - 19 files changed, 14 insertions(+), 60 deletions(-) delete mode 100644 include/monitor/hmp-target.h diff --git a/MAINTAINERS b/MAINTAINERS index 97f2759138d..d4b4aca60a7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3407,7 +3407,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 6364c94edf8..00000000000 --- a/include/monitor/hmp-target.h +++ /dev/null @@ -1,42 +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; - int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int of= fset); -}; - -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..26571d35e84 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -17,6 +17,18 @@ #include "qemu/readline.h" #include "qapi/qapi-types-common.h" =20 +typedef struct MonitorDef { + const char *name; + int offset; + int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int of= fset); +} MonitorDef; + +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 1d645090667..c63da13e310 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 eaa10ad2a3d..5599a4675c5 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 b128334e571..ddc666d3451 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 9dde972c118..97e745f27c4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -39,7 +39,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 94bb12833af..be7411edca6 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/monitor.c b/target/ppc/monitor.c index 776a76602ea..7c88e0e2bda 100644 --- a/target/ppc/monitor.c +++ b/target/ppc/monitor.c @@ -7,9 +7,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/ctype.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" #include "monitor/hmp.h" #include "cpu.h" =20 diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index a9d31114442..3f206b9fca5 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -25,7 +25,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/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 a60671a60a4..99abddbf1e0 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.53.0