From owner-p4-projects@FreeBSD.ORG Wed Jul 19 10:44:11 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 260DF16A4E2; Wed, 19 Jul 2006 10:44:11 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C02D816A4DF for ; Wed, 19 Jul 2006 10:44:10 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5724D43D49 for ; Wed, 19 Jul 2006 10:44:10 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6JAiAYu021786 for ; Wed, 19 Jul 2006 10:44:10 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6JAiAVW021783 for perforce@freebsd.org; Wed, 19 Jul 2006 10:44:10 GMT (envelope-from jb@freebsd.org) Date: Wed, 19 Jul 2006 10:44:10 GMT Message-Id: <200607191044.k6JAiAVW021783@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 101911 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2006 10:44:11 -0000 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