qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH-for-9.0 2/2] target/monitor: Deprecate 'info tlb' and 'info mem'


From: Philippe Mathieu-Daudé
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

'info tlb' has been replaced by 'info mmu -t', and
'info mem' by 'info mmu -m'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 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
 
     {
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]