@samitouri / QOSamiQemu / commits / be86cd220a

hexagon: condition HMP-specific code

Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260828-qemu-no-hmp-v5-44-9227de146347@redhat.com>

Marc-André Lureau committed Aug 28, 2026 at 16:04 UTC be86cd220ad1bbe4fad11010580ae871c954df76
2 files changed +24 -20
hw/hexagon/hexagon_tlb.c
+22 -20
@@ -57,19 +57,6 @@ typedef enum {
57
58 #define NUM_PGSIZE_TYPES (PGSIZE_1G + 1)
59
60 -static const char *pgsize_str[NUM_PGSIZE_TYPES] = {
61 - "4K",
62 - "16K",
63 - "64K",
64 - "256K",
65 - "1M",
66 - "4M",
67 - "16M",
68 - "64M",
69 - "256M",
70 - "1G",
71 -};
72 -
60 #define INVALID_MASK 0xffffffffLL
61
62 static const uint64_t encmask_2_mask[] = {
@@ -122,6 +109,20 @@ static inline uint64_t hex_tlb_virt_addr(uint64_t entry)
109 return (uint64_t)GET_PTE_VPN(entry) << qemu_target_page_bits();
110 }
111
112 +#ifdef CONFIG_HMP
113 +static const char *pgsize_str[NUM_PGSIZE_TYPES] = {
114 + "4K",
115 + "16K",
116 + "64K",
117 + "256K",
118 + "1M",
119 + "4M",
120 + "16M",
121 + "64M",
122 + "256M",
123 + "1G",
124 +};
125 +
126 bool hexagon_tlb_dump_entry(MonitorHMP *hmp, uint64_t entry)
127 {
128 if (GET_PTE_V(entry)) {
@@ -155,6 +156,14 @@ bool hexagon_tlb_dump_entry(MonitorHMP *hmp, uint64_t entry)
156 return false;
157 }
158
159 +void hexagon_tlb_dump(MonitorHMP *hmp, HexagonTLBState *tlb)
160 +{
161 + for (uint32_t i = 0; i < tlb->num_entries; i++) {
162 + hexagon_tlb_dump_entry(hmp, tlb->entries[i]);
163 + }
164 +}
165 +#endif
166 +
167 static inline bool hex_tlb_entry_match_noperm(uint64_t entry, uint32_t asid,
168 uint64_t VA)
169 {
@@ -377,13 +386,6 @@ int hexagon_tlb_check_overlap(HexagonTLBState *tlb, uint64_t entry,
386 return -1;
387 }
388
380 -void hexagon_tlb_dump(MonitorHMP *hmp, HexagonTLBState *tlb)
381 -{
382 - for (uint32_t i = 0; i < tlb->num_entries; i++) {
383 - hexagon_tlb_dump_entry(hmp, tlb->entries[i]);
384 - }
385 -}
386 -
389 uint32_t hexagon_tlb_get_num_entries(HexagonTLBState *tlb)
390 {
391 return tlb->num_entries;
target/hexagon/hex_mmu.c
+2
@@ -107,11 +107,13 @@ int hex_tlb_check_overlap(CPUHexagonState *env, uint64_t entry, uint64_t index)
107 return hexagon_tlb_check_overlap(cpu->tlb, entry, index);
108 }
109
110 +#ifdef CONFIG_HMP
111 void dump_mmu(MonitorHMP *hmp, CPUHexagonState *env)
112 {
113 HexagonCPU *cpu = env_archcpu(env);
114 hexagon_tlb_dump(hmp, cpu->tlb);
115 }
116 +#endif
117
118 static inline void print_thread(const char *str, CPUState *cs)
119 {