Date: Wed, 19 Jul 2006 10:44:10 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 101911 for review Message-ID: <200607191044.k6JAiAVW021783@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101911 Change 101911 by jb@jb_freebsd2 on 2006/07/19 10:43:25 Looks like %tstate is only accessible > tl0. Trying to read it in tl0 causes a bad instruction trap with is counter-productive in the kernel kaboom kind of way. Affected files ... .. //depot/projects/dtrace/src/sys/sun4v/include/cpu_snapshot.h#2 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/cpu_snapshot.c#2 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/cpu_snapshot_save.S#2 edit Differences ... ==== //depot/projects/dtrace/src/sys/sun4v/include/cpu_snapshot.h#2 (text+ko) ==== @@ -31,10 +31,9 @@ #define CPU_SNAPSHOT_R_G6 0xb0 #define CPU_SNAPSHOT_R_G7 0xb8 #define CPU_SNAPSHOT_PSTATE 0xc0 -#define CPU_SNAPSHOT_TSTATE 0xc8 -#define CPU_SNAPSHOT_TL 0xd0 -#define CPU_SNAPSHOT_TICK 0xd8 -#define CPU_SNAPSHOT_PIL 0xe0 +#define CPU_SNAPSHOT_TL 0xc8 +#define CPU_SNAPSHOT_TICK 0xd0 +#define CPU_SNAPSHOT_PIL 0xd8 #ifndef __ASM__ @@ -64,11 +63,10 @@ uint64_t r_g6; uint64_t r_g7; uint64_t pstate; - uint64_t tstate; uint64_t tl; uint64_t tick; uint64_t pil; - uint64_t pad[3]; + uint64_t pad[4]; }; #ifdef CPU_SNAPSHOT_GLOBAL ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/cpu_snapshot.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ if (p->r_o7 == 0) continue; - printf("[%02d] CallAddr: 0x%jx count %jd pstate 0x%jx tstate 0x%jx tl 0x%jx tick 0x%jx pil 0x%jx\n",j,p->r_o7,p->count,p->pstate,p->tstate,p->tl,p->tick,p->pil); + printf("[%02d] CallAddr: 0x%jx count %jd pstate 0x%jx tl 0x%jx tick 0x%jx pil 0x%jx\n",j,p->r_o7,p->count,p->pstate,p->tl,p->tick,p->pil); printf(" I: 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx\n",p->r_i0,p->r_i1,p->r_i2,p->r_i3,p->r_i4,p->r_i5,p->r_i6,p->r_i7); printf(" O: 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx\n",p->r_o0,p->r_o1,p->r_o2,p->r_o3,p->r_o4,p->r_o5,p->r_o6,p->r_o7); printf(" G: 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx 0x%jx\n",p->r_g1,p->r_g2,p->r_g3,p->r_g4,p->r_g5,p->r_g6,p->r_g7); ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/cpu_snapshot_save.S#2 (text+ko) ==== @@ -36,7 +36,7 @@ /* Get the current CPU number. */ #ifdef _KERNEL - ldx [ PCPU(CPUID) ], %g1 + lduw [ PCPU(CPUID) ], %g1 #else mov %g0, %g1 #endif @@ -116,14 +116,12 @@ #ifdef _KERNEL rdpr %pstate, %g4 stx %g4, [ %g2 + CPU_SNAPSHOT_PSTATE ] - rdpr %tstate, %g4 - stx %g4, [ %g2 + CPU_SNAPSHOT_TSTATE ] - rdpr %tl, %g4 - stx %g4, [ %g2 + CPU_SNAPSHOT_TL ] rdpr %tick, %g4 stx %g4, [ %g2 + CPU_SNAPSHOT_TICK ] rdpr %pil, %g4 stx %g4, [ %g2 + CPU_SNAPSHOT_PIL ] + rdpr %tl, %g4 + stx %g4, [ %g2 + CPU_SNAPSHOT_TL ] #endif ba,a .cpu_snapshot_save_4
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607191044.k6JAiAVW021783>