]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MIPS: dump_tlb: Fix printk continuations
authorJames Hogan <james.hogan@imgtec.com>
Fri, 21 Oct 2016 19:06:40 +0000 (20:06 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 4 Nov 2016 00:04:32 +0000 (01:04 +0100)
Since commit 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing
continuation lines") the output from TLB dumps on MIPS has been
pretty unreadable due to the lack of KERN_CONT markers. Use pr_cont to
provide the appropriate markers & restore the expected output.

Continuation is also used for the second line of each TLB entry printed
in dump_tlb.c even though it has a newline, since it is a continuation
of the interpretation of the same TLB entry. For example:

[   46.371884] Index:  0 pgmask=16kb va=77654000 asid=73 gid=00
        [ri=0 xi=0 pa=ffc18000 c=5 d=0 v=1 g=0] [ri=0 xi=0 pa=ffc1c000 c=5 d=0 v=1 g=0]
[   46.385380] Index: 12 pgmask=16kb va=004b4000 asid=73 gid=00
        [ri=0 xi=0 pa=00000000 c=0 d=0 v=0 g=0] [ri=0 xi=0 pa=ffb00000 c=5 d=1 v=1 g=0]

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Maciej W. Rozycki <macro@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14444/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/lib/dump_tlb.c
arch/mips/lib/r3k_dump_tlb.c

index 0f80b936e75ec92015d1ebdfb815dfaed14a9909..6eb50a7137db05c9dc18b38bf33b317192aa058a 100644 (file)
@@ -135,42 +135,42 @@ static void dump_tlb(int first, int last)
                c0 = (entrylo0 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
                c1 = (entrylo1 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
 
-               printk("va=%0*lx asid=%0*lx",
-                      vwidth, (entryhi & ~0x1fffUL),
-                      asidwidth, entryhi & asidmask);
+               pr_cont("va=%0*lx asid=%0*lx",
+                       vwidth, (entryhi & ~0x1fffUL),
+                       asidwidth, entryhi & asidmask);
                if (cpu_has_guestid)
-                       printk(" gid=%02lx",
-                              (guestctl1 & MIPS_GCTL1_RID)
+                       pr_cont(" gid=%02lx",
+                               (guestctl1 & MIPS_GCTL1_RID)
                                        >> MIPS_GCTL1_RID_SHIFT);
                /* RI/XI are in awkward places, so mask them off separately */
                pa = entrylo0 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
                if (xpa)
                        pa |= (unsigned long long)readx_c0_entrylo0() << 30;
                pa = (pa << 6) & PAGE_MASK;
-               printk("\n\t[");
+               pr_cont("\n\t[");
                if (cpu_has_rixi)
-                       printk("ri=%d xi=%d ",
-                              (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,
-                              (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);
-               printk("pa=%0*llx c=%d d=%d v=%d g=%d] [",
-                      pwidth, pa, c0,
-                      (entrylo0 & ENTRYLO_D) ? 1 : 0,
-                      (entrylo0 & ENTRYLO_V) ? 1 : 0,
-                      (entrylo0 & ENTRYLO_G) ? 1 : 0);
+                       pr_cont("ri=%d xi=%d ",
+                               (entrylo0 & MIPS_ENTRYLO_RI) ? 1 : 0,
+                               (entrylo0 & MIPS_ENTRYLO_XI) ? 1 : 0);
+               pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d] [",
+                       pwidth, pa, c0,
+                       (entrylo0 & ENTRYLO_D) ? 1 : 0,
+                       (entrylo0 & ENTRYLO_V) ? 1 : 0,
+                       (entrylo0 & ENTRYLO_G) ? 1 : 0);
                /* RI/XI are in awkward places, so mask them off separately */
                pa = entrylo1 & ~(MIPS_ENTRYLO_RI | MIPS_ENTRYLO_XI);
                if (xpa)
                        pa |= (unsigned long long)readx_c0_entrylo1() << 30;
                pa = (pa << 6) & PAGE_MASK;
                if (cpu_has_rixi)
-                       printk("ri=%d xi=%d ",
-                              (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,
-                              (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);
-               printk("pa=%0*llx c=%d d=%d v=%d g=%d]\n",
-                      pwidth, pa, c1,
-                      (entrylo1 & ENTRYLO_D) ? 1 : 0,
-                      (entrylo1 & ENTRYLO_V) ? 1 : 0,
-                      (entrylo1 & ENTRYLO_G) ? 1 : 0);
+                       pr_cont("ri=%d xi=%d ",
+                               (entrylo1 & MIPS_ENTRYLO_RI) ? 1 : 0,
+                               (entrylo1 & MIPS_ENTRYLO_XI) ? 1 : 0);
+               pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d]\n",
+                       pwidth, pa, c1,
+                       (entrylo1 & ENTRYLO_D) ? 1 : 0,
+                       (entrylo1 & ENTRYLO_V) ? 1 : 0,
+                       (entrylo1 & ENTRYLO_G) ? 1 : 0);
        }
        printk("\n");
 
index 744f4a7bc49dfa5eabbde9b78228e0d2065799d4..85b4086e553e8734cf4b286a2a65d5159ed4f5d9 100644 (file)
@@ -53,15 +53,15 @@ static void dump_tlb(int first, int last)
                         */
                        printk("Index: %2d ", i);
 
-                       printk("va=%08lx asid=%08lx"
-                              "  [pa=%06lx n=%d d=%d v=%d g=%d]",
-                              entryhi & PAGE_MASK,
-                              entryhi & asid_mask,
-                              entrylo0 & PAGE_MASK,
-                              (entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,
-                              (entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,
-                              (entrylo0 & R3K_ENTRYLO_V) ? 1 : 0,
-                              (entrylo0 & R3K_ENTRYLO_G) ? 1 : 0);
+                       pr_cont("va=%08lx asid=%08lx"
+                               "  [pa=%06lx n=%d d=%d v=%d g=%d]",
+                               entryhi & PAGE_MASK,
+                               entryhi & asid_mask,
+                               entrylo0 & PAGE_MASK,
+                               (entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,
+                               (entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,
+                               (entrylo0 & R3K_ENTRYLO_V) ? 1 : 0,
+                               (entrylo0 & R3K_ENTRYLO_G) ? 1 : 0);
                }
        }
        printk("\n");