From patchwork Wed Mar 20 16:40:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781381 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp401141wrj; Wed, 20 Mar 2024 09:41:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW9A3F5hNXrT8A38dc+M0NlYuAHXbt3s7CIlFpUrqtBaZrfP4DkgdQQYgD6faah0i7fSGf1NShC87q3vlxZlUky X-Google-Smtp-Source: AGHT+IEHDG3i5CeY9bZyjolTNmL7uRpzJrKpibDMy7lpn/GpiVToCAWIg80v+h2Tq97SeQNpxuXT X-Received: by 2002:a05:622a:550:b0:42f:201d:14da with SMTP id m16-20020a05622a055000b0042f201d14damr2633206qtx.53.1710952907408; Wed, 20 Mar 2024 09:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710952907; cv=none; d=google.com; s=arc-20160816; b=L6/0tpWUpgFct/33DJ9LyetsFR22c2y1Qsgb4mKM7boi7r/AMifPWKHt6AajV9kfao 693T0HWMwyoYjllmUSYtdGMqx8HR9gDfr3l/fxnYSaOyw3wNs42sTIqe2/0WH6u/LlkI odgSqHQQOfUldPiPTolZLz+2eiQgNh6l5p36AgEqybr4Fpim9F0tXsez/J0W1yk2nsws Y99e4rBGqmp2Up/Ega5rzbdf5LIu5g96Ed/7nm3Y7b5hVAiz2HFMaPnDzJ8TQmMpha7f Cvj3NSQkExXQ1HwW30wSEBWgaYqz4onYYKML4oqo0L06Pe359Yu92ngQI2+/LYqjPjwu f4eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uBipDkgk2OtHXrYLE6niKLfwVNhjxBZzSEhQS339zKI=; fh=vL3tIJyK9GNNOmMdmZtq4e+HUYWluXe03ixbXCNvRhI=; b=sB9r7Yxr8AStWKGgEcLNG6QIJG7G4yXplwCJfXM62Vci5g9He+JrkRFhxpF0MHKgib 8C7kxrx4I3Fvl3aU3/bDNwdtrs19cd3ri5UZni8eGZyRV2HdAlhT5pyBdbWcg7CMfj6z 1MK/XmEdP2WJOgOhlVBr8qmv8gmh4YHZbaI+qnogZbgdj3fM9m6OPN9GDJbNtPnSCa71 +gfPnTOsvPXaNPUqbuON2L99eARXKUqLFD7PM56Pyuok1+bDNYix4dqd/7vVsHRlP35C yz6rSYxXW7+22GBCjBkOigUnPm+PG5tSs3RfIyaMPzo1lSLncn7nDkkUQaLubwgnOv2J OW4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ohFmiGS2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s17-20020a05622a1a9100b004311546b378si1027060qtc.386.2024.03.20.09.41.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2024 09:41:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ohFmiGS2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmz04-0003Da-2G; Wed, 20 Mar 2024 12:41:12 -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 1rmz03-0003D3-5w for qemu-devel@nongnu.org; Wed, 20 Mar 2024 12:41:11 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmyzy-0008QK-Pc for qemu-devel@nongnu.org; Wed, 20 Mar 2024 12:41:10 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-512bde3d197so72985e87.0 for ; Wed, 20 Mar 2024 09:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710952864; x=1711557664; 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=uBipDkgk2OtHXrYLE6niKLfwVNhjxBZzSEhQS339zKI=; b=ohFmiGS2BY2CP1/yiDcGfK/3+rp8rXqWXvA9w4csDmzV5SZGLi+MUYXypMbGjX7Mdi MawWrg/CBtwNe71+lbNvnxKpa/cslw91/G/lHCCW+20cMBxW15FJAUTlK/xS6gW3S6Ie FM+OlQQYkYl6uKdJae04TMNrstnqc3QhD4eD3aZqksplweVoXmuBasB5zP7Gp/xjkaCu Vd+iMYDsi1NYyOHmk9Srl9pPTA0ReHz47xnKYP13w9pCr6wFSFRsvkEfAamjd8LwNTnK UydnGDx7SX/KazDiR8gScP59i5eNxrSWeDbil9nWfWpazNiTQLD3muIUFL846Tm7C/BE lPaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710952864; x=1711557664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uBipDkgk2OtHXrYLE6niKLfwVNhjxBZzSEhQS339zKI=; b=IUqLYEtmZ9VZ4EqjiUUPjoFWt29sAryzydhdp8zJLhz4lLM2shcMkTS+fnWn32CIOk 8QdWxD03UVrZFQ/E3G4S5aA1ZYjqcrdNDaceQsyEL982Ll/kYXlIuxZJ8fpwn20QTihu I9RZJYUd/DV7IRlWEZ2KxZ8PKBGYyvGQZ+VFPC8mWG5cDVOWnKKRrQXLiGDntONGAOX3 IOD1ZXNI9iqXKys/HV+EdV0M/LyoHAveFczma6rjjf9BE186hFY3y5ncAptTzxd/0MkA eAp7k81Y5ngoyPE13qch9gVMFLEmTrsLbJTGwdyq/BZxMEEoC8yfOD83yjJ0cjtAFTu2 MONA== X-Gm-Message-State: AOJu0YzNna01tjhWalA3Cb8HdG5scq3vtO3APBGhwwiT8qTrQylvFv3f 7HfZmXTZ+yq2Gz1j7Jb5rByGfvmE7n38+z9zCcstlXC05x8IZEdYUyuFRSo9F180VXGfDDH2RsM 0 X-Received: by 2002:a19:770e:0:b0:513:e47d:614d with SMTP id s14-20020a19770e000000b00513e47d614dmr4932908lfc.37.1710952864623; Wed, 20 Mar 2024 09:41:04 -0700 (PDT) Received: from m1x-phil.lan ([176.176.156.105]) by smtp.gmail.com with ESMTPSA id fs7-20020a05600c3f8700b00414038162e1sm2668663wmb.23.2024.03.20.09.41.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 20 Mar 2024 09:41:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , "Dr. David Alan Gilbert" , Manos Pitsidianakis , qemu-ppc@nongnu.org, Thomas Huth , devel@lists.libvirt.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 1/2] target/monitor: Introduce 'info mmu' command Date: Wed, 20 Mar 2024 17:40:54 +0100 Message-ID: <20240320164055.60319-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240320164055.60319-1-philmd@linaro.org> References: <20240320164055.60319-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Introduce the 'info mmu' command. For now it only forward to the 'info tlb' and 'info mem' commands, which will be deprecated. Signed-off-by: Philippe Mathieu-Daudé --- include/monitor/hmp-target.h | 1 + monitor/hmp-cmds-target.c | 37 ++++++++++++++++++++++++++++++++++++ hmp-commands-info.hx | 14 ++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index d78e979f05..2af84b1915 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -44,6 +44,7 @@ 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_mmu(Monitor *mon, const QDict *qdict); void hmp_info_mem(Monitor *mon, const QDict *qdict); void hmp_info_tlb(Monitor *mon, const QDict *qdict); void hmp_mce(Monitor *mon, const QDict *qdict); diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c index 9338ae8440..71bce4870a 100644 --- a/monitor/hmp-cmds-target.c +++ b/monitor/hmp-cmds-target.c @@ -31,6 +31,7 @@ #include "qapi/error.h" #include "qapi/qmp/qdict.h" #include "sysemu/hw_accel.h" +#include "sysemu/tcg.h" /* Set the current CPU defined by the user. Callers must hold BQL. */ int monitor_set_cpu(Monitor *mon, int cpu_index) @@ -379,3 +380,39 @@ void hmp_gpa2hpa(Monitor *mon, const QDict *qdict) memory_region_unref(mr); } #endif + +__attribute__((weak)) +void hmp_info_mem(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, + "No per-CPU mapping information available on this target\n"); +} + +__attribute__((weak)) +void hmp_info_tlb(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, + "No per-CPU TLB information available on this target\n"); +} + +void hmp_info_mmu(Monitor *mon, const QDict *qdict) +{ + bool tlb = qdict_get_try_bool(qdict, "tlb", false); + bool mem = qdict_get_try_bool(qdict, "mem", false); + + if (!tcg_enabled()) { + monitor_puts(mon, "This command is specific to TCG accelerator\n"); + return; + } + + if (!tlb && !mem) { + tlb = mem = true; + } + + if (mem) { + hmp_info_mem(mon, qdict); + } + if (tlb) { + hmp_info_tlb(mon, qdict); + } +} diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ad1b1306e3..e31f2467fb 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -208,6 +208,20 @@ SRST Show PCI information. ERST + { + .name = "mmu", + .args_type = "tlb:-t,mem:-m", + .params = "[-t][-m]", + .help = "show virtual to physical memory " + "(-t: TLB; -m: active mapping)", + .cmd = hmp_info_mmu, + }, + +SRST + ``info mmu`` + Show virtual to physical memory mappings. +ERST + #if defined(TARGET_I386) || defined(TARGET_SH4) || defined(TARGET_SPARC) || \ defined(TARGET_PPC) || defined(TARGET_XTENSA) || defined(TARGET_M68K) { From patchwork Wed Mar 20 16:40:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781382 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp401216wrj; Wed, 20 Mar 2024 09:41:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWllN7xap9R4jH9b9Z0czfQv8GZnRAJ3YDmk3tZ9xjiFe+nZcHYJtdxVQhA1Jc6IXlzj8znM2G/boS2uetdw0J0 X-Google-Smtp-Source: AGHT+IG5vozKK3XhUR4iynpFRg2CMX3EDwJgLdPfDMeqRcDrYs64IzAEa6Z/efHYVIHWoYpZDrbl X-Received: by 2002:a25:874f:0:b0:dc6:d22e:ef4c with SMTP id e15-20020a25874f000000b00dc6d22eef4cmr12727780ybn.17.1710952915081; Wed, 20 Mar 2024 09:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710952915; cv=none; d=google.com; s=arc-20160816; b=hBcEatcWhOr5TS8k0ws1Y3BgzrxXW7chP0o/kaGlKlBg62OamO4f/rxXF4PIToMthe Barlpk4AoOLOHdKm9umWy2Z6hUAziMGsYO71eyfMxYjDc+QhB9aNJZsXjbe6cDeL5ykv //+npGrtjM6vwocIqBR9vQA+3TNbXhL/ng/D2GKgMMd4RyBrMAjoX0KL3fnaqqc0+Buo +VkMYkVirZBXdxmTxT2JkXou1jmDygk8P33OoaHTiZZLbrRwfin4ZbviWtx+pLCoAzPq PineVmDpHHpwsEUaR3QO3II+i1GBzQRIA8ouhHE3ufWGW8oQEFMFHzjQVgR6KcNwkhy7 6cRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+MGzMRq8+oQNHPDVeF5CNwlMfCJsHa78ZS0ftBV8+1s=; fh=8yo068XsMY8R0UJjjOMzqPjQHQBZMLsXFA3SxTmlmb4=; b=TIg5vR6+vBfC6gDfSk63Ur1mxesjLzGd2H6T8+Rhgx+8E8QIIuNdJmtHBYejaiCBxB /6//6y4hnH6DPUshixv9uT2avzeioMI2p5ka8ZySBKpPQ9X6Pii8GHezMKaHxR7inDbd zypc3y4kQb8P9CS78mq7SMk2n0OCmv9TbJzAG8eaSimYGIvExhLOzG+xHJDJqPqlyI95 /xiD4nvWa5G/XQ/lvDY8iZ/pwx4ozuXraP1YD1LBXYS3IXFpIx/+jgqKDSPqWDhhfBne YcPppojqGbUf8P/HWcxHF5Xvbug04s3tCXTWmh4tktOCiIjqNGOSSmIpFm4RWpLRJq3p uRhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gfRAEVYk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w18-20020ac857d2000000b004311675ec77si972122qta.463.2024.03.20.09.41.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2024 09:41:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gfRAEVYk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmz0G-0003MY-K2; Wed, 20 Mar 2024 12:41:24 -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 1rmz0E-0003L1-Bj for qemu-devel@nongnu.org; Wed, 20 Mar 2024 12:41:22 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmz06-0008RQ-Kw for qemu-devel@nongnu.org; Wed, 20 Mar 2024 12:41:22 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-513e10a4083so86550e87.1 for ; Wed, 20 Mar 2024 09:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710952872; x=1711557672; 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=+MGzMRq8+oQNHPDVeF5CNwlMfCJsHa78ZS0ftBV8+1s=; b=gfRAEVYkeMTqL3YEGlzNlTGYXSkLeHDKHwTx61+Q5TTtUQrMf5BlPuLCco9OXWAD+r uUC96TE2HowH902/0AdA/BhyV7Jul61MIp5AB2mMKROsxBRZbJGSVPLYC6EqTCO529Il tDfOQEwxWtlgxRNFNzJdVhVG34T5ElawQLrQ8NyapJVkkXXALwZLo2tGAiDbVUbw0DbA GwEfApFIzXS895tkXyx7OJ2w8HY+9Ixxc1qVgueGYQX1uTmFfL2TgF2xeiWNFzVoRWDC RR2IY+9MYZRNd5Kil+cgAwEzk6jmFYdt+0bStECm3dZkwpbvKccErIqstQR5CTUg5eW0 JO+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710952872; x=1711557672; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+MGzMRq8+oQNHPDVeF5CNwlMfCJsHa78ZS0ftBV8+1s=; b=fYBCAYUb6Zof+yVQdiDkQSqYfehEXua/9xcnAHVcTkMymzKMZvWrz37pURic5hvoKu 3iMx7Wvtn+xd8xyOmSABRSenv2vvDcA2bL+5CNust0rVjds5rkm0fXOZJbjezq6BTf+m Ggynpuo+EBWbG1lRt/amkyoEbbrOp5MNNX9kQDtuLuXrIm7vPqMz0hl1QcdOM8NGZqzJ zHSXb0L0pbnSiL6rglFdW8qXnjpGpS6Ojl47gn+Z1CjCcOeCmdVwmKVeKIKhwv7il17m Jdaqf2QwE7++A9A63w+XWkk9kpN5Gh0lO+RiQnnr0TTmqRqIldFwx/XSacVRMxiauQOz 8Osg== X-Gm-Message-State: AOJu0YwUQTBGoQ9xJYEjezxZHq2rgAJuSPbmkyVmj5Rm2LKfuluc/7C+ JESWz5E33YppEWacTvCuSjcMWh2JpsuRl6hKWIyjW9hw+AY7ZHRxLA5GpCA2sYcZnQG8oGGh2O/ j X-Received: by 2002:a05:6512:3687:b0:513:b1d7:6d07 with SMTP id d7-20020a056512368700b00513b1d76d07mr11689233lfs.58.1710952872399; Wed, 20 Mar 2024 09:41:12 -0700 (PDT) Received: from m1x-phil.lan ([176.176.156.105]) by smtp.gmail.com with ESMTPSA id x11-20020a5d60cb000000b0033eca2cee1asm15131511wrt.92.2024.03.20.09.41.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 20 Mar 2024 09:41:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , "Dr. David Alan Gilbert" , Manos Pitsidianakis , qemu-ppc@nongnu.org, Thomas Huth , devel@lists.libvirt.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier , Chris Wulff , Marek Vasut , Nicholas Piggin , Daniel Henrique Barboza , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei , Yoshinori Sato , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH-for-9.0 2/2] target/monitor: Deprecate 'info tlb' and 'info mem' commands Date: Wed, 20 Mar 2024 17:40:55 +0100 Message-ID: <20240320164055.60319-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240320164055.60319-1-philmd@linaro.org> References: <20240320164055.60319-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=philmd@linaro.org; helo=mail-lf1-x129.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, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 'info tlb' has been replaced by 'info mmu -t', and 'info mem' by 'info mmu -m'. Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 10 ++++++++++ include/monitor/hmp-target.h | 2 ++ monitor/hmp-cmds-target.c | 20 ++++++++++++++++---- target/i386/monitor.c | 4 ++-- target/m68k/monitor.c | 2 +- target/nios2/monitor.c | 2 +- target/ppc/ppc-qmp-cmds.c | 2 +- target/riscv/monitor.c | 2 +- target/sh4/monitor.c | 2 +- target/sparc/monitor.c | 2 +- target/xtensa/monitor.c | 2 +- hmp-commands-info.hx | 8 ++++---- 12 files changed, 41 insertions(+), 17 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 7b548519b5..4f5f4becbe 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -158,6 +158,16 @@ points was removed in 7.0. However QMP still exposed the vcpu parameter. This argument has now been deprecated and the remaining remaining trace points that used it are selected just by name. +Human Monitor Protocol (HMP) commands +------------------------------------- + +``info tlb`` and ``info mem`` (since 9.0) +''''''''''''''''''''''''''''''''''''''''' + +The ``info tlb`` and ``info mem`` commands have been replaced by +the ``info mmu`` command, which has the same behaviour but a less +misleading name. + Host Architectures ------------------ diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 2af84b1915..057f7c6841 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -46,7 +46,9 @@ CPUState *mon_get_cpu(Monitor *mon); void hmp_info_mmu(Monitor *mon, const QDict *qdict); void hmp_info_mem(Monitor *mon, const QDict *qdict); +void hmp_info_mem_deprecated(Monitor *mon, const QDict *qdict); void hmp_info_tlb(Monitor *mon, const QDict *qdict); +void hmp_info_tlb_deprecated(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); diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c index 71bce4870a..086b58b8d6 100644 --- a/monitor/hmp-cmds-target.c +++ b/monitor/hmp-cmds-target.c @@ -382,19 +382,31 @@ void hmp_gpa2hpa(Monitor *mon, const QDict *qdict) #endif __attribute__((weak)) -void hmp_info_mem(Monitor *mon, const QDict *qdict) +void hmp_info_mem_deprecated(Monitor *mon, const QDict *qdict) { monitor_puts(mon, "No per-CPU mapping information available on this target\n"); } __attribute__((weak)) -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { monitor_puts(mon, "No per-CPU TLB information available on this target\n"); } +void hmp_info_mem(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, "This command is deprecated, please use 'info mmu -m'\n"); + hmp_info_mem_deprecated(mon, qdict); +} + +void hmp_info_tlb(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, "This command is deprecated, please use 'info mmu -t'\n"); + hmp_info_tlb_deprecated(mon, qdict); +} + void hmp_info_mmu(Monitor *mon, const QDict *qdict) { bool tlb = qdict_get_try_bool(qdict, "tlb", false); @@ -410,9 +422,9 @@ void hmp_info_mmu(Monitor *mon, const QDict *qdict) } if (mem) { - hmp_info_mem(mon, qdict); + hmp_info_mem_deprecated(mon, qdict); } if (tlb) { - hmp_info_tlb(mon, qdict); + hmp_info_tlb_deprecated(mon, qdict); } } diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 3a281dab02..5da77b6b22 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -217,7 +217,7 @@ static void tlb_info_la57(Monitor *mon, CPUArchState *env) } #endif /* TARGET_X86_64 */ -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env; @@ -545,7 +545,7 @@ static void mem_info_la57(Monitor *mon, CPUArchState *env) } #endif /* TARGET_X86_64 */ -void hmp_info_mem(Monitor *mon, const QDict *qdict) +void hmp_info_mem_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env; diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c index 2bdf6acae0..ea303805c4 100644 --- a/target/m68k/monitor.c +++ b/target/m68k/monitor.c @@ -10,7 +10,7 @@ #include "monitor/hmp-target.h" #include "monitor/monitor.h" -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env1 = mon_get_cpu_env(mon); diff --git a/target/nios2/monitor.c b/target/nios2/monitor.c index 0152dec3fa..2e4efee1aa 100644 --- a/target/nios2/monitor.c +++ b/target/nios2/monitor.c @@ -27,7 +27,7 @@ #include "monitor/hmp-target.h" #include "monitor/hmp.h" -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env1 = mon_get_cpu_env(mon); diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c index a25d86a8d1..891fdc44ef 100644 --- a/target/ppc/ppc-qmp-cmds.c +++ b/target/ppc/ppc-qmp-cmds.c @@ -80,7 +80,7 @@ static target_long monitor_get_tbl(Monitor *mon, const struct MonitorDef *md, return cpu_ppc_load_tbl(env); } -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env1 = mon_get_cpu_env(mon); diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index f5b1ffe6c3..00f2a22f11 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -208,7 +208,7 @@ static void mem_info_svxx(Monitor *mon, CPUArchState *env) last_paddr + last_size - pbase, last_attr); } -void hmp_info_mem(Monitor *mon, const QDict *qdict) +void hmp_info_mem_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env; diff --git a/target/sh4/monitor.c b/target/sh4/monitor.c index 2da6a5426e..ad6f21defe 100644 --- a/target/sh4/monitor.c +++ b/target/sh4/monitor.c @@ -39,7 +39,7 @@ static void print_tlb(Monitor *mon, int idx, tlb_t *tlb) tlb->d, tlb->wt); } -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env = mon_get_cpu_env(mon); int i; diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c index 73f15aa272..95e6217568 100644 --- a/target/sparc/monitor.c +++ b/target/sparc/monitor.c @@ -28,7 +28,7 @@ #include "monitor/hmp.h" -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env1 = mon_get_cpu_env(mon); diff --git a/target/xtensa/monitor.c b/target/xtensa/monitor.c index fbf60d5553..92bfad8129 100644 --- a/target/xtensa/monitor.c +++ b/target/xtensa/monitor.c @@ -27,7 +27,7 @@ #include "monitor/hmp-target.h" #include "monitor/hmp.h" -void hmp_info_tlb(Monitor *mon, const QDict *qdict) +void hmp_info_tlb_deprecated(Monitor *mon, const QDict *qdict) { CPUArchState *env1 = mon_get_cpu_env(mon); diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index e31f2467fb..0066b49ceb 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -228,14 +228,14 @@ ERST .name = "tlb", .args_type = "", .params = "", - .help = "show virtual to physical memory mappings", + .help = "deprecated synonym for 'info mmu -t'", .cmd = hmp_info_tlb, }, #endif SRST ``info tlb`` - Show virtual to physical memory mappings. + This is a deprecated synonym for the mmu command. ERST #if defined(TARGET_I386) || defined(TARGET_RISCV) @@ -243,14 +243,14 @@ ERST .name = "mem", .args_type = "", .params = "", - .help = "show the active virtual memory mappings", + .help = "deprecated synonym for 'info mmu -m'", .cmd = hmp_info_mem, }, #endif SRST ``info mem`` - Show the active virtual memory mappings. + This is a deprecated synonym for the mmu command. ERST {