--- zzzz-none-000/linux-3.10.107/arch/mips/lib/dump_tlb.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/arch/mips/lib/dump_tlb.c 2021-11-10 11:53:54.000000000 +0000 @@ -1,8 +1,13 @@ /* - * Dump R4x00 TLB for debugging purposes. + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. * * Copyright (C) 1994, 1995 by Waldorf Electronics, written by Ralf Baechle. * Copyright (C) 1999 by Silicon Graphics, Inc. + * Copyright (C) 2011 MIPS Technologies, Inc. + * + * Dump R4x00 TLB for debugging purposes. */ #include #include @@ -59,8 +64,10 @@ for (i = first; i <= last; i++) { write_c0_index(i); + back_to_back_c0_hazard(); BARRIER(); tlb_read(); + back_to_back_c0_hazard(); BARRIER(); pagemask = read_c0_pagemask(); entryhi = read_c0_entryhi(); @@ -68,8 +75,8 @@ entrylo1 = read_c0_entrylo1(); /* Unused entries have a virtual address of CKSEG0. */ - if ((entryhi & ~0x1ffffUL) != CKSEG0 - && (entryhi & 0xff) == asid) { + if (((entryhi & ~0x1ffffUL) != CKSEG0) && + !(cpu_has_tlbinv && (entryhi & MIPS_EHINV))) { #ifdef CONFIG_32BIT int width = 8; #else @@ -83,7 +90,7 @@ c0 = (entrylo0 >> 3) & 7; c1 = (entrylo1 >> 3) & 7; - printk("va=%0*lx asid=%02lx\n", + printk("va=%0*lx asid=%02lx:", width, (entryhi & ~0x1fffUL), entryhi & 0xff); printk("\t[pa=%0*llx c=%d d=%d v=%d g=%d] ", @@ -105,6 +112,8 @@ write_c0_entryhi(s_entryhi); write_c0_index(s_index); write_c0_pagemask(s_pagemask); + BARRIER(); + back_to_back_c0_hazard(); } void dump_tlb_all(void)