Skip to content

Commit ad68461

Browse files
committed
LoongArch: Improve dump_tlb() output messages
1, Use nr/nx to replace ri/xi; 2, Add 0x prefix for hexadecimal data. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 0163005 commit ad68461

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

arch/loongarch/lib/dump_tlb.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ void dump_tlb_regs(void)
1818
{
1919
const int field = 2 * sizeof(unsigned long);
2020

21-
pr_info("Index : %0x\n", read_csr_tlbidx());
22-
pr_info("PageSize : %0x\n", read_csr_pagesize());
23-
pr_info("EntryHi : %0*llx\n", field, read_csr_entryhi());
24-
pr_info("EntryLo0 : %0*llx\n", field, read_csr_entrylo0());
25-
pr_info("EntryLo1 : %0*llx\n", field, read_csr_entrylo1());
21+
pr_info("Index : 0x%0x\n", read_csr_tlbidx());
22+
pr_info("PageSize : 0x%0x\n", read_csr_pagesize());
23+
pr_info("EntryHi : 0x%0*llx\n", field, read_csr_entryhi());
24+
pr_info("EntryLo0 : 0x%0*llx\n", field, read_csr_entrylo0());
25+
pr_info("EntryLo1 : 0x%0*llx\n", field, read_csr_entrylo1());
2626
}
2727

2828
static void dump_tlb(int first, int last)
@@ -33,8 +33,8 @@ static void dump_tlb(int first, int last)
3333
unsigned int s_index, s_asid;
3434
unsigned int pagesize, c0, c1, i;
3535
unsigned long asidmask = cpu_asid_mask(&current_cpu_data);
36-
int pwidth = 11;
37-
int vwidth = 11;
36+
int pwidth = 16;
37+
int vwidth = 16;
3838
int asidwidth = DIV_ROUND_UP(ilog2(asidmask) + 1, 4);
3939

4040
s_entryhi = read_csr_entryhi();
@@ -64,22 +64,22 @@ static void dump_tlb(int first, int last)
6464
/*
6565
* Only print entries in use
6666
*/
67-
pr_info("Index: %2d pgsize=%x ", i, (1 << pagesize));
67+
pr_info("Index: %4d pgsize=0x%x ", i, (1 << pagesize));
6868

6969
c0 = (entrylo0 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
7070
c1 = (entrylo1 & ENTRYLO_C) >> ENTRYLO_C_SHIFT;
7171

72-
pr_cont("va=%0*lx asid=%0*lx",
72+
pr_cont("va=0x%0*lx asid=0x%0*lx",
7373
vwidth, (entryhi & ~0x1fffUL), asidwidth, asid & asidmask);
7474

7575
/* NR/NX are in awkward places, so mask them off separately */
7676
pa = entrylo0 & ~(ENTRYLO_NR | ENTRYLO_NX);
7777
pa = pa & PAGE_MASK;
7878
pr_cont("\n\t[");
79-
pr_cont("ri=%d xi=%d ",
79+
pr_cont("nr=%d nx=%d ",
8080
(entrylo0 & ENTRYLO_NR) ? 1 : 0,
8181
(entrylo0 & ENTRYLO_NX) ? 1 : 0);
82-
pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d plv=%lld] [",
82+
pr_cont("pa=0x%0*llx c=%d d=%d v=%d g=%d plv=%lld] [",
8383
pwidth, pa, c0,
8484
(entrylo0 & ENTRYLO_D) ? 1 : 0,
8585
(entrylo0 & ENTRYLO_V) ? 1 : 0,
@@ -88,10 +88,10 @@ static void dump_tlb(int first, int last)
8888
/* NR/NX are in awkward places, so mask them off separately */
8989
pa = entrylo1 & ~(ENTRYLO_NR | ENTRYLO_NX);
9090
pa = pa & PAGE_MASK;
91-
pr_cont("ri=%d xi=%d ",
91+
pr_cont("nr=%d nx=%d ",
9292
(entrylo1 & ENTRYLO_NR) ? 1 : 0,
9393
(entrylo1 & ENTRYLO_NX) ? 1 : 0);
94-
pr_cont("pa=%0*llx c=%d d=%d v=%d g=%d plv=%lld]\n",
94+
pr_cont("pa=0x%0*llx c=%d d=%d v=%d g=%d plv=%lld]\n",
9595
pwidth, pa, c1,
9696
(entrylo1 & ENTRYLO_D) ? 1 : 0,
9797
(entrylo1 & ENTRYLO_V) ? 1 : 0,

0 commit comments

Comments
 (0)