linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [powerpc] update xmon slb code
@ 2007-10-29 19:59 Will Schmidt
  2007-10-29 20:52 ` Olof Johansson
  0 siblings, 1 reply; 3+ messages in thread
From: Will Schmidt @ 2007-10-29 19:59 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


[powerpc] update xmon slb code

adds a bit more detail to the xmon SLB output.  When the valid bit is
set, This displays the ESID and VSID values, as well as decoding the
segment size. (1T or 256M).  This supresses the output for any slb entries
that contain only zeros.

I debated a bit on whether to check for just (valid) versus checking for
(valid|esid|vsid).  By inspection on power5, I do have SLB entries that
contain values but without the valid bit set, so opted to display any
non-zero values.

sample output from power6 (1T segment support):

00 c000000008000000 40004f7ca3000500  1T  ESID=c00000  VSID=40004f7ca3
01 d000000008000000 4000eb71b0000400  1T  ESID=d00000  VSID=4000eb71b0
24 cf00000008000000 400011b260000500  1T  ESID=cf0000  VSID=400011b260
25 0000040008000000 4000a9e949000c80  1T  ESID=4  VSID=4000a9e949
26 0000000018000000 00005e93bfd49c80 256M ESID=1  VSID=5e93bfd49
27 00000f0008000000 4000e262a4000c80  1T  ESID=f  VSID=4000e262a4
28 0000000008000000 00005dd45172ec80 256M ESID=0  VSID=5dd45172e

sample output from power5 (notice the non-valid but non-zero entries)

54 0000000048000000 0000cf33bb059c80 256M ESID=4  VSID=cf33bb059
55 0000000018000000 0000ccf56fe08c80 256M ESID=1  VSID=ccf56fe08
56 0000000010000000 0000dd82ce799c80
57 cf00000008000000 0000d59aca40f500 256M ESID=cf0000000  VSID=d59aca40f
58 c000000078000000 000045cb97751500 256M ESID=c00000007  VSID=45cb97751
59 0000040000000000 000061552db1bc80

Tested on power5 and power6.

Signed-Off-By: Will Schmidt <will_schmidt@vnet.ibm.com>
---

 arch/powerpc/xmon/xmon.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)


diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 121b04d..97984f3 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2527,16 +2527,24 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
 static void dump_slb(void)
 {
 	int i;
-	unsigned long tmp;
+	unsigned long esid,vsid,valid;
 
 	printf("SLB contents of cpu %x\n", smp_processor_id());
 
 	for (i = 0; i < SLB_NUM_ENTRIES; i++) {
-		asm volatile("slbmfee  %0,%1" : "=r" (tmp) : "r" (i));
-		printf("%02d %016lx ", i, tmp);
-
-		asm volatile("slbmfev  %0,%1" : "=r" (tmp) : "r" (i));
-		printf("%016lx\n", tmp);
+		asm volatile("slbmfee  %0,%1" : "=r" (esid) : "r" (i));
+		asm volatile("slbmfev  %0,%1" : "=r" (vsid) : "r" (i));
+		valid = (esid & SLB_ESID_V);
+		if (valid | esid | vsid) {
+			printf("%02d %016lx %016lx", i, esid, vsid);
+			if (valid) {
+				if (vsid & SLB_VSID_B_1T)
+					printf("  1T  ESID=%lx  VSID=%lx \n", GET_ESID_1T(esid),vsid >>SLB_VSID_SHIFT_1T);
+				else 
+					printf(" 256M ESID=%lx  VSID=%lx \n", GET_ESID(esid),vsid >>SLB_VSID_SHIFT);
+			} else 
+				printf("\n");
+		}
 	}
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [powerpc] update xmon slb code
  2007-10-29 19:59 [PATCH] [powerpc] update xmon slb code Will Schmidt
@ 2007-10-29 20:52 ` Olof Johansson
  2007-10-29 23:17   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Olof Johansson @ 2007-10-29 20:52 UTC (permalink / raw)
  To: Will Schmidt; +Cc: linuxppc-dev, paulus

On Mon, Oct 29, 2007 at 02:59:27PM -0500, Will Schmidt wrote:
> 
> [powerpc] update xmon slb code
> 
> adds a bit more detail to the xmon SLB output.  When the valid bit is
> set, This displays the ESID and VSID values, as well as decoding the
> segment size. (1T or 256M).  This supresses the output for any slb entries
> that contain only zeros.
> 
> I debated a bit on whether to check for just (valid) versus checking for
> (valid|esid|vsid).  By inspection on power5, I do have SLB entries that
> contain values but without the valid bit set, so opted to display any
> non-zero values.

Yeah, newer versions of the architecture specify that invalid entries
must read as 0, while POWER5 doesn't. Printing them doesn't hurt.

> sample output from power6 (1T segment support):
> 
> 00 c000000008000000 40004f7ca3000500  1T  ESID=c00000  VSID=40004f7ca3
> 01 d000000008000000 4000eb71b0000400  1T  ESID=d00000  VSID=4000eb71b0
> 24 cf00000008000000 400011b260000500  1T  ESID=cf0000  VSID=400011b260
> 25 0000040008000000 4000a9e949000c80  1T  ESID=4  VSID=4000a9e949
> 26 0000000018000000 00005e93bfd49c80 256M ESID=1  VSID=5e93bfd49
> 27 00000f0008000000 4000e262a4000c80  1T  ESID=f  VSID=4000e262a4
> 28 0000000008000000 00005dd45172ec80 256M ESID=0  VSID=5dd45172e
> 
> sample output from power5 (notice the non-valid but non-zero entries)
> 
> 54 0000000048000000 0000cf33bb059c80 256M ESID=4  VSID=cf33bb059
> 55 0000000018000000 0000ccf56fe08c80 256M ESID=1  VSID=ccf56fe08
> 56 0000000010000000 0000dd82ce799c80
> 57 cf00000008000000 0000d59aca40f500 256M ESID=cf0000000  VSID=d59aca40f
> 58 c000000078000000 000045cb97751500 256M ESID=c00000007  VSID=45cb97751
> 59 0000040000000000 000061552db1bc80
> 
> Tested on power5 and power6.

Nice, I like it! I wonder if it would make sense to (space) pad the
ESID/VSID fields so they line up, it'd make output just a little tidier.

(If you end up changing that, please also break the long printf lines
in two.)

Beside that it looks good to me! :)


-Olof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [powerpc] update xmon slb code
  2007-10-29 20:52 ` Olof Johansson
@ 2007-10-29 23:17   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2007-10-29 23:17 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, Will Schmidt, paulus


> Nice, I like it! I wonder if it would make sense to (space) pad the
> ESID/VSID fields so they line up, it'd make output just a little tidier.
> 
> (If you end up changing that, please also break the long printf lines
> in two.)
> 
> Beside that it looks good to me! :)

Can you also print out the LLP bits ? (I won't ask you to also decode
the page size though that would be useful :-)

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-29 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 19:59 [PATCH] [powerpc] update xmon slb code Will Schmidt
2007-10-29 20:52 ` Olof Johansson
2007-10-29 23:17   ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).