Skip to contentSkip to conversation

mips/tlb_helper: Add support for 'info tlb' cmd

PATCH Superseded Arkadiy 3 participants 3 messages Jul 20, 2021 Arm/Amlogic Meson SoC support

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Arkadiy

author
#0 lore raw

PATCH 1/1 mips/tlb_helper: Add support for 'info tlb' cmd

From: NDNF <[email protected]>

This adds hmp 'info tlb' command support for the mips platform. 1k pages are not supported.

---
 hmp-commands-info.hx     |  3 ++-
 target/mips/cpu.h        |  3 +++
 target/mips/meson.build  |  1 +
 target/mips/monitor.c    | 26 ++++++++++++++++++++++
 target/mips/tlb_helper.c | 48 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 target/mips/monitor.c
hmp-commands-info.hx +2 -1
index 117ba25f91..d6aab9839c 100644
@@ -222,7 +222,8 @@ SRST
 ERST
 
 #if defined(TARGET_I386) || defined(TARGET_SH4) || defined(TARGET_SPARC) || \
-    defined(TARGET_PPC) || defined(TARGET_XTENSA) || defined(TARGET_M68K)
+    defined(TARGET_PPC) || defined(TARGET_XTENSA) || defined(TARGET_M68K) || \
+    defined(TARGET_MIPS) || defined(TARGET_MIPS64)
     {
         .name       = "tlb",
         .args_type  = "",
target/mips/cpu.h +3 -0
index b9e227a30e..5aa6f2b760 100644
@@ -1337,6 +1337,9 @@ void itc_reconfigure(struct MIPSITUState *tag);
 /* helper.c */
 target_ulong exception_resume_pc(CPUMIPSState *env);
 
+/*tlb_helper.c*/
+void dump_mmu(CPUMIPSState *env);
+
 static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
                                         target_ulong *cs_base, uint32_t *flags)
 {
target/mips/meson.build +1 -0
index 9741545440..c0b19048ee 100644
@@ -31,6 +31,7 @@ mips_softmmu_ss.add(files(
   'cp0_timer.c',
   'machine.c',
   'mips-semi.c',
+  'monitor.c',
 ))
 mips_softmmu_ss.add(when: 'CONFIG_TCG', if_true: files(
   'cp0_helper.c',
target/mips/monitor.c new file +26 -0
new file mode 100644
index 0000000000..9c9dfd2caa
@@ -0,0 +1,26 @@
+/*
+ * monitor.c
+ *
+ * Copyright (c) 2010-2021 Institute for System Programming
+ *                         of the Russian Academy of Sciences.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "monitor/monitor.h"
+#include "monitor/hmp-target.h"
+#include "monitor/hmp.h"
+
+void hmp_info_tlb(Monitor *mon, const QDict *qdict)
+{
+    CPUArchState *env = mon_get_cpu_env(mon);
+    if (!env) {
+        monitor_printf(mon, "No CPU available\n");
+        return;
+    }
+    dump_mmu(env);
+}
target/mips/tlb_helper.c +48 -0

60 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Arkadiy

From: NDNF <[email protected]>

This adds hmp 'info tlb' command support for the mips platform. 1k pages are not supported.

Hi; for QEMU contributions we request that the signed-off-by line is your real name, not a pseudonym; we follow basically the Linux kernel policy on this:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297

thanks
-- PMM

#2 lore raw
Quoted 7 lines · Peter Maydell
Quoted 6 lines · Arkadiy

From: NDNF <[email protected]>

This adds hmp 'info tlb' command support for the mips platform. 1k pages are not supported.

Quoted 7 lines
Quoted 1 line

Hi; for QEMU contributions we request that the signed-off-by line is your real name, not a pseudonym; we follow basically the Linux kernel policy on this:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297

This is probably an incorrect email setup due to problems with UTF-8 encoding and the list. Ivanov Arkasha already contributed to QEMU (see commit 56b90e60c40: "target/avr: Fix interrupt execution") Previous patches sent from аркадий иванов ("block: increased maximum size of vvfat devices") were rejected by the list.