diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2014-05-26 07:02:14 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-06-04 23:20:00 -0400 |
commit | 736256e4f1bc50bb8198c9b61dffd5fd0de17477 (patch) | |
tree | e885fa76651073286b77358f27e8360719975e93 /arch/powerpc/xmon | |
parent | 4926616c77435e735c59288f838e7761baec4a6c (diff) |
powerpc/xmon: Fix up xmon format strings
There are a couple of places where xmon is using %x to print values that
are unsigned long.
I found this out the hard way recently:
0:mon> p c000000000d0e7c8 c00000033dc90000 00000000a0000089 c000000000000000
return value is 0x96300500
Which is calling find_linux_pte_or_hugepte(), the result should be a
kernel pointer. After decoding the page tables by hand I discovered the
correct value was c000000396300500.
So fix up that case and a few others.
We also use a mix of 0x%x, %x and %u to print cpu numbers. So
standardise on 0x%x.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/xmon')
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index d3759b7a5535..d199bfa2f1fa 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -419,7 +419,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
419 | get_output_lock(); | 419 | get_output_lock(); |
420 | excprint(regs); | 420 | excprint(regs); |
421 | if (bp) { | 421 | if (bp) { |
422 | printf("cpu 0x%x stopped at breakpoint 0x%x (", | 422 | printf("cpu 0x%x stopped at breakpoint 0x%lx (", |
423 | cpu, BP_NUM(bp)); | 423 | cpu, BP_NUM(bp)); |
424 | xmon_print_symbol(regs->nip, " ", ")\n"); | 424 | xmon_print_symbol(regs->nip, " ", ")\n"); |
425 | } | 425 | } |
@@ -513,7 +513,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
513 | excprint(regs); | 513 | excprint(regs); |
514 | bp = at_breakpoint(regs->nip); | 514 | bp = at_breakpoint(regs->nip); |
515 | if (bp) { | 515 | if (bp) { |
516 | printf("Stopped at breakpoint %x (", BP_NUM(bp)); | 516 | printf("Stopped at breakpoint %lx (", BP_NUM(bp)); |
517 | xmon_print_symbol(regs->nip, " ", ")\n"); | 517 | xmon_print_symbol(regs->nip, " ", ")\n"); |
518 | } | 518 | } |
519 | if (unrecoverable_excp(regs)) | 519 | if (unrecoverable_excp(regs)) |
@@ -997,14 +997,14 @@ static int cpu_cmd(void) | |||
997 | last_cpu = cpu; | 997 | last_cpu = cpu; |
998 | } else { | 998 | } else { |
999 | if (last_cpu != first_cpu) | 999 | if (last_cpu != first_cpu) |
1000 | printf("-%lx", last_cpu); | 1000 | printf("-0x%lx", last_cpu); |
1001 | last_cpu = first_cpu = cpu; | 1001 | last_cpu = first_cpu = cpu; |
1002 | printf(" %lx", cpu); | 1002 | printf(" 0x%lx", cpu); |
1003 | } | 1003 | } |
1004 | } | 1004 | } |
1005 | } | 1005 | } |
1006 | if (last_cpu != first_cpu) | 1006 | if (last_cpu != first_cpu) |
1007 | printf("-%lx", last_cpu); | 1007 | printf("-0x%lx", last_cpu); |
1008 | printf("\n"); | 1008 | printf("\n"); |
1009 | return 0; | 1009 | return 0; |
1010 | } | 1010 | } |
@@ -1024,7 +1024,7 @@ static int cpu_cmd(void) | |||
1024 | /* take control back */ | 1024 | /* take control back */ |
1025 | mb(); | 1025 | mb(); |
1026 | xmon_owner = smp_processor_id(); | 1026 | xmon_owner = smp_processor_id(); |
1027 | printf("cpu %u didn't take control\n", cpu); | 1027 | printf("cpu 0x%x didn't take control\n", cpu); |
1028 | return 0; | 1028 | return 0; |
1029 | } | 1029 | } |
1030 | barrier(); | 1030 | barrier(); |
@@ -1086,7 +1086,7 @@ csum(void) | |||
1086 | fcs = 0xffff; | 1086 | fcs = 0xffff; |
1087 | for (i = 0; i < ncsum; ++i) { | 1087 | for (i = 0; i < ncsum; ++i) { |
1088 | if (mread(adrs+i, &v, 1) == 0) { | 1088 | if (mread(adrs+i, &v, 1) == 0) { |
1089 | printf("csum stopped at %x\n", adrs+i); | 1089 | printf("csum stopped at "REG"\n", adrs+i); |
1090 | break; | 1090 | break; |
1091 | } | 1091 | } |
1092 | fcs = FCS(fcs, v); | 1092 | fcs = FCS(fcs, v); |
@@ -1202,12 +1202,12 @@ bpt_cmds(void) | |||
1202 | /* assume a breakpoint address */ | 1202 | /* assume a breakpoint address */ |
1203 | bp = at_breakpoint(a); | 1203 | bp = at_breakpoint(a); |
1204 | if (bp == NULL) { | 1204 | if (bp == NULL) { |
1205 | printf("No breakpoint at %x\n", a); | 1205 | printf("No breakpoint at %lx\n", a); |
1206 | break; | 1206 | break; |
1207 | } | 1207 | } |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | printf("Cleared breakpoint %x (", BP_NUM(bp)); | 1210 | printf("Cleared breakpoint %lx (", BP_NUM(bp)); |
1211 | xmon_print_symbol(bp->address, " ", ")\n"); | 1211 | xmon_print_symbol(bp->address, " ", ")\n"); |
1212 | bp->enabled = 0; | 1212 | bp->enabled = 0; |
1213 | break; | 1213 | break; |
@@ -1746,7 +1746,7 @@ mwrite(unsigned long adrs, void *buf, int size) | |||
1746 | __delay(200); | 1746 | __delay(200); |
1747 | n = size; | 1747 | n = size; |
1748 | } else { | 1748 | } else { |
1749 | printf("*** Error writing address %x\n", adrs + n); | 1749 | printf("*** Error writing address "REG"\n", adrs + n); |
1750 | } | 1750 | } |
1751 | catch_memory_errors = 0; | 1751 | catch_memory_errors = 0; |
1752 | return n; | 1752 | return n; |
@@ -2435,7 +2435,7 @@ static void proccall(void) | |||
2435 | ret = func(args[0], args[1], args[2], args[3], | 2435 | ret = func(args[0], args[1], args[2], args[3], |
2436 | args[4], args[5], args[6], args[7]); | 2436 | args[4], args[5], args[6], args[7]); |
2437 | sync(); | 2437 | sync(); |
2438 | printf("return value is %x\n", ret); | 2438 | printf("return value is 0x%lx\n", ret); |
2439 | } else { | 2439 | } else { |
2440 | printf("*** %x exception occurred\n", fault_except); | 2440 | printf("*** %x exception occurred\n", fault_except); |
2441 | } | 2441 | } |
@@ -2700,7 +2700,7 @@ static void dump_slb(void) | |||
2700 | unsigned long esid,vsid,valid; | 2700 | unsigned long esid,vsid,valid; |
2701 | unsigned long llp; | 2701 | unsigned long llp; |
2702 | 2702 | ||
2703 | printf("SLB contents of cpu %x\n", smp_processor_id()); | 2703 | printf("SLB contents of cpu 0x%x\n", smp_processor_id()); |
2704 | 2704 | ||
2705 | for (i = 0; i < mmu_slb_size; i++) { | 2705 | for (i = 0; i < mmu_slb_size; i++) { |
2706 | asm volatile("slbmfee %0,%1" : "=r" (esid) : "r" (i)); | 2706 | asm volatile("slbmfee %0,%1" : "=r" (esid) : "r" (i)); |
@@ -2732,7 +2732,7 @@ static void dump_stab(void) | |||
2732 | int i; | 2732 | int i; |
2733 | unsigned long *tmp = (unsigned long *)local_paca->stab_addr; | 2733 | unsigned long *tmp = (unsigned long *)local_paca->stab_addr; |
2734 | 2734 | ||
2735 | printf("Segment table contents of cpu %x\n", smp_processor_id()); | 2735 | printf("Segment table contents of cpu 0x%x\n", smp_processor_id()); |
2736 | 2736 | ||
2737 | for (i = 0; i < PAGE_SIZE/16; i++) { | 2737 | for (i = 0; i < PAGE_SIZE/16; i++) { |
2738 | unsigned long a, b; | 2738 | unsigned long a, b; |