aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2015-05-19 04:50:37 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-06-21 15:52:38 -0400
commitc2bc435e4f2cd5f010063b49f68e5b2cfaccc84e (patch)
treef8f671a811543475830c6ffa4c5696e36f36c008
parentdecebccd76e4da9bb096962c230b6ed740606e49 (diff)
MIPS: dump_tlb: Take RI/XI bits into account
The RI/XI bits when present are above the PFN field in the EntryLo registers, at bits 63,62 when read with dmfc0, and bits 31,30 when read with mfc0. This makes them appear as part of the physical address, since the other bits are masked with PAGE_MASK, for example: Index: 253 pgmask=16kb va=77b18000 asid=75 [pa=1000744000 c=5 d=1 v=1 g=0] [pa=100134c000 c=5 d=1 v=1 g=0] The physical addresses have bit 36 set, which corresponds to bit 30 of EntryLo1, the XI bit. Explicitly mask off the RI and XI bits from the printed physical address, and print the RI and XI bits separately if they exist, giving output more like this: Index: 226 pgmask=16kb va=77be0000 asid=79 [ri=0 xi=1 pa=01288000 c=5 d=1 v=1 g=0] [ri=0 xi=0 pa=010e4000 c=5 d=0 v=1 g=0] Cc: linux-mips@linux-mips.org Cc: James Hogan <james.hogan@imgtec.com> Cc: David Daney <ddaney@caviumnetworks.com> Patchwork: https://patchwork.linux-mips.org/patch/10080/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/lib/dump_tlb.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/arch/mips/lib/dump_tlb.c b/arch/mips/lib/dump_tlb.c
index 3bcdd53c832f..1fefd38aba08 100644
--- a/arch/mips/lib/dump_tlb.c
+++ b/arch/mips/lib/dump_tlb.c
@@ -44,7 +44,7 @@ static inline const char *msk2str(unsigned int mask)
44static void dump_tlb(int first, int last) 44static void dump_tlb(int first, int last)
45{ 45{
46 unsigned long s_entryhi, entryhi, asid; 46 unsigned long s_entryhi, entryhi, asid;
47 unsigned long long entrylo0, entrylo1; 47 unsigned long long entrylo0, entrylo1, pa;
48 unsigned int s_index, s_pagemask, pagemask, c0, c1, i; 48 unsigned int s_index, s_pagemask, pagemask, c0, c1, i;
49#ifdef CONFIG_32BIT 49#ifdef CONFIG_32BIT
50 int width = 8; 50 int width = 8;
@@ -98,15 +98,28 @@ static void dump_tlb(int first, int last)
98 printk("va=%0*lx asid=%02lx\n", 98 printk("va=%0*lx asid=%02lx\n",
99 width, (entryhi & ~0x1fffUL), 99 width, (entryhi & ~0x1fffUL),
100 entryhi & 0xff); 100 entryhi & 0xff);
101 printk("\t[pa=%0*llx c=%d d=%d v=%d g=%d] ", 101 /* RI/XI are in awkward places, so mask them off separately */
102 width, 102 pa = entrylo0 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
103 (entrylo0 << 6) & PAGE_MASK, c0, 103 pa = (pa << 6) & PAGE_MASK;
104 printk("\t[");
105 if (cpu_has_rixi)
106 printk("ri=%d xi=%d ",
107 (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,
108 (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);
109 printk("pa=%0*llx c=%d d=%d v=%d g=%d] [",
110 width, pa, c0,
104 (entrylo0 & MIPS_ENTRYLO_D) ? 1 : 0, 111 (entrylo0 & MIPS_ENTRYLO_D) ? 1 : 0,
105 (entrylo0 & MIPS_ENTRYLO_V) ? 1 : 0, 112 (entrylo0 & MIPS_ENTRYLO_V) ? 1 : 0,
106 (entrylo0 & MIPS_ENTRYLO_G) ? 1 : 0); 113 (entrylo0 & MIPS_ENTRYLO_G) ? 1 : 0);
107 printk("[pa=%0*llx c=%d d=%d v=%d g=%d]\n", 114 /* RI/XI are in awkward places, so mask them off separately */
108 width, 115 pa = entrylo1 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
109 (entrylo1 << 6) & PAGE_MASK, c1, 116 pa = (pa << 6) & PAGE_MASK;
117 if (cpu_has_rixi)
118 printk("ri=%d xi=%d ",
119 (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,
120 (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);
121 printk("pa=%0*llx c=%d d=%d v=%d g=%d]\n",
122 width, pa, c1,
110 (entrylo1 & MIPS_ENTRYLO_D) ? 1 : 0, 123 (entrylo1 & MIPS_ENTRYLO_D) ? 1 : 0,
111 (entrylo1 & MIPS_ENTRYLO_V) ? 1 : 0, 124 (entrylo1 & MIPS_ENTRYLO_V) ? 1 : 0,
112 (entrylo1 & MIPS_ENTRYLO_G) ? 1 : 0); 125 (entrylo1 & MIPS_ENTRYLO_G) ? 1 : 0);