On 8/16/2026 2:13 PM, Marc-André Lureau wrote:
Signed-off-by: Marc-André Lureau <[email protected]>
---

Reviewed-by: Brian Cain <[email protected]>


  hw/hexagon/hexagon_tlb.c | 42 ++++++++++++++++++++++--------------------
  target/hexagon/hex_mmu.c |  2 ++
  2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/hw/hexagon/hexagon_tlb.c b/hw/hexagon/hexagon_tlb.c
index 584c606a22c5..ed8c0a761228 100644
--- a/hw/hexagon/hexagon_tlb.c
+++ b/hw/hexagon/hexagon_tlb.c
@@ -57,19 +57,6 @@ typedef enum {
#define NUM_PGSIZE_TYPES (PGSIZE_1G + 1) -static const char *pgsize_str[NUM_PGSIZE_TYPES] = {
-    "4K",
-    "16K",
-    "64K",
-    "256K",
-    "1M",
-    "4M",
-    "16M",
-    "64M",
-    "256M",
-    "1G",
-};
-
  #define INVALID_MASK 0xffffffffLL
static const uint64_t encmask_2_mask[] = {
@@ -122,6 +109,20 @@ static inline uint64_t hex_tlb_virt_addr(uint64_t entry)
      return (uint64_t)GET_PTE_VPN(entry) << qemu_target_page_bits();
  }
+#ifdef CONFIG_HMP
+static const char *pgsize_str[NUM_PGSIZE_TYPES] = {
+    "4K",
+    "16K",
+    "64K",
+    "256K",
+    "1M",
+    "4M",
+    "16M",
+    "64M",
+    "256M",
+    "1G",
+};
+
  bool hexagon_tlb_dump_entry(MonitorHMP *hmp, uint64_t entry)
  {
      if (GET_PTE_V(entry)) {
@@ -155,6 +156,14 @@ bool hexagon_tlb_dump_entry(MonitorHMP *hmp, uint64_t 
entry)
      return false;
  }
+void hexagon_tlb_dump(MonitorHMP *hmp, HexagonTLBState *tlb)
+{
+    for (uint32_t i = 0; i < tlb->num_entries; i++) {
+        hexagon_tlb_dump_entry(hmp, tlb->entries[i]);
+    }
+}
+#endif
+
  static inline bool hex_tlb_entry_match_noperm(uint64_t entry, uint32_t asid,
                                                uint64_t VA)
  {
@@ -377,13 +386,6 @@ int hexagon_tlb_check_overlap(HexagonTLBState *tlb, 
uint64_t entry,
      return -1;
  }
-void hexagon_tlb_dump(MonitorHMP *hmp, HexagonTLBState *tlb)
-{
-    for (uint32_t i = 0; i < tlb->num_entries; i++) {
-        hexagon_tlb_dump_entry(hmp, tlb->entries[i]);
-    }
-}
-
  uint32_t hexagon_tlb_get_num_entries(HexagonTLBState *tlb)
  {
      return tlb->num_entries;
diff --git a/target/hexagon/hex_mmu.c b/target/hexagon/hex_mmu.c
index 242de06eaad2..12bcddd000bf 100644
--- a/target/hexagon/hex_mmu.c
+++ b/target/hexagon/hex_mmu.c
@@ -107,11 +107,13 @@ int hex_tlb_check_overlap(CPUHexagonState *env, uint64_t 
entry, uint64_t index)
      return hexagon_tlb_check_overlap(cpu->tlb, entry, index);
  }
+#ifdef CONFIG_HMP
  void dump_mmu(MonitorHMP *hmp, CPUHexagonState *env)
  {
      HexagonCPU *cpu = env_archcpu(env);
      hexagon_tlb_dump(hmp, cpu->tlb);
  }
+#endif
static inline void print_thread(const char *str, CPUState *cs)
  {


Reply via email to