hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/lib/dump_tlb.c
....@@ -10,8 +10,8 @@
1010
1111 #include <asm/hazards.h>
1212 #include <asm/mipsregs.h>
13
+#include <asm/mmu_context.h>
1314 #include <asm/page.h>
14
-#include <asm/pgtable.h>
1515 #include <asm/tlbdebug.h>
1616
1717 void dump_tlb_regs(void)
....@@ -73,12 +73,13 @@
7373
7474 static void dump_tlb(int first, int last)
7575 {
76
- unsigned long s_entryhi, entryhi, asid;
76
+ unsigned long s_entryhi, entryhi, asid, mmid;
7777 unsigned long long entrylo0, entrylo1, pa;
7878 unsigned int s_index, s_pagemask, s_guestctl1 = 0;
7979 unsigned int pagemask, guestctl1 = 0, c0, c1, i;
8080 unsigned long asidmask = cpu_asid_mask(&current_cpu_data);
8181 int asidwidth = DIV_ROUND_UP(ilog2(asidmask) + 1, 4);
82
+ unsigned long s_mmid;
8283 #ifdef CONFIG_32BIT
8384 bool xpa = cpu_has_xpa && (read_c0_pagegrain() & PG_ELPA);
8485 int pwidth = xpa ? 11 : 8;
....@@ -92,7 +93,12 @@
9293 s_pagemask = read_c0_pagemask();
9394 s_entryhi = read_c0_entryhi();
9495 s_index = read_c0_index();
95
- asid = s_entryhi & asidmask;
96
+
97
+ if (cpu_has_mmid)
98
+ asid = s_mmid = read_c0_memorymapid();
99
+ else
100
+ asid = s_entryhi & asidmask;
101
+
96102 if (cpu_has_guestid)
97103 s_guestctl1 = read_c0_guestctl1();
98104
....@@ -105,6 +111,12 @@
105111 entryhi = read_c0_entryhi();
106112 entrylo0 = read_c0_entrylo0();
107113 entrylo1 = read_c0_entrylo1();
114
+
115
+ if (cpu_has_mmid)
116
+ mmid = read_c0_memorymapid();
117
+ else
118
+ mmid = entryhi & asidmask;
119
+
108120 if (cpu_has_guestid)
109121 guestctl1 = read_c0_guestctl1();
110122
....@@ -124,8 +136,7 @@
124136 * leave only a single G bit set after a machine check exception
125137 * due to duplicate TLB entry.
126138 */
127
- if (!((entrylo0 | entrylo1) & ENTRYLO_G) &&
128
- (entryhi & asidmask) != asid)
139
+ if (!((entrylo0 | entrylo1) & ENTRYLO_G) && (mmid != asid))
129140 continue;
130141
131142 /*
....@@ -138,7 +149,7 @@
138149
139150 pr_cont("va=%0*lx asid=%0*lx",
140151 vwidth, (entryhi & ~0x1fffUL),
141
- asidwidth, entryhi & asidmask);
152
+ asidwidth, mmid);
142153 if (cpu_has_guestid)
143154 pr_cont(" gid=%02lx",
144155 (guestctl1 & MIPS_GCTL1_RID)