diff options
Diffstat (limited to 'arch/mips/lib/dump_tlb.c')
| -rw-r--r-- | arch/mips/lib/dump_tlb.c | 22 | 
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/mips/lib/dump_tlb.c b/arch/mips/lib/dump_tlb.c index 781ad96b78c4..83ed37298e66 100644 --- a/arch/mips/lib/dump_tlb.c +++ b/arch/mips/lib/dump_tlb.c @@ -10,6 +10,7 @@  #include <asm/hazards.h>  #include <asm/mipsregs.h> +#include <asm/mmu_context.h>  #include <asm/page.h>  #include <asm/pgtable.h>  #include <asm/tlbdebug.h> @@ -73,12 +74,13 @@ static inline const char *msk2str(unsigned int mask)  static void dump_tlb(int first, int last)  { -	unsigned long s_entryhi, entryhi, asid; +	unsigned long s_entryhi, entryhi, asid, mmid;  	unsigned long long entrylo0, entrylo1, pa;  	unsigned int s_index, s_pagemask, s_guestctl1 = 0;  	unsigned int pagemask, guestctl1 = 0, c0, c1, i;  	unsigned long asidmask = cpu_asid_mask(¤t_cpu_data);  	int asidwidth = DIV_ROUND_UP(ilog2(asidmask) + 1, 4); +	unsigned long uninitialized_var(s_mmid);  #ifdef CONFIG_32BIT  	bool xpa = cpu_has_xpa && (read_c0_pagegrain() & PG_ELPA);  	int pwidth = xpa ? 11 : 8; @@ -92,7 +94,12 @@ static void dump_tlb(int first, int last)  	s_pagemask = read_c0_pagemask();  	s_entryhi = read_c0_entryhi();  	s_index = read_c0_index(); -	asid = s_entryhi & asidmask; + +	if (cpu_has_mmid) +		asid = s_mmid = read_c0_memorymapid(); +	else +		asid = s_entryhi & asidmask; +  	if (cpu_has_guestid)  		s_guestctl1 = read_c0_guestctl1(); @@ -105,6 +112,12 @@ static void dump_tlb(int first, int last)  		entryhi	 = read_c0_entryhi();  		entrylo0 = read_c0_entrylo0();  		entrylo1 = read_c0_entrylo1(); + +		if (cpu_has_mmid) +			mmid = read_c0_memorymapid(); +		else +			mmid = entryhi & asidmask; +  		if (cpu_has_guestid)  			guestctl1 = read_c0_guestctl1(); @@ -124,8 +137,7 @@ static void dump_tlb(int first, int last)  		 * leave only a single G bit set after a machine check exception  		 * due to duplicate TLB entry.  		 */ -		if (!((entrylo0 | entrylo1) & ENTRYLO_G) && -		    (entryhi & asidmask) != asid) +		if (!((entrylo0 | entrylo1) & ENTRYLO_G) && (mmid != asid))  			continue;  		/* @@ -138,7 +150,7 @@ static void dump_tlb(int first, int last)  		pr_cont("va=%0*lx asid=%0*lx",  			vwidth, (entryhi & ~0x1fffUL), -			asidwidth, entryhi & asidmask); +			asidwidth, mmid);  		if (cpu_has_guestid)  			pr_cont(" gid=%02lx",  				(guestctl1 & MIPS_GCTL1_RID)  |