Commit 115f2a44 authored by Thiemo Seufer's avatar Thiemo Seufer Committed by Ralf Baechle

[MIPS] Print out TLB handler assembly for debugging.

Small update, using pr_debug and pr_info.
Signed-off-by: default avatarThiemo Seufer <ths@networkno.de>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 4bf42d42
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Synthesize TLB refill handlers at runtime. * Synthesize TLB refill handlers at runtime.
* *
* Copyright (C) 2004,2005 by Thiemo Seufer * Copyright (C) 2004,2005,2006 by Thiemo Seufer
* Copyright (C) 2005 Maciej W. Rozycki * Copyright (C) 2005 Maciej W. Rozycki
* Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
* *
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/war.h> #include <asm/war.h>
/* #define DEBUG_TLB */
static __init int __attribute__((unused)) r45k_bvahwbug(void) static __init int __attribute__((unused)) r45k_bvahwbug(void)
{ {
/* XXX: We should probe for the presence of this bug, but we don't. */ /* XXX: We should probe for the presence of this bug, but we don't. */
...@@ -728,6 +726,7 @@ static void __init build_r3000_tlb_refill_handler(void) ...@@ -728,6 +726,7 @@ static void __init build_r3000_tlb_refill_handler(void)
{ {
long pgdc = (long)pgd_current; long pgdc = (long)pgd_current;
u32 *p; u32 *p;
int i;
memset(tlb_handler, 0, sizeof(tlb_handler)); memset(tlb_handler, 0, sizeof(tlb_handler));
p = tlb_handler; p = tlb_handler;
...@@ -753,16 +752,14 @@ static void __init build_r3000_tlb_refill_handler(void) ...@@ -753,16 +752,14 @@ static void __init build_r3000_tlb_refill_handler(void)
if (p > tlb_handler + 32) if (p > tlb_handler + 32)
panic("TLB refill handler space exceeded"); panic("TLB refill handler space exceeded");
printk("Synthesized TLB refill handler (%u instructions).\n", pr_info("Synthesized TLB refill handler (%u instructions).\n",
(unsigned int)(p - tlb_handler)); (unsigned int)(p - tlb_handler));
#ifdef DEBUG_TLB
{
int i;
for (i = 0; i < (p - tlb_handler); i++) pr_debug("\t.set push\n");
printk("%08x\n", tlb_handler[i]); pr_debug("\t.set noreorder\n");
} for (i = 0; i < (p - tlb_handler); i++)
#endif pr_debug("\t.word 0x%08x\n", tlb_handler[i]);
pr_debug("\t.set pop\n");
memcpy((void *)ebase, tlb_handler, 0x80); memcpy((void *)ebase, tlb_handler, 0x80);
} }
...@@ -1175,6 +1172,7 @@ static void __init build_r4000_tlb_refill_handler(void) ...@@ -1175,6 +1172,7 @@ static void __init build_r4000_tlb_refill_handler(void)
struct reloc *r = relocs; struct reloc *r = relocs;
u32 *f; u32 *f;
unsigned int final_len; unsigned int final_len;
int i;
memset(tlb_handler, 0, sizeof(tlb_handler)); memset(tlb_handler, 0, sizeof(tlb_handler));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1272,24 +1270,21 @@ static void __init build_r4000_tlb_refill_handler(void) ...@@ -1272,24 +1270,21 @@ static void __init build_r4000_tlb_refill_handler(void)
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB refill handler (%u instructions).\n", pr_info("Synthesized TLB refill handler (%u instructions).\n",
final_len); final_len);
#ifdef DEBUG_TLB
{
int i;
f = final_handler; f = final_handler;
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
if (final_len > 32) if (final_len > 32)
final_len = 64; final_len = 64;
else else
f = final_handler + 32; f = final_handler + 32;
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
for (i = 0; i < final_len; i++) pr_debug("\t.set push\n");
printk("%08x\n", f[i]); pr_debug("\t.set noreorder\n");
} for (i = 0; i < final_len; i++)
#endif pr_debug("\t.word 0x%08x\n", f[i]);
pr_debug("\t.set pop\n");
memcpy((void *)ebase, final_handler, 0x100); memcpy((void *)ebase, final_handler, 0x100);
} }
...@@ -1522,6 +1517,7 @@ static void __init build_r3000_tlb_load_handler(void) ...@@ -1522,6 +1517,7 @@ static void __init build_r3000_tlb_load_handler(void)
u32 *p = handle_tlbl; u32 *p = handle_tlbl;
struct label *l = labels; struct label *l = labels;
struct reloc *r = relocs; struct reloc *r = relocs;
int i;
memset(handle_tlbl, 0, sizeof(handle_tlbl)); memset(handle_tlbl, 0, sizeof(handle_tlbl));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1541,17 +1537,14 @@ static void __init build_r3000_tlb_load_handler(void) ...@@ -1541,17 +1537,14 @@ static void __init build_r3000_tlb_load_handler(void)
panic("TLB load handler fastpath space exceeded"); panic("TLB load handler fastpath space exceeded");
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB load handler fastpath (%u instructions).\n", pr_info("Synthesized TLB load handler fastpath (%u instructions).\n",
(unsigned int)(p - handle_tlbl)); (unsigned int)(p - handle_tlbl));
#ifdef DEBUG_TLB
{
int i;
for (i = 0; i < (p - handle_tlbl); i++) pr_debug("\t.set push\n");
printk("%08x\n", handle_tlbl[i]); pr_debug("\t.set noreorder\n");
} for (i = 0; i < (p - handle_tlbl); i++)
#endif pr_debug("\t.word 0x%08x\n", handle_tlbl[i]);
pr_debug("\t.set pop\n");
} }
static void __init build_r3000_tlb_store_handler(void) static void __init build_r3000_tlb_store_handler(void)
...@@ -1559,6 +1552,7 @@ static void __init build_r3000_tlb_store_handler(void) ...@@ -1559,6 +1552,7 @@ static void __init build_r3000_tlb_store_handler(void)
u32 *p = handle_tlbs; u32 *p = handle_tlbs;
struct label *l = labels; struct label *l = labels;
struct reloc *r = relocs; struct reloc *r = relocs;
int i;
memset(handle_tlbs, 0, sizeof(handle_tlbs)); memset(handle_tlbs, 0, sizeof(handle_tlbs));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1578,17 +1572,14 @@ static void __init build_r3000_tlb_store_handler(void) ...@@ -1578,17 +1572,14 @@ static void __init build_r3000_tlb_store_handler(void)
panic("TLB store handler fastpath space exceeded"); panic("TLB store handler fastpath space exceeded");
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB store handler fastpath (%u instructions).\n", pr_info("Synthesized TLB store handler fastpath (%u instructions).\n",
(unsigned int)(p - handle_tlbs)); (unsigned int)(p - handle_tlbs));
#ifdef DEBUG_TLB pr_debug("\t.set push\n");
{ pr_debug("\t.set noreorder\n");
int i; for (i = 0; i < (p - handle_tlbs); i++)
pr_debug("\t.word 0x%08x\n", handle_tlbs[i]);
for (i = 0; i < (p - handle_tlbs); i++) pr_debug("\t.set pop\n");
printk("%08x\n", handle_tlbs[i]);
}
#endif
} }
static void __init build_r3000_tlb_modify_handler(void) static void __init build_r3000_tlb_modify_handler(void)
...@@ -1596,6 +1587,7 @@ static void __init build_r3000_tlb_modify_handler(void) ...@@ -1596,6 +1587,7 @@ static void __init build_r3000_tlb_modify_handler(void)
u32 *p = handle_tlbm; u32 *p = handle_tlbm;
struct label *l = labels; struct label *l = labels;
struct reloc *r = relocs; struct reloc *r = relocs;
int i;
memset(handle_tlbm, 0, sizeof(handle_tlbm)); memset(handle_tlbm, 0, sizeof(handle_tlbm));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1615,17 +1607,14 @@ static void __init build_r3000_tlb_modify_handler(void) ...@@ -1615,17 +1607,14 @@ static void __init build_r3000_tlb_modify_handler(void)
panic("TLB modify handler fastpath space exceeded"); panic("TLB modify handler fastpath space exceeded");
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB modify handler fastpath (%u instructions).\n", pr_info("Synthesized TLB modify handler fastpath (%u instructions).\n",
(unsigned int)(p - handle_tlbm)); (unsigned int)(p - handle_tlbm));
#ifdef DEBUG_TLB pr_debug("\t.set push\n");
{ pr_debug("\t.set noreorder\n");
int i; for (i = 0; i < (p - handle_tlbm); i++)
pr_debug("\t.word 0x%08x\n", handle_tlbm[i]);
for (i = 0; i < (p - handle_tlbm); i++) pr_debug("\t.set pop\n");
printk("%08x\n", handle_tlbm[i]);
}
#endif
} }
/* /*
...@@ -1677,6 +1666,7 @@ static void __init build_r4000_tlb_load_handler(void) ...@@ -1677,6 +1666,7 @@ static void __init build_r4000_tlb_load_handler(void)
u32 *p = handle_tlbl; u32 *p = handle_tlbl;
struct label *l = labels; struct label *l = labels;
struct reloc *r = relocs; struct reloc *r = relocs;
int i;
memset(handle_tlbl, 0, sizeof(handle_tlbl)); memset(handle_tlbl, 0, sizeof(handle_tlbl));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1704,17 +1694,14 @@ static void __init build_r4000_tlb_load_handler(void) ...@@ -1704,17 +1694,14 @@ static void __init build_r4000_tlb_load_handler(void)
panic("TLB load handler fastpath space exceeded"); panic("TLB load handler fastpath space exceeded");
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB load handler fastpath (%u instructions).\n", pr_info("Synthesized TLB load handler fastpath (%u instructions).\n",
(unsigned int)(p - handle_tlbl)); (unsigned int)(p - handle_tlbl));
#ifdef DEBUG_TLB
{
int i;
for (i = 0; i < (p - handle_tlbl); i++) pr_debug("\t.set push\n");
printk("%08x\n", handle_tlbl[i]); pr_debug("\t.set noreorder\n");
} for (i = 0; i < (p - handle_tlbl); i++)
#endif pr_debug("\t.word 0x%08x\n", handle_tlbl[i]);
pr_debug("\t.set pop\n");
} }
static void __init build_r4000_tlb_store_handler(void) static void __init build_r4000_tlb_store_handler(void)
...@@ -1722,6 +1709,7 @@ static void __init build_r4000_tlb_store_handler(void) ...@@ -1722,6 +1709,7 @@ static void __init build_r4000_tlb_store_handler(void)
u32 *p = handle_tlbs; u32 *p = handle_tlbs;
struct label *l = labels; struct label *l = labels;
struct reloc *r = relocs; struct reloc *r = relocs;
int i;
memset(handle_tlbs, 0, sizeof(handle_tlbs)); memset(handle_tlbs, 0, sizeof(handle_tlbs));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1740,17 +1728,14 @@ static void __init build_r4000_tlb_store_handler(void) ...@@ -1740,17 +1728,14 @@ static void __init build_r4000_tlb_store_handler(void)
panic("TLB store handler fastpath space exceeded"); panic("TLB store handler fastpath space exceeded");
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB store handler fastpath (%u instructions).\n", pr_info("Synthesized TLB store handler fastpath (%u instructions).\n",
(unsigned int)(p - handle_tlbs)); (unsigned int)(p - handle_tlbs));
#ifdef DEBUG_TLB
{
int i;
for (i = 0; i < (p - handle_tlbs); i++) pr_debug("\t.set push\n");
printk("%08x\n", handle_tlbs[i]); pr_debug("\t.set noreorder\n");
} for (i = 0; i < (p - handle_tlbs); i++)
#endif pr_debug("\t.word 0x%08x\n", handle_tlbs[i]);
pr_debug("\t.set pop\n");
} }
static void __init build_r4000_tlb_modify_handler(void) static void __init build_r4000_tlb_modify_handler(void)
...@@ -1758,6 +1743,7 @@ static void __init build_r4000_tlb_modify_handler(void) ...@@ -1758,6 +1743,7 @@ static void __init build_r4000_tlb_modify_handler(void)
u32 *p = handle_tlbm; u32 *p = handle_tlbm;
struct label *l = labels; struct label *l = labels;
struct reloc *r = relocs; struct reloc *r = relocs;
int i;
memset(handle_tlbm, 0, sizeof(handle_tlbm)); memset(handle_tlbm, 0, sizeof(handle_tlbm));
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
...@@ -1777,17 +1763,14 @@ static void __init build_r4000_tlb_modify_handler(void) ...@@ -1777,17 +1763,14 @@ static void __init build_r4000_tlb_modify_handler(void)
panic("TLB modify handler fastpath space exceeded"); panic("TLB modify handler fastpath space exceeded");
resolve_relocs(relocs, labels); resolve_relocs(relocs, labels);
printk("Synthesized TLB modify handler fastpath (%u instructions).\n", pr_info("Synthesized TLB modify handler fastpath (%u instructions).\n",
(unsigned int)(p - handle_tlbm)); (unsigned int)(p - handle_tlbm));
#ifdef DEBUG_TLB pr_debug("\t.set push\n");
{ pr_debug("\t.set noreorder\n");
int i; for (i = 0; i < (p - handle_tlbm); i++)
pr_debug("\t.word 0x%08x\n", handle_tlbm[i]);
for (i = 0; i < (p - handle_tlbm); i++) pr_debug("\t.set pop\n");
printk("%08x\n", handle_tlbm[i]);
}
#endif
} }
void __init build_tlb_refill_handler(void) void __init build_tlb_refill_handler(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment