From nobody Mon Feb 9 09: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=1768667417; cv=none; d=zohomail.com; s=zohoarc; b=V+KXmdV5ieVUDaf4WWx3Ixnvj/34pZtL4XSrPlZDc3EvYEXWMDy+6bhIVeb1dMOE5Hji1hPZLjWdrC+ZHzJiiebRq5cE4Msd/NSnc44W4US0sD4ibraiO8laeMGYOVD1yVenGXCYNOGgJ24uoDruJeHT3iRpj7tsJl7exA2Wl5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667417; 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=LxWCcW++Lxcknn8mz+ztokq5YZ0Nmxk+SbAcg0xOxLM=; b=i7YvOK4sxxlLjXgICqdV6bODkhmfAZTnC1UEbCxMF7fZCj1Bd+OdKdTDnQ+Ewt/vffpduta7kQLk5fphAxZRX2ALG+nilrb1bBNCzv5uEPOVr8txI9tGgAg1aNdK0QDLm+rvHD471BfXQdRQ355puNl+kmL9TbuR5D5faaOkTo0= 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 176866741772124.748079647741406; Sat, 17 Jan 2026 08:30:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9BF-0003B6-P9; Sat, 17 Jan 2026 11:29:41 -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 1vh9BD-00039I-Nn for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:29:39 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vh9BC-0006Ba-7h for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:29:39 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4801c731d0aso16346805e9.1 for ; Sat, 17 Jan 2026 08:29:37 -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-4801e86c197sm101328235e9.1.2026.01.17.08.29.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667376; x=1769272176; 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=LxWCcW++Lxcknn8mz+ztokq5YZ0Nmxk+SbAcg0xOxLM=; b=OHhBRwW0Ycj63M23i9TOvEP5YRcKnCQ0D7aKpYeBwRmLVNTnLAgqUfN6jn15mvxJ4Z 2eRKoVSPruccXGgjG3aL8XApRAifENvQty/tKvBFuPYuGvpUuM6EnPDrY0ZdoMC3C8AN RfANj0/rhypycszaU+C6hQSVqyDiC5Vyou4q+LGclkcBEqC/V7Wq8GT39QLNdmz4De9/ 8gn9f/XCbsXrIbR8aQMlansiMbtV8E9GZ7RF7Rhu3BNfzWIi8nMxl07XX9lZMrUPrmLw pJ3zsXZ2cHeCODAxhhbNiPGF04yb1Sj47Gu4mcemZX/DVLzbml/FJMQUzPT6z/2KiPlH cs3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667376; x=1769272176; 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=LxWCcW++Lxcknn8mz+ztokq5YZ0Nmxk+SbAcg0xOxLM=; b=GTsimJDWfkRAobTE70IW3DtXAbi7zd9+BASFg5eCN0oWxrLtvVMfAs7TWFC0h/LfOt oUodGrf+JpygMV+IHY44ubAftAxluuZ1QU2FwdxaWEtWb9GaHX9eJHYKSvr5rgZlwD1T ctHQtkPdTXOmEzA3KKT+jqeyOilM/SoQsBgavdqksfQmVsITObim+AGtgW+9CSKo0gxp aWjm7a8KB2SCWhKpYRg1XfZPihplru3VZeDsWuQkPJmoPiQiYT4G4rN9ppEkuho+qGJq bgmp2IA7B2RBAGMbo3Z7vsXPkhV6mDeuFlZoF+ObP2cbz0ByIjuOK/egF59iQEnr9xQ/ mZBA== X-Gm-Message-State: AOJu0Yyo+5DsCiwfKZDMcBUOguqSiZbpQx1MnRWtwo+DK+ZA4S7nb+I2 H1V2WugTMQwGqV0GqSINmtTIeGFsAP6YxujSNhani/cWT1w7bVYB5VHYO+sA4LNiMdwWde/01fI gDrydGQE= X-Gm-Gg: AY/fxX53zf2wQWHXkEUhRxJ58oAUk7poTdVLEyl+whwlanJJSvzpL9EUdDZrDMX+JA0 bvCYaAZ0B3N/aOc/dUWuMC99mV/E1MYIe+iJ+mm78e5k2P8ge/aijof9F3ZbkSaINDOzHSAQffq rZAdsV5tc5S6WmO4A8HpTPxIBLHb4a4ABLde/531DoGgveOKE/L3fV6Uc8hyu54oN+N6YyP7UDE DWNL/JuuasvWk8oeAPFoz8Ncbn6UO+oc/6apLpXdxm7+aiaFLzOUoVs6U9F8hZaTpMq37t61rCT /3yLBluBbVKyccXksjvA6hBfbQVISGSPwKSkAg64gwXeBvo4gd9us65wSDmH641fSmMnWyHix87 6fXif3pouRqJlInHeasC9GGMNiV9Sd5a0NrrDYtPwq5PDJ8XtmD7u7DfqOLYirAvoa83YIXx5SR b6+iHfJ6rBU5zbfpWv5EXsWLyfxLv0aDa6EB1bxdW3HIf8pHCin2t/EH/eV9vM X-Received: by 2002:a05:600c:1991:b0:47e:e4ff:e2ac with SMTP id 5b1f17b1804b1-4801e356cebmr78919055e9.33.1768667376019; Sat, 17 Jan 2026 08:29:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH v2 1/8] target/i386: Include missing 'svm.h' header in 'sev.h' Date: Sat, 17 Jan 2026 17:29:19 +0100 Message-ID: <20260117162926.74225-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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: 1768667419116158501 otarget/i386/cpu.h:2820:#include "svm.h" target/i386/sev.h:17:#include "target/i386/svm.h" "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 09: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=1768667443; cv=none; d=zohomail.com; s=zohoarc; b=krcnTR/kt7WEEYAmZQgyxKGcmQWyRAFapMqAUFSInRkyHpLHP7oy1C7ujkqs9uSREaQp3qfrXA7TI30vz1oi/I1Mzm/IUtf2BprAOyWcuJgCyI3s0uL5eutENq3v68xmvKLDk9vyOpXaMCl7zZcByTvuthkotp46NdPwJnLeIPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667443; 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=VfRg586HPJ+mDGPLeFyi+xxSw4nPOXQ2RpG1oIDhHxM=; b=B2DgJyDlqRPFs2zO7KiCNGfi/Yy30UoZfYnPqdwYPJttfqKmoUMXmErsap6j2NvRG4z/szjilFPzc6vyBDH2p4+0NCrptoIztsrenz5ealEfNJ0AMuYGe2qTig+FopRr3ep9X656+hdel2ObQm4eIE28wwwe8/p//njXfyuUXuQ= 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 1768667443456806.4130115267059; Sat, 17 Jan 2026 08:30:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9BM-0003PJ-3h; Sat, 17 Jan 2026 11:29:48 -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 1vh9BK-0003L6-LS for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:29:46 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vh9BI-0006DY-U6 for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:29:46 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-432d2c7dd52so2653965f8f.2 for ; Sat, 17 Jan 2026 08:29:44 -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-4356997eb1fsm12057839f8f.35.2026.01.17.08.29.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667383; x=1769272183; 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=VfRg586HPJ+mDGPLeFyi+xxSw4nPOXQ2RpG1oIDhHxM=; b=Fl7J6X4pLR3a50WUTHtLUyPJDH8W6464evcOq3qCsc9ghX0IuECshL3HCXCr9JfUr2 xsLa3T0kToAcI7uvbvg7kSSLZB++l5U1L6VwOV1TOfWUxRWCAfZf1XIpMNmLnz6zH2S7 yqLxUN3FruQd5h7Z0u3ZdpEAQYwhOxZb/X0ad9dlpGoceWcH++/xV/ACw+c9h4IjayT7 INS76mumnvxua56ZjQOgmuEYZ/sal9nLSGj02PTwkxdyhbjLzXyvQiOY+2lh6DB1jqTk QFvsmYNQAKvogvqYyzUExey+lhIANFjytDVJRydMRBknLQCqYUM460Ec6cCKDP8Auaiw ROkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667383; x=1769272183; 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=VfRg586HPJ+mDGPLeFyi+xxSw4nPOXQ2RpG1oIDhHxM=; b=RO4S2QeR42t5zJ6sCleQw4W/5TtW/sRUpesuU+ZUqQlWWlegoh4ovfZUx7k0gKbTOL NpiQSLXUTfuzCFGBzXdAozys68CopnxOU92ovrtFOf9wV0QVHZ9XzrvD4l14HgYip1d2 xQOqqC22uaqYwD6zziF6mUmdg0rI9F/pssaXJFm0TcrpUCXF2JeoeKMgmn9WcPnVmEH7 vcIBGBPlw7laagPUu3rDtWtjGu0nrxyc6VOQdILx2kwBNScJ6ZXnFFl4dJE1DoKnamyy sQSateYOPmwSNnHxGHzOEO2Tq1DoSrXqX4n379ZTNr2PVtlw7L3whvZer2A8jQ6Xvs4M dkUA== X-Gm-Message-State: AOJu0Yy8ApuPmsT1F6rQN0pM59O60AJsAioZEwPyo+9DkJz/Hkgssy/S D7f3GsCtI4L8f2Od6uPoRKs5btsAGKyAlMG1mthaf/o551eaCvMSnwBYKHN4aojn+vXUsQ/wYq9 TrDa1nTI= X-Gm-Gg: AY/fxX7yamCPJ4x4eHE+j0dWsPL+EMqdOogZsctc/2pV0BcNlbF9wFQZuZWZ+Y6pwTC 3N5ynoRMdKh3hKkDAADM6y3etE5PdgPX/V2s94uy/zuTLAimCBqRZ5UqAFAXvgC2uZNDz9yLUsW s5LkjhjtGQg2OQaJ5Gih3K+12kvzKe9WYZPsq0QcMuWlNwaWXqbPSeRqF4FXZNVZZ7DboMngU0V gzxHIG89mmgR+Gn4DwuU5rUW24IxbO3OSBw+PNAOvIxcICX/ZuuetLFiNHw8e3Rw+McpiupysGN /x7Xieh2rtGTVD52OLtIb2sXflCTiHV5CaIc4RQrn0YR7HUrJANsmHr6k+xUWDNbH2bqIXEDWHy u04NLuNZBbZs/EFk/gk6Pk7Zhm5aHj/7aCYcEkBe6DraWv+C64Bmi4j/fu5DoJj7gHZW1NW4wi7 9ipICJIpkHwL7SbeFKze/pBpC8WebIwGFgHT0vfjKij9cxSDbT8VbLSZIXYj5+ X-Received: by 2002:adf:fe51:0:b0:430:f5ed:83fc with SMTP id ffacd0b85a97d-43569970a6dmr6076847f8f.11.1768667382913; Sat, 17 Jan 2026 08:29:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/8] monitor: Add hmp_cmds_for_target() helper Date: Sat, 17 Jan 2026 17:29:20 +0100 Message-ID: <20260117162926.74225-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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: 1768667445076158500 HMPCommand arrays are filled with target-specific commands, so defined in a target-specific unit. Introduce the hmp_cmds_for_target() to allow target-agnostic code to access the arrays. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- monitor/monitor-internal.h | 9 +++++++-- monitor/hmp-target.c | 13 ++++++++----- monitor/hmp.c | 8 +++++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 7735c731083..feca111ae31 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -169,8 +169,6 @@ extern QmpCommandList qmp_commands, qmp_cap_negotiation= _commands; extern QemuMutex monitor_lock; extern MonitorList mon_list; =20 -extern HMPCommand hmp_cmds[]; - void monitor_data_init(Monitor *mon, bool is_qmp, bool skip_flush, bool use_io_thread); void monitor_data_destroy(Monitor *mon); @@ -187,4 +185,11 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const= char *name); void handle_hmp_command(MonitorHMP *mon, const char *cmdline); int hmp_compare_cmd(const char *name, const char *list); =20 +/* + * hmp_cmds_for_target: Return array of HMPCommand entries + * + * If @info_command is true, return the particular 'info foo' commands arr= ay. + */ +HMPCommand *hmp_cmds_for_target(bool info_command); + #endif diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 37dfd7fd4c6..59c60d13b52 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -44,8 +44,6 @@ /* Make devices configuration available for use in hmp-commands*.hx templa= tes */ #include CONFIG_DEVICES =20 -static HMPCommand hmp_info_cmds[]; - /** * Is @name in the '|' separated list of names @list? */ @@ -76,11 +74,16 @@ static HMPCommand hmp_info_cmds[] =3D { }; =20 /* hmp_cmds and hmp_info_cmds would be sorted at runtime */ -HMPCommand hmp_cmds[] =3D { +static HMPCommand hmp_cmds[] =3D { #include "hmp-commands.h" { NULL, NULL, }, }; =20 +HMPCommand *hmp_cmds_for_target(bool info_command) +{ + return info_command ? hmp_info_cmds : hmp_cmds; +} + /* * Set @pval to the value in the register identified by @name. * return 0 if OK, -1 if not found @@ -148,7 +151,7 @@ static void __attribute__((__constructor__)) sortcmdlis= t(void) void monitor_register_hmp(const char *name, bool info, void (*cmd)(Monitor *mon, const QDict *qdict)) { - HMPCommand *table =3D info ? hmp_info_cmds : hmp_cmds; + HMPCommand *table =3D hmp_cmds_for_target(info); =20 while (table->name !=3D NULL) { if (strcmp(table->name, name) =3D=3D 0) { @@ -164,7 +167,7 @@ void monitor_register_hmp(const char *name, bool info, void monitor_register_hmp_info_hrt(const char *name, HumanReadableText *(*handler)(Error **e= rrp)) { - HMPCommand *table =3D hmp_info_cmds; + HMPCommand *table =3D hmp_cmds_for_target(true); =20 while (table->name !=3D NULL) { if (strcmp(table->name, name) =3D=3D 0) { diff --git a/monitor/hmp.c b/monitor/hmp.c index 4caafbc7146..17e5756986f 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -301,7 +301,7 @@ void hmp_help_cmd(Monitor *mon, const char *name) } =20 /* 2. dump the contents according to parsed args */ - help_cmd_dump(mon, hmp_cmds, args, nb_args, 0); + help_cmd_dump(mon, hmp_cmds_for_target(false), args, nb_args, 0); =20 free_cmdline_args(args, nb_args); } @@ -1131,7 +1131,8 @@ void handle_hmp_command(MonitorHMP *mon, const char *= cmdline) =20 trace_handle_hmp_command(mon, cmdline); =20 - cmd =3D monitor_parse_command(mon, cmdline, &cmdline, hmp_cmds); + cmd =3D monitor_parse_command(mon, cmdline, &cmdline, + hmp_cmds_for_target(false)); if (!cmd) { return; } @@ -1375,7 +1376,8 @@ static void monitor_find_completion(void *opaque, } =20 /* 2. auto complete according to args */ - monitor_find_completion_by_table(mon, hmp_cmds, args, nb_args); + monitor_find_completion_by_table(mon, hmp_cmds_for_target(false), + args, nb_args); =20 cleanup: free_cmdline_args(args, nb_args); --=20 2.52.0 From nobody Mon Feb 9 09: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=1768667553; cv=none; d=zohomail.com; s=zohoarc; b=LS1/yGZBN/nrdG5y3jbH8e48NZmA9e6eSzdddyk7NMyQAsMzT289E92aR9S8+b+D+te2ogxkoO3tlMVPbrX+vjCjkptiTE6VeKx3Yng/niReQRAQTIohbaFoIuu2vKeyTHTLmJZ+agYiH9XCU3r2WEvTmAgiu4Jm/Oeoj/oYicc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667553; 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=VE48XhslujFFPaSi8GGvuDBQGKWSJZ383NSYBz4qQHI=; b=W2mBEkE5qTj+s4xTFyB7awy9B6Mqm8Dq0OflLnzRrgsE5OtjhNQeodfh1wCIdTQQHJyQqj6IkV0J/pyMgGEPIg8wSW7hpyI5HMLQgBiBZlLkqAtOHctqyPWro9q5rz5wYBDt6ASk9kHR4aFcRvIltqQ/UFb2mW6dKD42ivyVlGY= 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 1768667553610999.3247070498272; Sat, 17 Jan 2026 08:32:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9BT-0003gj-SI; Sat, 17 Jan 2026 11:29:55 -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 1vh9BR-0003cF-JA for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:29:53 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vh9BP-0006Fh-Sb for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:29:53 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-431048c4068so1675568f8f.1 for ; Sat, 17 Jan 2026 08:29:51 -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-4356999824csm11693454f8f.39.2026.01.17.08.29.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667390; x=1769272190; 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=VE48XhslujFFPaSi8GGvuDBQGKWSJZ383NSYBz4qQHI=; b=jUoCImypK8gVWmReFJoQK0cbADwXsqqK/qLBFUo8PB2i/rmXeWYR1XhkbV7nkeV6vu 9sWp6efaKjN1OC9U5EqoOxTjTBd+RuKPqtlB1/oI/ingfdfKCnoo3UwkpSKvAXpHZlMO BIzA8xK3VwZqYwrBLw4h3Y14rO/YVWP8uJYXlqZ5X8qOvtPcU5NUzNR+pAUY/+PkOUiu RbPaSBXNV4XhO3bd6H9Fn2BsgTaiHfOeBwxsIyOncb1CDwo+Zds06zD+FpovBwVSEdFr X7xYSzoCH/Ch8IKMzzJVk/h0bDJdgaTFbRJ861/KbvGmSbPs7fCJljs9qC5PMRYApT4E /Ebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667390; x=1769272190; 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=VE48XhslujFFPaSi8GGvuDBQGKWSJZ383NSYBz4qQHI=; b=OP3MgoDrHqXKHO7+/ypdUhDUhvwopdg6NcJ0iIUL3g1KGLQK3FMQ5wyQoiLGwJYSMI QzCLqGNQ/3KpJNlCNQ4ZM9xLHIyBwnMbJRTE5dkegf6nvliSrAeQ14SrqtofBhmpgCCD rm2mWpdPUNXCGg+lu6kEYp0nU1YcuvQ7eGcF0UiUJwiqxhu4I1G0s4Uot5le/VTh0NiT CcaQRIeB/fzjfFPmpcqEOX/GJPMZsH6Z2iJ/J8dhEv43eQABGWtrQx0hm5Ngh4SOTFEG uyt5TX65SkKN8YzRG3qACsck60i+KfN6/qdBcBiGPc0yKhFpZdQSratoUncdb8DbTqhL 6/2A== X-Gm-Message-State: AOJu0YxFLdZejRJNupz3pQ9+KA/Ma/hzw1hAa8JG/fMPz8Dhr541k3M+ +H6RxVZAMgxV8yjpTXC91ZUY7YfeSqi8YuS5vnkrdUjFgo8HcdAaIxiQwNVrR1aeAR6CgKKZL0X AFbgQKq8= X-Gm-Gg: AY/fxX6WqgcyNZllrHvlYbvNKaoVwgOyben3AKo/HHCu4+h53L68lKj0HwuZM60kzCY F5mNDoyUlIMxU1T+b3MPnbXjnoq1mlaXHcejqea+oS9n93tpXehsNVM/ezwD2rV1CArIdFGSPzZ UVGIIgD8VSb3WhK/iPCP/UYPKD9MA6J9CNuL52vfUJWbnk15Y/dUQ/qsKHneZ4yMw1H3YIPKfkh nq1nReL8SLC7A92uMJuNQ+8kuddl7rV9EjWhdbNrIdZRKBboZsIf1JbNzDDOo4b8mmrGZh8BWdx wX98UaMEiPv8k9zGbXBPu6XVf958V8uR29MtE692Ldq5/zVANsl+l4k8pSHyEBG6hnSs8COuSgQ SkhKHTL0zbLxjbRT5eXbEVm9xVArYZwh/5GoUVxAoSBAA3h2YqXynCOoZQCzsQdDgE+jDJHZk2h UN3bZyPd8mPFxXDFncA+FWNPB1/NwHGm5rWbOcR0IO+OGR/em/C9jygFG8LjsH X-Received: by 2002:a05:6000:2dc9:b0:430:2773:84d6 with SMTP id ffacd0b85a97d-435695652f7mr8157855f8f.24.1768667389858; Sat, 17 Jan 2026 08:29:49 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/8] monitor: Reduce target-specific methods Date: Sat, 17 Jan 2026 17:29:21 +0100 Message-ID: <20260117162926.74225-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: 1768667555310158500 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 09: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=1768667592; cv=none; d=zohomail.com; s=zohoarc; b=U36eRyQVX3LXJh+Olvk/8pA2dxwDOyDudxbK2ukBnORw4tab0vhVRlHoCbOnNBzzCfxILxazTMv+gAKNCs2Dbx9U9kxqHBX7uvEDYxuioYgYXB8RhyIlyVpX+Ix1zwuN0g7DkGwfIr3WZJz9aDO4Pdos9HikSipuXe3YkP+q1v0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667592; 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=tTL19823FH19/6si1G6zkC5F9UNrL4PM4Uw7tbX82d8=; b=O5Kxb7y0Hgaaw/KyrycYI+5L4sJtxMrTxh8At7rRMqho8Xcz6igJujvIkCYq9+Gz6GRadMP//nYwvSLRjQyT72U8pZ7DpbzF6ZTyGSCenDylgu5R/dNiKKMVsh9ONMLtFHUQfH6dX7w97flQT5GyaTo5vK5s/IpfkkbOytQL2IE= 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 1768667592363197.1992122999278; Sat, 17 Jan 2026 08:33:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9Bd-00040f-1T; Sat, 17 Jan 2026 11:30:05 -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 1vh9BZ-0003qh-TK for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:02 -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 1vh9BW-0006GH-QY for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:00 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-47ee301a06aso26559855e9.0 for ; Sat, 17 Jan 2026 08:29:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4801ea09747sm41825295e9.7.2026.01.17.08.29.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667397; x=1769272197; 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=tTL19823FH19/6si1G6zkC5F9UNrL4PM4Uw7tbX82d8=; b=iWBaOWXQl6HEktbzAqv6Lza6rtMf3GZKb6zGPmurC51ZKeqjc3MVXyuZpr3fKC23Ir jdGJDKx1nwsY+95/iTztQARLB/eQzB1ABUYAYx0BrbXKWajdgSneRrLeMSj7qk7Kqilp OLVvDmchpqe8REy0gZKtvrHPpetrrNwhIM65NjQo2xwZq5HNuA/O7wqrsXHXBwuJi52M epsV7lt5wXBC2QvBSbA/hkxPvyQInW9teqzUwQWuk17w+95dcTxH2ZSfvzLfzlSK8aHo 7sIhM42Vzlk+juD+o6R04Xy355vOPzllwfhkVOkbqr22F6WyPYwKohZl9ZCdEEMcfzYi iu5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667397; x=1769272197; 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=tTL19823FH19/6si1G6zkC5F9UNrL4PM4Uw7tbX82d8=; b=AEilEee32do2vsPQBIaKZw/jICZ9O/SWrELRbuFCb4CrEPgNqCYdtvI62K+dBHlwu1 0CKLNNcwr26AhwhZRB+xKY3HthiAk1EmwNZWvOkDKGmOM5dq/8nUMc5NF6YzB9htQSch DdC0aJHKiNQDH9gGnetc5BxBoRVOxDBQR8C4n8I5Ta8y2o9x57DLaIx/FNApHHQsQVnW YXtEmO9ExhAwYjHaOqhypuVP9aWqNmaHrGzb+0ffdmpXNipCkuttN+PX87HCO3qrHLHr UE1cGxarVzbd+fZkH8yHflh5Ha+EESj3UdYZEovSIqk2rhwAy7tfJFAirfOLyfrRVaxQ pDXw== X-Gm-Message-State: AOJu0Yysr8j1Wvq9h6cVUG+SbpsCW3QVXBbR8Fn2XNbTRyG8pEAgDRZ3 Cy+QySrTQ8CQXJA9A3AMOq0qk5woaON4B2faCZXQ7cSf/SFkbKcWFhZcBYxZ4wj/+9VZmDHZMUI NPO3LmZg= X-Gm-Gg: AY/fxX6+Bf7KA11ZRc3grDXE2IiD2K8Q/RHKdkO+0kgUYekGBIT/sXL8wlti7yPd7EI ifvI91FwY3jMu1oM7JYJk7pUM4X/Y1G75edKO8adeiMNNavH4hxWPEJ4HHK2RRVTaNZSWE8FtPv UNgtLk4LEMe2dqacJAqLQ1uZOly/ZQKaYOL3odgo5WVfxMIk3ebzgk/eTYCXVJDnpxQurKWNYAi AdNVIobzdbZ2QCL1RzTGV+F9UHsYZVJCfIFFtGY49FTqNKzFwrtiKSaiCa4lR35YwrpejcJzc7o +bf7zXyBTzNax7zO3ZBnWDb6hheJ3gi5+aHzBW9h8Hlt2z9Vk4K5Ogwq3MOwwNPU3kT3xGBXEZ0 Q/xD7tvZTBlhqUTPLOzIEBk+/JGmSIjgmehN2P2kV0t0yl5zxe5AhdfDHV9HCtD6InIzjUW67Ss RKUKS1dvRKlykneXZsbRrWoooNA87awHzDFO+fZhLKNn7wOXqCjCphaJTvFNQ+ZH4DZbeisaY= X-Received: by 2002:a05:600c:37c8:b0:477:af07:dd21 with SMTP id 5b1f17b1804b1-4801eb0d71cmr64769005e9.25.1768667396953; Sat, 17 Jan 2026 08:29:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Nicholas Piggin , Chinmay Rath , Mark Cave-Ayland , Artyom Tarasenko , qemu-ppc@nongnu.org Subject: [PATCH v2 4/8] monitor: Have MonitorDef::get_value() return an unsigned type Date: Sat, 17 Jan 2026 17:29:22 +0100 Message-ID: <20260117162926.74225-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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: 1768667593575158500 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- include/monitor/hmp-target.h | 3 +-- monitor/hmp-target.c | 8 ++++---- target/i386/monitor.c | 4 ++-- target/ppc/ppc-qmp-cmds.c | 25 +++++++++++-------------- target/sparc/monitor.c | 8 ++++---- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index b679aaebbff..bd9baeaa3ad 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -32,8 +32,7 @@ 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 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 420969bd6eb..3fb4fb12508 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; + *pval =3D *(uint32_t *)ptr; break; case MD_TLONG: - *pval =3D *(target_long *)ptr; + *pval =3D *(target_ulong *)ptr; break; default: *pval =3D 0; diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 99b32cb7b0f..cce23f987ef 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; 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..3e1f4dd5c9c 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]; --=20 2.52.0 From nobody Mon Feb 9 09: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=1768667546; cv=none; d=zohomail.com; s=zohoarc; b=QIU53zroznTBdhoy36qWSyuN2h4oqUE6Bk+Ieqw21gzSeEG4MO50NibE4kXJC7X00vmUgqMnCzppTpfusEnc6WGdl5qSumx/byd1rXmP/POnAygU1YSq45AaMFAX7c/algL39+pOSqYem70EzOQcuuflJU5uKMCtyw5cLVUKOKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667546; 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=Wg6Ic+tut9fOwCqqNsv7VAskSr0QtGRBRhw3Vb7WYpA=; b=BhuXG3hjZOHfKrQp18BsGbQlTfZapNXjNovnJjlMkuRdIQ7oc4jwVhMIU2MMnViUGfZ8q+u2R8qH4lDJmkljEBIPlKNFkTKmisY6bGthFsJ+2Tmoi8fKPT+0dn0P/n5vkCOKuXT620zgs61n9h5zlrxGLqyPwRXxG3LctEgJtwk= 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 1768667546400721.0744020919132; Sat, 17 Jan 2026 08:32:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9Bh-0004D3-Cs; Sat, 17 Jan 2026 11:30:09 -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 1vh9Bf-00049S-G3 for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:07 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vh9Bd-0006Jm-OO for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:07 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-47d6a1f08bbso10056555e9.2 for ; Sat, 17 Jan 2026 08:30:05 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4801fe6e703sm41238005e9.18.2026.01.17.08.30.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667404; x=1769272204; 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=Wg6Ic+tut9fOwCqqNsv7VAskSr0QtGRBRhw3Vb7WYpA=; b=teFj70ewYWY8JOVUhUR/vJS9J+w2FzRISoBwBn+LCb7FIqWL/uYyu2o2nSnBOaAKJn ts7rlvk/RWdbbOZtbxWyva7z/n3Iyc3rw3Y8F9elnUaoU1N8C1cJE33cLVyknD5KWoly 7JgspDA//EeN5VesCqZIo5YhqqxsVHC6htxTBsAlwWQF23m1IH+ef2NFDltWmzQSkpBV 7WUBNNVIMhlLI+FS4Pr/zMcBZvBSKbijFQsYrdIJsh87LzATmKsPMm5gv2epEGuNP6qZ wfOBfUCad6lt1TEA2RBcyOgUj207Az96hJ8hnzrfyiNkIMy+3vwukBadMt0O+6Nk3b0f fVZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667404; x=1769272204; 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=Wg6Ic+tut9fOwCqqNsv7VAskSr0QtGRBRhw3Vb7WYpA=; b=Y0WWyL6dEWwSseeqxMgbyYXojv8PApNDY2f0p3/LJguJ1Rnco6oOJnrzesYs6lTQiC 2fEV/qthEcyvs3DCBybcxmU4rs/0/ckU/MOpZiILdEOTy/FeKgErfujSTS0R0eJ8VmFa 5qPF7g3v0HN92Ps7eS/bGgXrvZrhUHYiNnjTcgmguWd9eh2X8cUklN8y/QdArpf6QnPO SGQPSI3t5U55alFAGmE4h/qQO1GT25aTLJ4Wkxhb3vu1wV8WJR3xGVObBKO5mUqzgKnp mRPzjBLLc3lfUyC8IFRDnBMQyiXH73qau5F8uMF8/Icoi8KUpyB13aJRZy5USZ0lX8X4 I0mQ== X-Gm-Message-State: AOJu0YzzP46Y17NqchJo7/8P1/hDRnxqLJ+haHv91F/J7PopcpfNr7P6 EG1Vw7ImwjvXPBGBNRML7fLorBZOxFQT/LHf3OJU3S7sxUl2K+HDv3+lvfNJLqpABOI92NU0oSf iuiufHpQ= X-Gm-Gg: AY/fxX6Ho3DROMqnLeAquuWSohbLn+acC2pQ/7W7oqlBWavY0GQ4N3v/UtmuyPaK9HA 50IX3wmM/OnQkqaSGarkKWbnwkGcIrmZ0za8UtGy4RWt5yX5vLLQcmFIWO4Ts90nvR8HtVViS/6 QCqpRVODLPMDqY8Dp4EdYCdA+VNznT8aoRDdXn0KqVRlp20rRKDs/1mEi1skSP9DJ+2JuUckGwi TenR/TjEHJ7jssBTzq9l4TZa04CKjKWQDpoEJhL1RZHknwcLk+uWcq9sT2OiBvEUHXVI/7u2nTd otyDFacEbrp0rcz+HaCJ097GC9fmRv8T/zfiQSqPgO76W4sDk4FT7WaMvzfMME97X+Z3DRsFZCU 8FXyQcmxU3/nuURicdxv+x4T6o1bwYkOYlYITt+uSQ8fu4UWdHl5QaDAdPi79JSrg2+0eU6kLhq KedalSSD8Ki1t/tOvEpBZte8aRuSs9fzfvLWTrPdM9nFBjRQVJu3ukoJHfLPaRz+WGgzPW5jI= X-Received: by 2002:a05:600c:350b:b0:47a:814c:eea1 with SMTP id 5b1f17b1804b1-4801eb14fe5mr68133225e9.35.1768667403821; Sat, 17 Jan 2026 08:30:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/8] monitor: Have *get_monitor_def() fill an unsigned value Date: Sat, 17 Jan 2026 17:29:23 +0100 Message-ID: <20260117162926.74225-6-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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: 1768667547294158500 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 3fb4fb12508..ead195f5616 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 09: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=1768667592; cv=none; d=zohomail.com; s=zohoarc; b=gRu6usGGS/jgZAVNNtTvNjOlZwvyPFIC5UfnlTOTQBb/eXGnRLLTUtZsZR+tIgyhmgJ2RpdxHpwE9srno1zy4SUASnNCpA7lr+WmAGBtGAi3V+qX7EbqMsRKdj1qyyzRMOhjf3RYDW7EmJqEiRQXUP6poM5uyqla3XZWgy/L7ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667592; 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=DAVAZzpdqcWAjflTRJc0z0IisnYQy67T0tWSukHOWes=; b=UAbITgQt8AgDdneQqVYVSYJ5t9wfRhcIgvnujDnv9XLVT6IbC/2HInqzmfnIPGVFp21HTPdXr+yKhpv5iYe6k8PH5VJzC9ImxnI8gB3Zfa9edzrnDKR9STdHc0S+Xd1cPwGOQRxDi6MVtDsD41Ef7Pcvk3EMo6P028nA8am81Ms= 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 1768667592796798.8461796074122; Sat, 17 Jan 2026 08:33:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9Bp-0004X7-9R; Sat, 17 Jan 2026 11:30:17 -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 1vh9Bm-0004R1-GE for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:14 -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 1vh9Bk-0006Uk-QC for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:14 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4801c731d0aso16349195e9.1 for ; Sat, 17 Jan 2026 08:30:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43569997f41sm11326816f8f.38.2026.01.17.08.30.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:30:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667411; x=1769272211; 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=DAVAZzpdqcWAjflTRJc0z0IisnYQy67T0tWSukHOWes=; b=Wr9rc1hyQ1C+3X39p+0YyI3+Jr29o0/aMucBpLee+7wi2M1qyjqIO9RxQ83ALC2kTq vepV4cz17lSE7Iqg1DucMa9mSOZaAig7hhhhTenKX6RHM37Tgp5e04y3MPC947+Atn+f D0XQwTSaZYxVQ7beUVhaU4ah4sph+OVx0Xmd/SBv3eUPcK4ZIVXLaEhjfZ167OD2HyZz 5J6TGxXgDi6lnYydgKAj1clb/YHMnBfV7Wpmd8kjWJWzowFtO5aRixvV1QMY+7+JPsbd 9aHvALtnhL+X0onFP+1SF4vZlFEjPx5v9ZqXcqJlSOxfbqvGZI/WQG2bIaI2sn7IsZBd vDtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667411; x=1769272211; 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=DAVAZzpdqcWAjflTRJc0z0IisnYQy67T0tWSukHOWes=; b=OhcdevKbysWj/EXQV9JUBXOTL/MYvpoT5VEE+uGrMfjOh6g5KooKkWiZp9ROL95A4r /VfQopdwDKnohDJKvsSXn5utT7nuBaCy87VuP4AuST+9O9V3VqmbP2ww6ns59a2xuD63 sy+YZyu39CMGQ63/8zQ+W2fvCosQ4fmOFicwloLObMW8yFWi0zDSdKmMJLe8ROkaddUh UInZyZiOnYgiuazbXYEZdrRkwFc1UrX0osJ+jrtQSZXbTRpvIVkuPjWYNwPwQ4HsJBmc sqtSibQiaiEkkNTswo3sD3Onn2H1IjfbPse1XTrp24k+6UOurcdUC2bYde8I32pm/dUi +eiA== X-Gm-Message-State: AOJu0YzL5vUJpAqmwRYQz0Qc05n8qGly1M/sQNqh3gIIziwnohxRBrAt ZiGsZFTDT/7uOt11d3NYQotd1PGXUbulTaJDfUor9bcUegkLGJlj8e9IwUfwldwgmwB0uMt0pQF tzJL2aZk= X-Gm-Gg: AY/fxX6q+vCKncv1lR6x2Xtw4Tjmy8TFsHfXwVe3MFTLFQCKbpMg68li9KzcDl2ibXz 7xtzEXaJZNL3M3FZSgMG6nETlYZGkjRe4UxwoW6e1p6rEzh0iRSB3W5bx2LcqxqOmXtlnhQM9k3 lEfcdZz5aV9oEN4XqN6mFpruQbNUhmmrsttHD0ojAZiF0bLuEErdvSYcjay03296jH3Cc8aXfHA EXUaYGrXdC+wHlx05g/RGihYUGP2o9eHMgGIxLJObIiaEIzKC44potEacBLR+y71VZKYdLNrbAc R8l7Q9SNaP8kyj6VJMxNm8tAVqO1pDEmZuDbzS2+OlfJYAhATSBQEtCfAbPC5eUAYa2PKRDtGwe eydi5OBqme34Gok7yx0Z6E0HtLt43popUv3IqMjwL6T8jfLBpi6SEX/DoDPi5B5PSXnobg8bWVP B+9c7dqqO3shlbJ06CpAIQtTCd7v/DYOUOYP4xzuriTPV9qzEGBujRbdVQmPyI X-Received: by 2002:a05:600c:8286:b0:480:259b:3705 with SMTP id 5b1f17b1804b1-480259b3772mr40982105e9.13.1768667410853; Sat, 17 Jan 2026 08:30:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/8] monitor: Truncate target register using ldn_he_p() API Date: Sat, 17 Jan 2026 17:29:24 +0100 Message-ID: <20260117162926.74225-7-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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: 1768667593469158500 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 bd9baeaa3ad..713936c4523 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_TLONG 0 #define MD_I32 1 diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index ead195f5616..01be0a0b426 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_TLONG: - *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 09: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=1768667613; cv=none; d=zohomail.com; s=zohoarc; b=aGT5U35b3efmoo/i4JW6GfWGqLK66FOcMU7luxca0D3Br7mZpDw3ZiKovp11l6vDNyLECN0q7X2zk+4KUz7PpmISM0u55Zh/zVhmgVt7GLghxj7qnnuApCE5FojnxViHzQ3wdP+FQ1YLT+P0qUan4jDoCUZb6p5QUkx6sGaYrWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667613; 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=7KLPgnY4z2NoWwJMvMcqVp296qKYfzOFpZGS8HjN6AQ=; b=bb+UAXrVqjOn9J8yvXsUTCe7zucRC5n3XMOw+YvaGDVPcfpSwMjIVQw7RFDDS4a70qKtnAJRlzjLLm9Dxn13qAWZl1/pyMzyIi6pvvQHYKe2PjmRzumWSuqwBsKuk6Kasu/5Lb8vg/v53xPRgiJJwRp5l0WRIsSwqLGQ0Lr24BE= 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 1768667613770106.67165583023939; Sat, 17 Jan 2026 08:33:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9Bv-0004lY-95; Sat, 17 Jan 2026 11:30:23 -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 1vh9Bt-0004hF-6D for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:21 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vh9Br-0006VJ-Di for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:20 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-432755545fcso1675195f8f.1 for ; Sat, 17 Jan 2026 08:30:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356996cf58sm11904030f8f.22.2026.01.17.08.30.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667418; x=1769272218; 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=7KLPgnY4z2NoWwJMvMcqVp296qKYfzOFpZGS8HjN6AQ=; b=Unb3pzZO9xRWopolSM0te4OnMEzMxsE+L+EgmcRsaBBHBT8PlP8O0yvvuqYULiCTZ9 al+vtEqqwJ/6qxdgGUaTM9+08UW/dETaPLt1vfc/ExxC45Dz4cfNB0XUxlrle3P8SLVc EJImNG899Te4DN7C/s3nY9BCisgYSP6+ZKsW9l4V6n23rfE15xFYODPmLniKuP6YCsOk tVvNt/G2PfVh8GyOw+MtXo/od6RwIpzSWSeucP1q4wBDJP/52cNQQjiJykJA/Ptktbtd nXte7nUvcp+rVakgfjMz3wvihPPRVFmlDB3JA0FH6SMoTYkTabuSeh5vd75rkM3Adrjp Wbbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667418; x=1769272218; 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=7KLPgnY4z2NoWwJMvMcqVp296qKYfzOFpZGS8HjN6AQ=; b=QAWAXDeLJn4MYCO9uLSQExZ8iUcQ18cfobwNHBuypPn7Nx3uAELIhZ0poLJYuBVlNY e0gI5QBKpKPx0xF2UFygm222uY8T8ErP3Y3K+f9Ytw5+Rg07AMhQo2vs1K0FtkUa3aES TA9dG3jb/Gb8VyhsJNktDH3jEmmkfQm7qfWyTzPQVxYdUwzAzhqEozJyh9Wm9vqb5j71 4TmfwSaDiPZ+/aOnkMu4SJkC9z05VKLfZfVPhn2o7oMwmqCb+pX9GWAr/KeZ6nRL7Qpr mA9IiDNIBv3jLUPjO5YYEM0hit0b4NnWwMjesH6vzBZpRLRQwr4v/aF6QWzDvR75CA9N ga6g== X-Gm-Message-State: AOJu0Yz+4/hqNpjNgO4VZEqc4qOW5elYJjjVbUT/qMu3cUe9Z3hdkSos 9/7gThzcBn9mUOQOg145wbGzv/V5Lui80VJhkcutcx8JgcQJ8leHrDO1nsonFQ1Ipbiq1z77DUg xWMhU4kA= X-Gm-Gg: AY/fxX5UzKShTgcEkUvuo/5YRR4+PB1HgyxHILnVljJCn5dh4sCEBymGF+fopY9wjNz h60hrTGcAh0G7pecUQpeQYSFKq/IyTmLPvaIXbRYHcmOT9D0nCTGzusYP00VHUCm+F3BVzMREU3 LVAwJcx0QeLSXtG5IZpHdyNl9tGeIUUSBsmQUw3jwCcBpeOnYlQXy3XxmR7zOd1ASHT/gq4cCco gsSDL49RPZsnxfl+/GfUkD62ix0Q0rDTzRh3HrXMIdAJVcTZzg3XZl2F69WK01OfkuVlULqlnCT vi703TLnd/h/QuH4qd5KAabHH4MtSdfB7md+UgfqyCc8KdrR2fW2bZX3fA08MeunZImH66qpEvz kMqo14jXYlFnlYcVImfk+3OpIMVwk6gcaYlUNoavEXHy7V+csAY+MGZoI8idnjkEeOmsEPLTvpA v0oRWmKlK3dmMAaV3s5VKkGFO9zQH0fBbyR6/j8hj6+50D1pza3duDx2GMQERI X-Received: by 2002:a05:6000:2584:b0:431:b1e:7ff9 with SMTP id ffacd0b85a97d-43569bd2ab0mr6476114f8f.59.1768667417672; Sat, 17 Jan 2026 08:30:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 7/8] monitor: Reduce target-specific methods further Date: Sat, 17 Jan 2026 17:29:25 +0100 Message-ID: <20260117162926.74225-8-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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: 1768667615713158500 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 01be0a0b426..a3306b69c93 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -23,7 +23,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/bswap.h" #include "monitor-internal.h" #include "monitor/qdev.h" #include "net/slirp.h" @@ -60,54 +59,6 @@ HMPCommand *hmp_cmds_for_target(bool info_command) return info_command ? hmp_info_cmds : hmp_cmds; } =20 -/* - * Set @pval to the value in the register identified by @name. - * return 0 if OK, -1 if not found - */ -int get_monitor_def(Monitor *mon, uint64_t *pval, const char *name) -{ - const unsigned length =3D target_long_bits() / 8; - const MonitorDef *md =3D target_monitor_defs(); - CPUState *cs =3D mon_get_cpu(mon); - uint64_t tmp =3D 0; - int ret; - - if (cs =3D=3D NULL || md =3D=3D NULL) { - return -1; - } - - for(; md->name !=3D NULL; md++) { - if (hmp_compare_cmd(name, md->name)) { - if (md->get_value) { - *pval =3D md->get_value(mon, md, md->offset); - } else { - CPUArchState *env =3D mon_get_cpu_env(mon); - void *ptr =3D (uint8_t *)env + md->offset; - - switch(md->type) { - case MD_I32: - *pval =3D *(uint32_t *)ptr; - break; - case MD_TLONG: - *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..82d2bbdf77d 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_I32: + *pval =3D *(uint32_t *)ptr; + break; + case MD_TLONG: + *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 09: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=1768667520; cv=none; d=zohomail.com; s=zohoarc; b=brcnblCqS8d8S0ss03tQTVtNP7fyq68lBWmLwS3hpUxvKwlayFuxrA6j0Z9LYVNUz0cxQ+r9wvpfUmRKIuxoA0Z0x0KdaPINUf7tD7jr3NnMgElWPJlOeU2dtnEn7f3caebzCKpAS0LYLVzYUZ+ZQXRUTzIf0htEkACa5z+rqmg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768667520; 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=JK1bLOADrs29MiINWo9DrQI2aKUVmVhFJeqP3VoFJ8U=; b=FGi9s7iuoGiEgcmVaKhGkF/croGQDkyHUJHbMkG36cgh43XECp53iPw5btzZlYYhuDrI9cMOTxQJObr30nsBCCb832O7/hAWjiAAAaBr4qklNBumiZ1CanLh1U+EexbBg1Raw4Llbu6r6ULUCOxLb2KleOFGlvXf/sPD6kPDJyY= 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 1768667520704937.86238049089; Sat, 17 Jan 2026 08:32:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vh9C8-0005KA-0Q; Sat, 17 Jan 2026 11:30:36 -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 1vh9C5-00058F-2V for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:33 -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 1vh9C0-0006WT-9J for qemu-devel@nongnu.org; Sat, 17 Jan 2026 11:30:31 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-430fbb6012bso2325154f8f.1 for ; Sat, 17 Jan 2026 08:30:27 -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-4356996dadbsm11972737f8f.21.2026.01.17.08.30.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Jan 2026 08:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768667426; x=1769272226; 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=JK1bLOADrs29MiINWo9DrQI2aKUVmVhFJeqP3VoFJ8U=; b=opdrbZdBGP0XnKjgCCQlUXH+vHgdAC5+xmKLlTCp4ykAqx1kuTnbQpKHnUKt2/UMMt 1lecH2zoZ4dkT7o3Ac7PsnYAp220d2+1CqhTvCNIVTQtle6Mu3BIXNNRyoBPWDBuEix0 ka/t0pGLTBXZMi/cpgkLV0g0QzdJxnoyyBBLznuLRKL6ACH1Ea5GLLYQbZR6LZ7uG20K yF1f9xImYoFNqMQD1CmmS1aEFQsfaK2tAV9DIBvcRU0u+ldhjLqCaTxSwU3uW4g2vCuR 2OOwRmozaYZJiXLnNaSe4xfoR4ISULq0jmuJbFeMlCuieF6whjE3StcMlqvgv1U/YF8k gchQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768667426; x=1769272226; 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=JK1bLOADrs29MiINWo9DrQI2aKUVmVhFJeqP3VoFJ8U=; b=dSSFkGj61t2IE8aBIz+9QENdE/M8FJB1KysYu4kRLsHd5QWeSXewj0eMQCFHeZkiCh +9xzO3D3kvf2wXNxUF2eQceITjuJ799F2q8ah0KHO00RPh3NVsurZ4eDyx99cHGrBVx+ IT7gAau6IGSmr+bHLMZgZuR0qshhjcKApIuD08OrlHFfYRiWFab/jGKVGYYTlKOkdkKQ cpbeEkTCF0eWE0vPFDC1x3zZkl4Lv6IarewEWA2rbB+d9uX/7JKvh8svD8Z7TaJVwEXy FjNEj+ancQtpJXuKVgOMND4UXU602Pxhj08du+0bh1BT8/MiSzbgf6W7iszaxKVs6euR PnLg== X-Gm-Message-State: AOJu0Yytc9HA47kVOSIERg1RLRfm1d67rhHfKWRkzlcgrmFMe4P8HyoN 5ndk6+y7I1ID9IezabxTIUS5ltTy7npnH823t3ycWvCKHPUhsfxVpTTZu14GiHnzaFjyvK2sZgE /fdDhAns= X-Gm-Gg: AY/fxX6dxd0qQv4l1W0qClB2UCjrUgg4kqOWm2eFt93maaLZFYH8P7M8UPIWoF20G+q 3RSgN7yQe5pjH4qMCQvDXS50I9/TPpnshcc6vGorM+VmmGcg0+jmRb/0gqaIibozaRrDszuMGGB kR00piqCLXzwHyaukS7QoIQFPVtrRQcC1nyE113Jh9FBuyxWX40nOjo6xRLT0R4KGsJuJ4sYerC CYZ3v4s14spTic9WghqPZcdvqtF5xzzbKUo6tRkcF7H6/Z4KfzMzUnAgHMYGjF6UwSV1OkJ8L9g 1yX63OXvZKUn0jGmfeyyWx4bFzhVz1BerMKHe3hdzvGCxlygHIL1amiuChe1NWg2BN6rRCdelnR xeCBmQ3lriQXZ+RHIjaM+M6jYQtEzuzruxRT8rxCLLk3iGHjNBt59uWDN3gA88NrFY3vOk/2LFT hs24drdGH0N6oiQgfIQmNO4Mwhge7YiWk31O63bbVztcfCmpjU25WsYrt1DvhG X-Received: by 2002:adf:f28b:0:b0:435:6f0e:2e5e with SMTP id ffacd0b85a97d-4356f0e3006mr5755131f8f.62.1768667426326; Sat, 17 Jan 2026 08:30:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Pierrick Bouvier , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Zhao Liu , Marcelo Tosatti , Laurent Vivier , Nicholas Piggin , Chinmay Rath , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Yoshinori Sato , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov , kvm@vger.kernel.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v2 8/8] monitor: Remove 'monitor/hmp-target.h' header Date: Sat, 17 Jan 2026 17:29:26 +0100 Message-ID: <20260117162926.74225-9-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260117162926.74225-1-philmd@linaro.org> References: <20260117162926.74225-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 (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: 1768667523521158500 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 | 60 ----------------------------------- include/monitor/hmp.h | 31 ++++++++++++++++++ hw/i386/sgx-stub.c | 2 +- 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 | 2 +- target/i386/monitor.c | 1 - target/i386/sev-system-stub.c | 2 +- target/i386/sev.c | 1 - target/m68k/monitor.c | 2 +- target/ppc/ppc-qmp-cmds.c | 1 - target/riscv/monitor.c | 2 +- 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, 38 insertions(+), 78 deletions(-) delete mode 100644 include/monitor/hmp-target.h diff --git a/MAINTAINERS b/MAINTAINERS index de8246c3ffd..1e0d71c7bb8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3377,7 +3377,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 713936c4523..00000000000 --- a/include/monitor/hmp-target.h +++ /dev/null @@ -1,60 +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_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); - -CPUArchState *mon_get_cpu_env(Monitor *mon); -CPUState *mon_get_cpu(Monitor *mon); - -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..fb678786101 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -17,6 +17,37 @@ #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_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); + +CPUArchState *mon_get_cpu_env(Monitor *mon); +CPUState *mon_get_cpu(Monitor *mon); + +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); + 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 d295e54d239..6e82773a86d 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" +#include "monitor/hmp.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 e2801546ad6..54d2cae36d8 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -16,7 +16,6 @@ #include "hw/mem/memory-device.h" #include "monitor/qdev.h" #include "monitor/monitor.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 5a673cddb2a..7c2b69dfa5b 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -21,7 +21,6 @@ #include "gdbstub/enums.h" #include "monitor/hmp.h" #include "qemu/help_option.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 82d2bbdf77d..4dc8c5f9364 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 eeee62b52a2..3b73a04597f 100644 --- a/target/i386/cpu-apic.c +++ b/target/i386/cpu-apic.c @@ -10,7 +10,7 @@ #include "qobject/qdict.h" #include "qapi/error.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" +#include "monitor/hmp.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 cce23f987ef..1c16b003371 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 7c5c02a5657..f799a338d60 100644 --- a/target/i386/sev-system-stub.c +++ b/target/i386/sev-system-stub.c @@ -13,7 +13,7 @@ =20 #include "qemu/osdep.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" +#include "monitor/hmp.h" #include "qapi/error.h" #include "sev.h" =20 diff --git a/target/i386/sev.c b/target/i386/sev.c index 1d70f96ec1f..31dbabe4b51 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -36,7 +36,6 @@ #include "migration/blocker.h" #include "qom/object.h" #include "monitor/monitor.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 161f41853ec..05d05440f42 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -7,7 +7,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "monitor/hmp-target.h" +#include "monitor/hmp.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 8a77476db93..bc176dd8771 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -22,7 +22,7 @@ #include "cpu.h" #include "cpu_bits.h" #include "monitor/monitor.h" -#include "monitor/hmp-target.h" +#include "monitor/hmp.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 3e1f4dd5c9c..79f564c551a 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