From owner-freebsd-ppc@FreeBSD.ORG Mon Oct 8 11:07:26 2012 Return-Path: Delivered-To: freebsd-ppc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D1291065673 for ; Mon, 8 Oct 2012 11:07:26 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 27A1D8FC29 for ; Mon, 8 Oct 2012 11:07:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q98B7Q0B029424 for ; Mon, 8 Oct 2012 11:07:26 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q98B7Pxs029422 for freebsd-ppc@FreeBSD.org; Mon, 8 Oct 2012 11:07:25 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 8 Oct 2012 11:07:25 GMT Message-Id: <201210081107.q98B7Pxs029422@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-ppc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-ppc@FreeBSD.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 11:07:26 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o power/170340 ppc Enabling geom-mirror on 9.1-powerpc64 prevents the sys o power/164225 ppc Boot fails on IBM 7028-6E1 (heap memory claim failed) o power/161947 ppc multimedia/libdvdnav builds broken binaries on big end o power/161045 ppc X doesn't detect ADB mouse up event until another even o power/149009 ppc sysinstall(8) on powerpc fails to install manpages, so o power/140241 ppc [kernel] [patch] Linker set problems on PowerPC EABI o power/135576 ppc gdb cannot debug threaded programs on ppc o power/133503 ppc [sound] Sound stutter after switching ttys o power/133382 ppc [install] Installer gets signal 11 o power/131548 ppc ofw_syscons no longer supports 32-bit framebuffer 10 problems total. From owner-freebsd-ppc@FreeBSD.ORG Mon Oct 8 11:07:26 2012 Return-Path: Delivered-To: freebsd-ppc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D1291065673 for ; Mon, 8 Oct 2012 11:07:26 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 27A1D8FC29 for ; Mon, 8 Oct 2012 11:07:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q98B7Q0B029424 for ; Mon, 8 Oct 2012 11:07:26 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q98B7Pxs029422 for freebsd-ppc@FreeBSD.org; Mon, 8 Oct 2012 11:07:25 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 8 Oct 2012 11:07:25 GMT Message-Id: <201210081107.q98B7Pxs029422@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-ppc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-ppc@FreeBSD.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 11:07:26 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o power/170340 ppc Enabling geom-mirror on 9.1-powerpc64 prevents the sys o power/164225 ppc Boot fails on IBM 7028-6E1 (heap memory claim failed) o power/161947 ppc multimedia/libdvdnav builds broken binaries on big end o power/161045 ppc X doesn't detect ADB mouse up event until another even o power/149009 ppc sysinstall(8) on powerpc fails to install manpages, so o power/140241 ppc [kernel] [patch] Linker set problems on PowerPC EABI o power/135576 ppc gdb cannot debug threaded programs on ppc o power/133503 ppc [sound] Sound stutter after switching ttys o power/133382 ppc [install] Installer gets signal 11 o power/131548 ppc ofw_syscons no longer supports 32-bit framebuffer 10 problems total. From owner-freebsd-ppc@FreeBSD.ORG Tue Oct 9 09:22:36 2012 Return-Path: Delivered-To: freebsd-ppc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E64928BD for ; Tue, 9 Oct 2012 09:22:36 +0000 (UTC) (envelope-from barthel@lvnworth.com) Received: from mx.lvnworth.com (mx.lvnworth.com [173.197.5.98]) by mx1.freebsd.org (Postfix) with ESMTP id 51D9E8FC8B for ; Tue, 9 Oct 2012 08:05:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx.lvnworth.com (Postfix) with ESMTP id 1AF1B235F9 for ; Tue, 9 Oct 2012 02:34:05 -0500 (CDT) X-Virus-Scanned: Debian amavisd-new at mx.lvnworth.com Received: from mx.lvnworth.com ([127.0.0.1]) by localhost (mx.lvnworth.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id abQEuzJ8qtee for ; Tue, 9 Oct 2012 02:34:00 -0500 (CDT) Received: from mail.lvnworth.com (rrcs-173-197-5-84.west.biz.rr.com [173.197.5.84]) by mx.lvnworth.com (Postfix) with ESMTP id 4BA9823659 for ; Tue, 9 Oct 2012 02:30:11 -0500 (CDT) Received: from lvnworth.com [93.95.103.5] by mail.lvnworth.com with ESMTP (SMTPD-9.23) id A2890ADC; Tue, 09 Oct 2012 02:30:17 -0500 Date: Tue, 9 Oct 2012 10:54:04 +0200 From: =?windows-1251?Q?=C4=F0=F3=E3=E0=ED=E8=ED=E0_=CC=E8=EB=E5=ED=E0?= Organization: yncmrxyubc X-Priority: 3 (Normal) Message-ID: <430864797.20121009105404@lvnworth.com> To: freebsd-ppc@FreeBSD.org Subject: =?windows-1251?Q?=F4=F0=FD=ED=E4=21_=EF=F0=EE=E2=E5=F0=FC_=F1=EE=E1=F1=F2=E2=E5=ED=ED=EE=E5_=E7=F0=E5=ED=E8=FF=21?= MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Declude-Sender: barthel@lvnworth.com [93.95.103.5] X-Declude-Spoolname: Dd28900d100005c02.smd X-Note: This E-mail was scanned by for spam. X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 09:22:37 -0000 http://www.sh-jianghan.com/templates/vision.php From owner-freebsd-ppc@FreeBSD.ORG Tue Oct 9 10:23:40 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DD3A831 for ; Tue, 9 Oct 2012 10:23:40 +0000 (UTC) (envelope-from bounce@i.i-villa.net) Received: from i.i-villa.net (i.i-villa.net [64.31.59.126]) by mx1.freebsd.org (Postfix) with ESMTP id 418BE8FC1C for ; Tue, 9 Oct 2012 10:23:40 +0000 (UTC) Received: (qmail 31852 invoked by uid 1006); 9 Oct 2012 10:23:39 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=private; d=i.i-villa.net; b=oebgRNJ7MuadH9ANJ+++iRqMv2ymImEpo6Eo1WVwHkRh9zGldXRHiVy3jm0QJIzB; Date: Tue, 09 Oct 2012 03:23:39 -0700 From: "sales@secuv.us" To: "freebsd-ppc@freebsd.org" Errors-To: bounce@i.i-villa.net X-Priority: 3 Precedence: list List: m List-Owner: List-URL: Message-ID: <20121009023137.53562660@i.i-villa.net> X-Mailer: Secuv Mailer 5.2.1 Stable - 8/17/12 MIME-Version: 1.0 Subject: 7 Inch Digital All in One 4 & 8CH LCD DVR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Reply-To: sales@secuv.us List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 10:23:40 -0000 (Mailing list information, including how to remove yourself, is located at = the end of this message.) __=20 Dear Manager, 7 Inch Digital All in One 4 & 8CH LCD DVR Features: The LCD DVR with a flexible Bracket, It can support 120 Degree rotate and L= CD Screen can support 330 Degree rotate. Integrate 7inch digital LCD, the screen resolution is 800X480. H.264 compression format. Support mobile phone surveillance Support languages: English, German, French, Spanish, Italian, Russian, Port= uguese=E2=80=A6 Video and audio real time recording and playback at the same time. Support HD VGA output, the resolution is high to 1280X1024. Searching modes: time / data searching, event searching, recording group se= arching. Backup modes: network backup, USB 2.0 backup. Support RS-485 PTZ control (speed dome camera), and preset positions operat= ion. Support USB mouse and infrared remote controller operation. Multiplex operation: live, record, playback, network can be operated at the= same time. This Product is fit for Villa, House, Supermarket, store and so on The storage of the HD: 2TB Support smart phone You can see the frame through TV, network, phone at the same time. Specification: Model SLD6414 SLD6818 Operation System Embedded Linux Operation System Operation Interface GUI, support mouse, pane, remote control operation Video Standard PAL, NTSC System Resources Multi-tasking operation, simultaneous multi-channel recording, simultaneous= video playback and simultaneous network operation. Video Compression H.264 Audio Compression G.711A Recording Mode Manual, Timing, Alarm, Motion detection Search Mode By time, event, channel, log Backup Mode Network download, USB backup Video Input 4ch BNC 8ch BNC Video Output LCD:7inch (Resolution:1024X768) CVBS VGA Resolution: 1280X1024 Audio Input 4CH RCA 8CH RCA Audio Output 1ch RCA Voice Talkback 1ch RCA Live Video Resolution PAL:720x576(D1 );NTSC:720x480(D1) Playback Resolution 1 D1 + 3CIF 2 D1 + 6CIF Image Control selectable Remove Detection Each channel can set independent detection zones and multilevel sensitivity Video Display 1/4/8 multiple display Recording Frame Rate PAL: 25f/s(Adjustable) NTSC:30f/s(Adjustable) Recording Storage Local HDD, Network Local Playback Select any 4 channel playback at same time Alarm Input 4ch Alarm Output 1ch output PTZ Control RS485 HD Interface 1 SATA Ports Network Interface RJ45 10M/100M Adaptable Ethernet Connection Mobile Phone View Support iPhone, blackberry, Windows Mobile, Android, Symbian USB Interface 2 USB2.0 High-speed Port Power Supply 12V 4A SLD7414: 7 Inch Digital All in One 4CH LCD DVR SLD6818: 8 Channel 7 Inch Digital LCD All in One DVR Price(MOQ=3D10PCS): SLD6414: US$79/pcs SLD6818: US$89/pcs For more products, please visit www.secuv.com and www.secuv.biz. If you have any question, please feel free to contact with me. Thank you. Best regards Ari Sun --=20 Subscription Reminder: You're Subscribed to, Secuv Technology Ltd=20 Using the address: freebsd-ppc@freebsd.org From: sales-secuv.us@i.i-villa.net www.secuv.com; www.secuv.biz Unsubscribe Automatically: http://i.i-villa.net/cgi-bin/secuv/mail.cgi/ur/m/freebsd-ppc/freebsd.org/= From owner-freebsd-ppc@FreeBSD.ORG Tue Oct 9 22:30:38 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4485380 for ; Tue, 9 Oct 2012 22:30:38 +0000 (UTC) (envelope-from mail@mailsu.ru) Received: from mailsu.ru (mailsu.ru [95.128.246.31]) by mx1.freebsd.org (Postfix) with ESMTP id 5ADA08FC20 for ; Tue, 9 Oct 2012 22:30:38 +0000 (UTC) Received: from mailsu.ru by mailsu.ru (MDaemon FREE v12.5.3) with ESMTP id md50000621787.msg for ; Wed, 10 Oct 2012 02:30:23 +0400 X-Authenticated-Sender: mail@mailsu.ru X-Return-Path: mail@mailsu.ru X-Envelope-From: mail@mailsu.ru X-MDaemon-Deliver-To: freebsd-ppc@freebsd.org From: "=?Windows-1251?B?0eXw4+Xp?=" Subject: =?Windows-1251?B?ZnJlZWJzZHBwY2ZyZWVic2QgIOIg7vLk5esg6+7j6PHy6OroIOjr6CDx7eDh5uXt6P8=?= To: "freebsd-ppc" MIME-Version: 1.0 Organization: =?Windows-1251?B?w8DQwM3SwCDL7uPo8fLo6iDD7OHVIEJlcmxpbg==?= Date: Wed, 10 Oct 2012 02:30:21 +0400 Message-Id: <20121009223038.E4485380@hub.freebsd.org> Content-Type: text/plain; charset="Windows-1251" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 22:30:39 -0000 =D3=E2=E0=E6=E0=E5=EC=FB=E5 =C4=E0=EC=FB =E8 =C3=EE=F1=EF=EE=E4=E0, =20 =ED=F3=E6=ED=FB =E4=E0=EB=FC=ED=E5=E9=F8=E8=E5 =E8=ED=F1=F2=F0=F3=EA=F6=E8= =E8 =EF=EE =C2=E0=F8=E5=EC=F3 =E3=F0=F3=E7=F3. =C3=F0=F3=E7 =E4=EB=FF =C2= =E0=F8=E5=E9 =EA=EE=EC=EF=E0=ED=E8=E8 - 2 =EC=E5=F1=F2=E0 17 =F3=E3, =F1=EA= =EE=F0=E5=E5 =E2=F1=E5=E3=EE =EE=F8=E8=E1=EE=F7=ED=EE, =EF=EE=EF=E0=EB =EA = =ED=E0=EC =ED=E0 =F1=EA=EB=E0=E4 =E2 =C1=E5=F0=EB=E8=ED.=20 =D1=EE=EE=E1=F9=E8=F2=E5 =ED=E0=EC =EA=F3=E4=E0 =C2=E0=EC =E5=E3=EE =EE=F2= =EF=F0=E0=E2=E8=F2=FC. =CF=EE=F1=F2=E0=F0=E0=E9=F2=E5=F1=FC =EE=F2=E2=E5=F2= =E8=F2=FC =EA=E0=EA =EC=EE=E6=ED=EE =EE=EF=E5=F0=E0=F2=E8=E2=ED=E5=E5!=20 =C3=E0=F0=E0=ED=F2=E0 =C3=EC=E1=D5=20 =D1 =F3=E2.=D1=E5=F0=E3=E5=E9 =EE=F2=E2=E5=F2 =EC=EE=E6=ED=EE =EF=F0=E8=F1=EB=E0=F2=FC =F2=E0=EA=E6=E5 = =ED=E0 =E0=E4=F0=E5=F1 garantaorder@mail.ru This message was delivered by MDaemon - http://www.altn.com/MDaemon/ From owner-freebsd-ppc@FreeBSD.ORG Tue Oct 9 23:08:42 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E99D157F for ; Tue, 9 Oct 2012 23:08:42 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 94F7A8FC14 for ; Tue, 9 Oct 2012 23:08:42 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i29so4394293qaf.13 for ; Tue, 09 Oct 2012 16:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type; bh=3cu20IqoDD4jxJGjfrjMFgPTsx0UXGkwRWtnIyId/KQ=; b=oJf5XQuWrtwnzZTlmWUOXWVOwSzH+tE47ZoF5GZvwF426KbDCDNroFnBYJStURjFHy xa8T2gvL7wmsLjie2rzqU28kVz1Af6sZqnptvHidE36Fe/Lv4ALwuPIb/RfOS+RwtgrT YGiSEG45nkZcqhLf4QFq0oa9Xkta2gYwIaXZNVg3B3iTE9m39kxPDaOhmTLAF5/gb8z8 tDideABe5GwASfWoCdZzyNloQVXsU2aqHgL7d7MaJzgfxeYQjpOAfzPYVXPvod+tYaPq SFaVZZkTPPQtWfZeBE1zLSMWxFdLip4A9ppweGlFrz8FNDc5UMinhlRS10niRxeAUQKd 2bQw== Received: by 10.224.180.132 with SMTP id bu4mr36933310qab.62.1349824121570; Tue, 09 Oct 2012 16:08:41 -0700 (PDT) Received: from narn.knownspace (pool-108-48-127-15.washdc.fios.verizon.net. [108.48.127.15]) by mx.google.com with ESMTPS id gw9sm22318855qab.4.2012.10.09.16.08.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 16:08:41 -0700 (PDT) Date: Tue, 9 Oct 2012 19:08:38 -0400 From: Justin Hibbits To: freebsd-ppc@freebsd.org Subject: CFT: Dtrace on PowerPC Message-ID: <20121009190838.283976e1@narn.knownspace> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/9K3kvrXQMtb..M4KOjMYthu" X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 23:08:43 -0000 --MP_/9K3kvrXQMtb..M4KOjMYthu Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline After a few days of development, and a few weeks of testing, here's Dtrace on PowerPC. There is only one known issue that I know of so far: dtruss kernel panics through an assertion. I have to investigate this some more, but some dtrace -n "" testing works. - Justin --MP_/9K3kvrXQMtb..M4KOjMYthu Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=dtrace_ppc.diff Index: lib/Makefile =================================================================== --- lib/Makefile (revision 241162) +++ lib/Makefile (working copy) @@ -209,6 +209,8 @@ .endif .if ${MACHINE_CPUARCH} == "powerpc" +_libproc= libproc +_librtld_db= librtld_db _libsmb= libsmb .endif Index: lib/libproc/proc_regs.c =================================================================== --- lib/libproc/proc_regs.c (revision 241162) +++ lib/libproc/proc_regs.c (working copy) @@ -60,6 +60,8 @@ *regvalue = regs.r_eip; #elif defined(__mips__) *regvalue = regs.r_regs[PC]; +#elif defined(__powerpc__) + *regvalue = regs.pc; #endif break; case REG_SP: @@ -69,6 +71,8 @@ *regvalue = regs.r_esp; #elif defined(__mips__) *regvalue = regs.r_regs[SP]; +#elif defined(__powerpc__) + *regvalue = regs.fixreg[1]; #endif break; default: @@ -99,6 +103,8 @@ regs.r_eip = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.pc = regvalue; #endif break; case REG_SP: @@ -108,6 +114,8 @@ regs.r_esp = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.fixreg[1] = regvalue; #endif break; default: Index: lib/libproc/proc_bkpt.c =================================================================== --- lib/libproc/proc_bkpt.c (revision 241162) +++ lib/libproc/proc_bkpt.c (working copy) @@ -47,6 +47,9 @@ #elif defined(__mips__) #define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__powerpc__) +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif Index: sys/modules/Makefile =================================================================== --- sys/modules/Makefile (revision 241162) +++ sys/modules/Makefile (working copy) @@ -799,6 +799,9 @@ _pccard= pccard _smbfs= smbfs _sound= sound +_cyclic= cyclic +_dtrace= dtrace +_opensolaris= opensolaris .endif .if ${MACHINE_ARCH} == "powerpc64" Index: sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (working copy) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * XXX: Placeholder for PowerPC fasttrap code + */ Index: sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (working copy) @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif +/* + * XXXDTRACE: placehodler for PowerPC fasttrap stuff + */ + +typedef uint32_t fasttrap_instr_t; +#define FASTTRAP_SUNWDTRACE_SIZE 64 + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (revision 241162) +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (working copy) @@ -235,7 +235,7 @@ static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) || defined(__mips__) +#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif #endif @@ -10762,7 +10762,7 @@ #else int i; -#if defined(__amd64__) || defined(__mips__) +#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Index: sys/cddl/dev/dtrace/powerpc/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (working copy) @@ -0,0 +1,508 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c 211608 2010-08-22 10:53:32Z rpaulo $ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +/* Offset to the LR Save word (ppc32) */ +#define RETURN_OFFSET 4 + +#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) + +greg_t +dtrace_getfp(void) +{ + return (greg_t)__builtin_frame_address(0); +} + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) sp)) + break; + + callpc = *(uintptr_t *)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(uintptr_t*)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +static int +dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, + uintptr_t sp) +{ + int ret = 0; + + ASSERT(pcstack == NULL || pcstack_limit > 0); + + while (pc != 0) { + ret++; + if (pcstack != NULL) { + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + } + + if (sp == 0) + break; + + pc = dtrace_fuword64((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword64((void *)sp); + } + + return (ret); +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + int n; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword32((void *) sp); + } + + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); + ASSERT(n >= 0); + ASSERT(n <= pcstack_limit); + + pcstack += n; + pcstack_limit -= n; + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + int n = 0; + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_FAULT)) + return (-1); + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + pc = dtrace_fuword64((void *) sp); + n++; + } + + n += dtrace_getustack_common(NULL, 0, pc, sp); + + return (n); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; +#ifdef notyet /* XXX signal stack */ + uintptr_t oldcontext; + size_t s1, s2; +#endif + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + +#ifdef notyet /* XXX signal stack */ + oldcontext = lwp->lwp_oldcontext; + s1 = sizeof (struct xframe) + 2 * sizeof (long); + s2 = s1 + sizeof (siginfo_t); +#endif + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = 0; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword64((void *)sp); + } + + while (pc != 0) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = sp; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + + if (sp == 0) + break; + +#ifdef notyet /* XXX signal stack */ + if (oldcontext == sp + s1 || oldcontext == sp + s2) { + ucontext_t *ucp = (ucontext_t *)oldcontext; + greg_t *gregs = ucp->uc_mcontext.gregs; + + sp = dtrace_fulword(&gregs[REG_FP]); + pc = dtrace_fulword(&gregs[REG_PC]); + + oldcontext = dtrace_fulword(&ucp->uc_link); + } else +#endif /* XXX */ + { + pc = dtrace_fuword32((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword32((void *)sp); + } + + /* + * This is totally bogus: if we faulted, we're going to clear + * the fault and break. This is to deal with the apparently + * broken Java stacks on x86. + */ + if (*flags & CPU_DTRACE_FAULT) { + *flags &= ~CPU_DTRACE_FAULT; + break; + } + } + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + return (0); +} + +#ifdef notyet +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) frame)) + break; + + callpc = *(void **)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(void **)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} +#endif + +int +dtrace_getstackdepth(int aframes) +{ + int depth = 0; + register_t sp; + + aframes++; + sp = dtrace_getfp(); + depth++; + for(;;) { + if (!INKERNEL((long) sp)) + break; + if (!INKERNEL((long) *(void **)sp)) + break; + depth++; + sp = *(uintptr_t *)sp; + } + if (depth < aframes) + return 0; + else + return depth - aframes; +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + if (reg < 32) + return (rp->fixreg[reg]); + + switch (reg) { + case 33: + return (rp->lr); + case 34: + return (rp->cr); + case 35: + return (rp->xer); + case 36: + return (rp->ctr); + case 37: + return (rp->srr0); + case 38: + return (rp->srr1); + case 39: + return (rp->exc); + default: + DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); + return (0); + } +} + +static int +dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +{ + ASSERT(INKERNEL(kaddr) && kaddr + size >= kaddr); + + if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = uaddr; + return (0); + } + + return (1); +} + +void +dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(uaddr, kaddr, size); +} + +void +dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(kaddr, uaddr, size); +} + +void +dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(uaddr, kaddr, size, flags); +} + +void +dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(kaddr, uaddr, size, flags); +} + +uint8_t +dtrace_fuword8(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword8_nocheck(uaddr)); +} + +uint16_t +dtrace_fuword16(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword16_nocheck(uaddr)); +} + +uint32_t +dtrace_fuword32(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword32_nocheck(uaddr)); +} + +uint64_t +dtrace_fuword64(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword64_nocheck(uaddr)); +} Index: sys/cddl/dev/dtrace/powerpc/dtrace_asm.S =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (working copy) @@ -0,0 +1,269 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S 233484 2012-03-26 01:26:33Z gonzo $ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "assym.s" + +#define _ASM + +#include +#include + +#include +/* +#include +*/ + +/* + * Primitives + */ + + .text + +/* +void dtrace_membar_producer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_producer) + blr +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_consumer) + blr +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ASENTRY_NOPROF(dtrace_interrupt_disable) + mfmsr %r3 + andi. %r0,%r3,~PSL_EE@l + mtmsr %r0 + blr +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ASENTRY_NOPROF(dtrace_interrupt_enable) + mtmsr %r3 + blr +END(dtrace_interrupt_enable) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ASENTRY_NOPROF(dtrace_cas32) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_cas32) + +/* +void * +dtrace_casptr(void *target, void *cmp, void *new) +*/ +ASENTRY_NOPROF(dtrace_casptr) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_casptr) + + +/* +uintptr_t +dtrace_fulword(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fulword) +END(dtrace_fulword) + +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword8_nocheck) + lbz %r3,0(%r3) + blr +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword16_nocheck) + lhz %r3,0(%r3) + blr +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword32_nocheck) + lwz %r3,0(%r3) + blr +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword64_nocheck) +#if defined(__powerpc64__) + ld %r3,0(%r3) +#else + lwz %r5,0(%r3) + lwz %r4,4(%r3) + mr %r3,%r5 +#endif + blr +END(dtrace_fuword64_nocheck) + +/* +XXX: unoptimized +void +dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ +ASENTRY_NOPROF(dtrace_copy) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f +2: + blr +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +*/ +ASENTRY_NOPROF(dtrace_copystr) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f + or %r3,%r3,%r3 + beq 2f + andi. %r0,%r5,0x0fff + beq 2f + lwz %r0,0(%r6) + andi. %r0,%r0,CPU_DTRACE_BADADDR + beq 1b +2: + blr +END(dtrace_copystr) + +/* +void dtrace_invop_init(void) +*/ +ASENTRY_NOPROF(dtrace_invop_init) + /* XXX: impement it properly -- implement dtrace_invop_start */ + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_init) + +/* +void dtrace_invop_uninit(void) +*/ +ASENTRY_NOPROF(dtrace_invop_uninit) + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_uninit) + +/* + * The panic() and cmn_err() functions invoke vpanic() as a common entry point + * into the panic code implemented in panicsys(). vpanic() is responsible + * for passing through the format string and arguments, and constructing a + * regs structure on the stack into which it saves the current register + * values. If we are not dying due to a fatal trap, these registers will + * then be preserved in panicbuf as the current processor state. Before + * invoking panicsys(), vpanic() activates the first panic trigger (see + * common/os/panic.c) and switches to the panic_stack if successful. Note that + * DTrace takes a slightly different panic path if it must panic from probe + * context. Instead of calling panic, it calls into dtrace_vpanic(), which + * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and + * branches back into vpanic(). + */ + +/* +void +vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(vpanic) /* Initial stack layout: */ + +vpanic_common: + blr +END(vpanic) + + + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */ + +#if 0 + bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ +#endif + b vpanic_common +END(dtrace_vpanic) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ASENTRY_NOPROF(dtrace_caller) + li %r3, -1 + blr +END(dtrace_caller) + Index: sys/cddl/dev/dtrace/powerpc/dtrace_subr.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (working copy) @@ -0,0 +1,201 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $ + * + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DELAYBRANCH(x) ((int)(x) < 0) + +extern uintptr_t dtrace_in_probe_addr; +extern int dtrace_in_probe; +extern dtrace_id_t dtrace_probeid_error; + +int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); + +typedef struct dtrace_invop_hdlr { + int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + struct dtrace_invop_hdlr *dtih_next; +} dtrace_invop_hdlr_t; + +dtrace_invop_hdlr_t *dtrace_invop_hdlr; + +int +dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +{ + dtrace_invop_hdlr_t *hdlr; + int rval; + + for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) + if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + return (rval); + + return (0); +} + + +/*ARGSUSED*/ +void +dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) +{ + /* + * No toxic regions? + */ +} + +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, + smp_no_rendevous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + +/* + * DTrace needs a high resolution time function which can + * be called from a probe context and guaranteed not to have + * instrumented with probes itself. + * + * Returns nanoseconds since boot. + */ +uint64_t +dtrace_gethrtime() +{ + struct timespec curtime; + + nanouptime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + +} + +uint64_t +dtrace_gethrestime(void) +{ + struct timespec curtime; + + getnanotime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); +} + +/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ +int +dtrace_trap(struct trapframe *frame, u_int type) +{ + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * Check if DTrace has enabled 'no-fault' mode: + * + */ + if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { + /* + * There are only a couple of trap types that are expected. + * All the rest will be handled in the usual way. + */ + switch (type) { + /* Page fault. */ + case EXC_DSI: + case EXC_DSE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->cpu.aim.dar; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + case EXC_ISI: + case EXC_ISE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->srr0; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + default: + /* Handle all other traps in the usual way. */ + break; + } + } + + /* Handle the trap in the usual way. */ + return (0); +} + +void +dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which, + int fault, int fltoffs, uintptr_t illval) +{ + + dtrace_probe(dtrace_probeid_error, (uint64_t)(uintptr_t)state, + (uintptr_t)epid, + (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs); +} Index: sys/powerpc/aim/trap.c =================================================================== --- sys/powerpc/aim/trap.c (revision 241162) +++ sys/powerpc/aim/trap.c (working copy) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" +#include "opt_kdtrace.h" #include #include @@ -104,6 +105,33 @@ char *name; }; +#ifdef KDTRACE_HOOKS +#include + +/* + * This is a hook which is initialised by the dtrace module + * to handle traps which might occur during DTrace probe + * execution. + */ +dtrace_trap_func_t dtrace_trap_func; + +dtrace_doubletrap_func_t dtrace_doubletrap_func; + +/* + * This is a hook which is initialised by the systrace module + * when it is loaded. This keeps the DTrace syscall provider + * implementation opaque. + */ +systrace_probe_func_t systrace_probe_func; + +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; +#endif + static struct powerpc_exception powerpc_exceptions[] = { { 0x0100, "system reset" }, { 0x0200, "machine check" }, @@ -176,6 +204,28 @@ } else #endif +#ifdef KDTRACE_HOOKS + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * If the DTrace kernel module has registered a trap handler, + * call it and if it returns non-zero, assume that it has + * handled the trap and modified the trap frame so that this + * function can return normally. + */ + /* + * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + */ + if (!user) { + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + return; + } +#endif + if (user) { td->td_pticks = 0; td->td_frame = frame; @@ -617,6 +667,9 @@ PROC_LOCK(p); --p->p_lock; PROC_UNLOCK(p); + /* + * XXXDTRACE: add dtrace_doubletrap_func here? + */ } else { /* * Don't have to worry about process locking or stacks in the Index: sys/powerpc/aim/locore32.S =================================================================== --- sys/powerpc/aim/locore32.S (revision 241162) +++ sys/powerpc/aim/locore32.S (working copy) @@ -64,7 +64,10 @@ #include #include #include +#include +#include "opt_kdtrace.h" + /* Locate the per-CPU data structure */ #define GET_CPUINFO(r) \ mfsprg0 r Index: sys/powerpc/aim/trap_subr32.S =================================================================== --- sys/powerpc/aim/trap_subr32.S (revision 241162) +++ sys/powerpc/aim/trap_subr32.S (working copy) @@ -240,6 +240,26 @@ mfsprg2 %r2; /* restore r2 & r3 */ \ mfsprg3 %r3 +#ifdef KDTRACE_HOOKS + .data + .globl dtrace_invop_jump_addr + .align 4 + .type dtrace_invop_jump_addr, @object + .size dtrace_invop_jump_addr, 8 +dtrace_invop_jump_addr: + .word 0 + .word 0 + .globl dtrace_invop_calltrap_addr + .align 4 + .type dtrace_invop_calltrap_addr, @object + .size dtrace_invop_calltrap_addr, 8 +dtrace_invop_calltrap_addr: + .word 0 + .word 0 + + .text +#endif + /* * The next two routines are 64-bit glue code. The first is used to test if * we are on a 64-bit system. By copying it to the illegal instruction --MP_/9K3kvrXQMtb..M4KOjMYthu-- From owner-freebsd-ppc@FreeBSD.ORG Wed Oct 10 02:38:52 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0710EE9F for ; Wed, 10 Oct 2012 02:38:52 +0000 (UTC) (envelope-from crystalmosaics@163.com) Received: from m12-14.163.com (m12-14.163.com [220.181.12.14]) by mx1.freebsd.org (Postfix) with ESMTP id A03358FC0C for ; Wed, 10 Oct 2012 02:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Received:Date:From:Reply-To:To:Subject:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=h5pUWs4p 1r83ysSpncxNzFC8edu668aMyjn6wQ0BlmQ=; b=b3p1AGuFCVworerNouBrbOBI DsHxasC2/E9wEwNuy27UVO/oy69KntraQIiSS688zRfffi2Egk4HUzTiN3N2KfZQ q8EiPRbe0c33fOv9N/50TY6+8CiOxtqMZHgOpVV/akTIuDCMSCEOCX703s8xjng0 tyzkP3ZBUOUDLI/R8z4= Received: from cdity (unknown [182.37.136.154]) by smtp10 (Coremail) with SMTP id DsCowEDJM1az33RQLf5OBg--.478S3; Wed, 10 Oct 2012 10:38:43 +0800 (CST) Date: Wed, 10 Oct 2012 10:42:28 +0800 From: "jessaic" To: "freebsd-ppc" Subject: Re:glass mosaic/manufacturer/no money sample Message-ID: <201210101042285932123@163.com> X-Mailer: Foxmail 6, 10, 201, 20 [cn] MIME-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: base64 X-CM-TRANSID: DsCowEDJM1az33RQLf5OBg--.478S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUfb4SDUUUU X-CM-SenderInfo: pfu1235dop02pdlf2qqrwthudrp/xtbB0RVEik9o8FYZfgAAss X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: glassmosaic@188.com List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 02:38:52 -0000 R29vZCBkYXksDQoNClRoaXMgaXMgSmVzc2ljYSBmcm9tIGEgZ2xhc3MgbW9zYWljIG1hbnVmYWN0 dXJlci4NCk91ciBmYWN0b3J5IGlzIHNwZWNpYWxpemVkIGluIHByb2R1Y2luZyBraW5kcyBvZiBj cnlzdGFsIG1vc2FpYyx0aGUgbWFpbiB0aGlja25lc3MgaXMgNG1tIGFuZCA2bW0uDQoNCkFueSBm dXJ0aGVyIGluZm9ybWF0aW9uLHBsZWFzZSBjb250YWN0IG1lIGZyZWVseS4NCg0KUmVnYXJkcywN Cg0KSmVzc2ljYQ0KDQpMSU5ZSSBDSEVOR1FJIElORFVTVFJZIEFORCBUUkFERSBDTy4sTFREDQpT a3lwZTpqZXNzaWNhMjk4NTYNClRlbDogODYtNTM5LTcxNjI4Nzg= From owner-freebsd-ppc@FreeBSD.ORG Wed Oct 10 14:44:41 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 988A4A9C for ; Wed, 10 Oct 2012 14:44:41 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 2FE7F8FC14 for ; Wed, 10 Oct 2012 14:44:40 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q9AEiTmU027113; Wed, 10 Oct 2012 16:44:32 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <507561A4.5040902@fgznet.ch> Date: Wed, 10 Oct 2012 13:53:08 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Justin Hibbits Subject: Re: CFT: Dtrace on PowerPC References: <20121009190838.283976e1@narn.knownspace> In-Reply-To: <20121009190838.283976e1@narn.knownspace> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 14:44:41 -0000 Hi Justin! On 10.10.12 01:08, Justin Hibbits wrote: > After a few days of development, and a few weeks of testing, here's > Dtrace on PowerPC. There is only one known issue that I know of so > far: dtruss kernel panics through an assertion. I have to investigate > this some more, but some dtrace -n "" testing works. Cool!!! Three things, I have not tested this code yet but I did look over it. - powerpc64 support is not yet complete, right? - sys/cddl/dev/dtrace/powerpc/dtrace_asm.S and sys/cddl/dev/dtrace/powerpc/dtrace_subr.c have some mips leftovers or are they intentional? ($FreeBSD, _FBSDID) - what is the hid.h include for in sys/powerpc/aim/locore32.S? I'll try to give it a run in the next days. Thanks a lot for this work! Andreas From owner-freebsd-ppc@FreeBSD.ORG Wed Oct 10 14:50:33 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C462FE4A for ; Wed, 10 Oct 2012 14:50:33 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 74CDF8FC16 for ; Wed, 10 Oct 2012 14:50:33 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fw7so1082612vcb.13 for ; Wed, 10 Oct 2012 07:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Jj3+7RQ21W18cB15ft8YUlbn65nrTFll0YIXrsJw3mQ=; b=deJAHGEYfWnJ+jLilpw3uHn4Ag6A+5BWiMel2uXSGR54D5hZN6VF0CxsYUy30N1dEo CydlqeKnyfqwW1QLWt0Yy0tT39uDo2VXwARpDwIq4RvCxl0XFCnbVtuwjovUj/i0oUv2 WCoApA5eLVUMMCyeJXYIwT2fzrW9NWTscaPCC5xYN8ENNYOTGPXdhVpXQb4je8FymYzk 7jRghn3FE3ObXQYZhiwobNLfeAgX1HwPYnatDyDHE8+FpLkXher0eW6sqp1STXUukqF2 BWg6rCnse+PPdNqHf7OAUI0aSHzquqInJ0ms/PWk03qZ9SxRoauCwRBBNlj8WqsbCLjy Aa6Q== MIME-Version: 1.0 Received: by 10.220.154.6 with SMTP id m6mr13796896vcw.51.1349880632773; Wed, 10 Oct 2012 07:50:32 -0700 (PDT) Received: by 10.58.186.235 with HTTP; Wed, 10 Oct 2012 07:50:32 -0700 (PDT) In-Reply-To: <507561A4.5040902@fgznet.ch> References: <20121009190838.283976e1@narn.knownspace> <507561A4.5040902@fgznet.ch> Date: Wed, 10 Oct 2012 10:50:32 -0400 Message-ID: Subject: Re: CFT: Dtrace on PowerPC From: Justin Hibbits To: Andreas Tobler Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 14:50:33 -0000 Hi Andreas, On Wed, Oct 10, 2012 at 7:53 AM, Andreas Tobler wrote: > Hi Justin! > > > On 10.10.12 01:08, Justin Hibbits wrote: > >> After a few days of development, and a few weeks of testing, here's >> Dtrace on PowerPC. There is only one known issue that I know of so >> far: dtruss kernel panics through an assertion. I have to investigate >> this some more, but some dtrace -n "" testing works. >> > > Cool!!! > > Three things, I have not tested this code yet but I did look over it. > > - powerpc64 support is not yet complete, right? > Nope, ppc64 is not complete. It shouldn't be too much more work, though. > - sys/cddl/dev/dtrace/powerpc/**dtrace_asm.S and > sys/cddl/dev/dtrace/powerpc/**dtrace_subr.c have some mips leftovers or > are they intentional? ($FreeBSD, _FBSDID) > I believe these should change when actually committed (didn't set the svn property when adding the code yet). - what is the hid.h include for in sys/powerpc/aim/locore32.S? > This is from another task I've been working on for something else. I'll remember to remove it when doing the actual commit. > I'll try to give it a run in the next days. > > Thanks a lot for this work! > > Andreas > Thanks for (future) testing. - Justin From owner-freebsd-ppc@FreeBSD.ORG Thu Oct 11 16:02:10 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEEE6F35 for ; Thu, 11 Oct 2012 16:02:10 +0000 (UTC) (envelope-from nizhniynovgorod@mytailor.ru) Received: from relay-out4.mail.masterhost.ru (relay-out4.mail.masterhost.ru [83.222.23.77]) by mx1.freebsd.org (Postfix) with ESMTP id 338FF8FC12 for ; Thu, 11 Oct 2012 16:02:10 +0000 (UTC) Received: from [UNAVAILABLE] ([81.195.50.210] helo=81.195.50.210) by relay4.mail.masterhost.ru with esmtp envelope from authenticated with president@iba-moscow.ru message id 1TMLD6-000FaN-Hn for freebsd-ppc@freebsd.org; Thu, 11 Oct 2012 20:02:09 +0400 From: "=?utf-8?B?ItCY0LzQv9C10YDQsNGC0L7RgNGB0LrQuNC5INCf0L7RgNGC0L3QvtC5INCyINCd0LjQttC90LXQvCDQndC+0LLQs9C+0YDQvtC00LUi?=" Subject: =?utf-8?B?W0JVTEtdItCY0LzQv9C10YDQsNGC0L7RgNGB0LrQuNC5INCf0L7RgNGC0L3QvtC5IiDQsiDQstCw0YjQtdC8INCz0L7RgNC+0LTQteKAnQ==?= To: "freebsd-ppc" MIME-Version: 1.0 Organization: The Imperial Tailoring Co. Date: Thu, 11 Oct 2012 20:02:06 +0400 X-Mailer-MsgId: b5AEBRDR0DU3Z0FBCeGZsQGd3bEFtdGVEtNnBtYj5rd3JfZ2pEbXAscHNAB0QwLjBU3NTY3KzRCLjc= X-SpamTest-Envelope-From: nizhniynovgorod@mytailor.ru X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 37717 [Oct 11 2012] X-SpamTest-Info: {relay has no DNS name} X-SpamTest-Method: none X-SpamTest-Rate: 40 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release Message-Id: <20121011160210.AEEE6F35@hub.freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 16:02:10 -0000 =EF=BB=BFVIP =D1=8D=D0=BA=D1=81=D0=BA=D0=BB=D1=8E=D0=B7=D0=B8=D0=B2=D1= =8B=D0=BD=D0=BE=D0=B5 =D0=BF=D1=80=D0=B5=D0=B4=D0=BB=D0=BE=D0=B6=D0=B5= =D0=BD=D0=B8=D0=B5=20 10.10.2012 =D0=B3=D0=BE=D0=B4=D0=B0 =20 "=D0=98=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA=D0= =B8=D0=B9 =D0=9F=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9" =D0=B2 =D0=B2=D0= =B0=D1=88=D0=B5=D0=BC =D0=B3=D0=BE=D1=80=D0=BE=D0=B4=D0=B5=E2=80=9D =C2=AB=D0=98=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA= =D0=B8=D0=B9 =D0=BF=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9=C2=BB =D0=BF=D0= =BE=D1=81=D0=B5=D1=82=D0=B8=D1=82 =D0=9D=D0=B8=D0=B6=D0=BD=D0=B8=D0=B9= =D0=9D=D0=BE=D0=B2=D0=B3=D0=BE=D1=80=D0=BE=D0=B4 =20 =D0=92 =D0=9D=D0=B8=D0=B6=D0=BD=D0=B5=D0=BC =D0=9D=D0=BE=D0=B2=D0=B3=D0= =BE=D1=80=D0=BE=D0=B4=D0=B5 =D1=81 15 =D0=BF=D0=BE 21 =D0=BE=D0=BA=D1=82= =D1=8F=D0=B1=D1=80=D1=8F =D0=B2 =D0=B3=D0=BE=D1=81=D1=82=D0=B8=D0=BD=D0= =B8=D1=86=D0=B5 "=D0=9E=D0=BA=D0=B0" =D1=81 9.00 =D0=B4=D0=BE 20.00 =D0= =B1=D1=83=D0=B4=D0=B5=D1=82 =D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D1=82= =D1=8C =D1=81=D0=BF=D0=B5=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D1=81=D1=82 =D0= =BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD=D0=B8=D0=B8 =C2=AB=D0=98=D0=BC=D0=BF= =D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA=D0=B8=D0=B9 =D0=BF=D0= =BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9=C2=BB =D0=9D=D0=B8=D1=80=D0=B0=D0=B4= =D0=B6 =D0=9A=D1=85=D0=B5=D0=BC=D0=BD=D0=B0=D0=BD=D0=B8. =D0=A3 =D0=BD= =D0=B8=D0=B6=D0=B5=D0=B3=D0=BE=D1=80=D0=BE=D0=B4=D1=81=D0=BA=D0=B8=D1=85= =D0=B3=D0=BE=D1=81=D0=BF=D0=BE=D0=B4 =D0=B2=D0=BF=D0=B5=D1=80=D0=B2=D1= =8B=D0=B5 =D0=BF=D0=BE=D1=8F=D0=B2=D0=B8=D1=82=D1=81=D1=8F =D1=8D=D0=BA= =D1=81=D0=BA=D0=BB=D1=8E=D0=B7=D0=B8=D0=B2=D0=BD=D1=8B=D0=B9 =D1=88=D0= =B0=D0=BD=D1=81 =D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=B0=D1=82=D1=8C =D0=BA= =D0=BE=D1=81=D1=82=D1=8E=D0=BC, =D0=BF=D0=B0=D0=BB=D1=8C=D1=82=D0=BE =D0= =B8=D0=BB=D0=B8 =D0=B0=D0=BA=D1=81=D0=B5=D1=81=D1=81=D1=83=D0=B0=D1=80= =D1=8B, =D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=BD=D1=8B=D0= =B5 =D0=BF=D0=BE =D0=B8=D0=BD=D0=B4=D0=B8=D0=B2=D0=B8=D0=B4=D1=83=D0=B0= =D0=BB=D1=8C=D0=BD=D1=8B=D0=BC =D0=BC=D0=B5=D1=80=D0=BA=D0=B0=D0=BC =D0= =B7=D0=B0=D0=BA=D0=B0=D0=B7=D1=87=D0=B8=D0=BA=D0=B0, =D1=83 =D0=B8=D0=BD= =D0=B4=D0=B8=D0=B9=D1=81=D0=BA=D0=B8=D1=85 =D1=82=D0=B2=D0=BE=D1=80=D1= =86=D0=BE=D0=B2. =20 =D0=9D=D0=B8=D1=80=D0=B0=D0=B4=D0=B6 =D0=9A=D1=85=D0=B5=D0=BC=D0=BD=D0= =B0=D0=BD=D0=B8 =E2=80=94 =D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0= =B8=D0=B9 =D1=83=D1=87=D0=B5=D0=BD=D0=B8=D0=BA =D1=83 =D0=B3=D0=BB=D0=B0= =D0=B2=D1=8B =D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD=D0=B8=D0=B8 =C2=AB=D0= =98=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA=D0=B8=D0= =B9 =D0=BF=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9=C2=BB =D0=A1=D1=8D=D0=BC= =D0=BC=D0=B8 =D0=9A=D0=BE=D1=82=D0=B2=D0=B0=D0=BD=D0=B8. =D0=9C=D0=BE=D0= =BB=D0=BE=D0=B4=D0=BE=D0=B9, =D1=82=D0=B0=D0=BB=D0=B0=D0=BD=D1=82=D0=BB= =D0=B8=D0=B2=D1=8B=D0=B9, =D0=BA=D1=80=D0=B5=D0=B0=D1=82=D0=B8=D0=B2=D0= =BD=D1=8B=D0=B9 =D1=87=D0=B5=D0=BB=D0=BE=D0=B2=D0=B5=D0=BA =D1=81 =D0=B2= =D0=B5=D0=BB=D0=B8=D0=BA=D0=BE=D0=BB=D0=B5=D0=BF=D0=BD=D1=8B=D0=BC =D0= =B7=D0=BD=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC =D0=B4=D0=BB=D1=8F =D1=81=D0=B2= =D0=BE=D0=B8=D1=85 =D0=BB=D0=B5=D1=82. =D0=91=D0=BB=D0=B0=D0=B3=D0=BE=D0= =B4=D0=B0=D1=80=D1=8F =D0=B5=D0=B3=D0=BE =D0=BE=D0=B1=D0=BE=D1=81=D0=BD= =D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=BC =D0=B0=D1=80=D0=B3=D1=83=D0= =BC=D0=B5=D0=BD=D1=82=D0=B0=D0=BC =D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD= =D0=B8=D1=8F =D0=B2=D0=BE=D0=BF=D0=BB=D0=BE=D1=82=D0=B8=D0=BB=D0=B0 =D0= =B2 =D0=B6=D0=B8=D0=B7=D0=BD=D1=8C =D0=BD=D0=BE=D0=B2=D1=8B=D0=B9 =D0=BF= =D1=80=D0=BE=D0=B5=D0=BA=D1=82 =C2=AB=D0=9F=D1=83=D1=82=D0=B5=D1=88=D0= =B5=D1=81=D1=82=D0=B2=D0=B8=D0=B5 =D0=BF=D0=BE=D1=80=D1=82=D0=BD=D0=BE= =D0=B3=D0=BE=C2=BB, =D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B9 =D0=BF=D0= =BE=D0=B7=D0=B2=D0=BE=D0=BB=D0=B8=D1=82 =D0=B1=D0=B8=D0=B7=D0=BD=D0=B5= =D1=81=D0=BC=D0=B5=D0=BD=D0=B0=D0=BC =D0=B8 =D0=BF=D0=BE=D0=BB=D0=B8=D1= =82=D0=B8=D0=BA=D0=B0=D0=BC =D0=B2 =D1=88=D0=B5=D1=81=D1=82=D0=B8 =D0=BA= =D1=80=D1=83=D0=BF=D0=BD=D0=B5=D0=B9=D1=88=D0=B8=D1=85 =D0=B3=D0=BE=D1= =80=D0=BE=D0=B4=D0=B0=D1=85 =D0=A0=D0=BE=D1=81=D1=81=D0=B8=D0=B8 =D0=BF= =D0=BE=D0=BB=D1=83=D1=87=D0=B8=D1=82=D1=8C =D1=83=D1=81=D0=BB=D1=83=D0= =B3=D0=B8 =D0=BE=D0=B4=D0=BD=D0=B8=D1=85 =D0=B8=D0=B7 =D0=BB=D1=83=D1=87= =D1=88=D0=B8=D1=85 =D0=BF=D0=BE=D1=80=D1=82=D0=BD=D1=8B=D1=85 =D0=B2 =D0= =BC=D0=B8=D1=80=D0=B5 .=20 =20 =D0=9D=D0=B8=D0=B6=D0=B5=D0=B3=D0=BE=D1=80=D0=BE=D0=B4=D1=81=D0=BA=D0=B8= =D0=B5 =D0=B1=D0=B8=D0=B7=D0=BD=D0=B5=D1=81=D0=BC=D0=B5=D0=BD=D1=8B =D1= =81=D0=BC=D0=BE=D0=B3=D1=83=D1=82 =D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=B0= =D1=82=D1=8C =D1=83 =D0=BC=D0=B0=D1=81=D1=82=D0=B5=D1=80=D0=B0 =D0=BF=D0= =BE=D1=88=D0=B8=D0=B2 =D0=BF=D0=B8=D0=B4=D0=B6=D0=B0=D0=BA=D0=B0, =D0=B1= =D1=80=D1=8E=D0=BA, =D1=80=D1=83=D0=B1=D0=B0=D1=88=D0=B5=D0=BA, =D0=BF= =D0=B0=D0=BB=D1=8C=D1=82=D0=BE, =D1=81=D0=BC=D0=BE=D0=BA=D0=B8=D0=BD=D0= =B3=D0=BE=D0=B2 =D0=B8 =D1=81=D0=B2=D0=B0=D0=B4=D0=B5=D0=B1=D0=BD=D1=8B= =D1=85 =D0=BA=D0=BE=D1=81=D1=82=D1=8E=D0=BC=D0=BE=D0=B2. =D0=9A=D1=80=D0= =BE=D0=BC=D0=B5 =D1=82=D0=BE=D0=B3=D0=BE =D0=98=D0=BC=D0=BF=D0=B5=D1=80= =D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA=D0=B8=D0=B9 =D0=9F=D0=BE=D1=80=D1= =82=D0=BD=D0=BE=D0=B9 =D1=81=D0=BC=D0=BE=D0=B6=D0=B5=D1=82 =D1=81=D0=BE= =D0=B7=D0=B4=D0=B0=D1=82=D1=8C =D1=8D=D0=BA=D1=81=D0=BA=D0=BB=D1=8E=D0= =B7=D0=B8=D0=B2=D0=BD=D1=83=D1=8E =D0=BE=D0=B1=D1=83=D0=B2=D1=8C =D0=B8= =D0=B0=D0=BA=D1=81=D0=B5=D1=81=D1=81=D1=83=D0=B0=D1=80=D1=8B: =D0=B3=D0= =B0=D0=BB=D1=81=D1=82=D1=83=D0=BA=D0=B8, =D1=88=D0=B0=D1=80=D1=84=D1=8B= , =D0=BF=D0=BB=D0=B0=D1=82=D0=BA=D0=B8, =D0=BD=D0=BE=D1=81=D0=BA=D0=B8= =D0=B8 =D0=B4=D0=B0=D0=B6=D0=B5 =D0=B7=D0=B0=D0=BF=D0=BE=D0=BD=D0=BA=D0= =B8. =D0=92 =D1=86=D0=B5=D0=BB=D0=BE=D0=BC =D0=B2=D1=81=D0=B5, =D1=87=D1= =82=D0=BE=D0=B1=D1=8B =D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D1=82=D1=8C =D0=BF= =D0=BE=D0=BB=D0=BD=D0=BE=D1=81=D1=82=D1=8C=D1=8E =D0=BD=D0=B5=D0=BF=D0= =BE=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=BC=D1=8B=D0=B9 luxury =D0=BE=D0=B1= =D1=80=D0=B0=D0=B7.=20 =20 =D0=92=D1=81=D0=B5 =D0=B8=D0=B7=D0=B4=D0=B5=D0=BB=D0=B8=D1=8F =D0=B8=D0= =B7=D0=B3=D0=BE=D1=82=D0=B0=D0=B2=D0=BB=D0=B8=D0=B2=D0=B0=D1=8E=D1=82=D1= =81=D1=8F =D0=B8=D0=B7 =D0=BD=D0=B0=D1=82=D1=83=D1=80=D0=B0=D0=BB=D1=8C= =D0=BD=D0=BE=D0=B3=D0=BE =D1=81=D1=8B=D1=80=D1=8C=D1=8F: =D1=81=D0=B2=D0= =B5=D1=80=D1=85=D1=82=D0=BE=D0=BD=D0=BA=D0=BE=D0=B9 =D1=88=D0=B5=D1=80= =D1=81=D1=82=D0=B8, =D0=BC=D0=BE=D1=85=D0=B5=D1=80=D0=B0, =D1=88=D0=B5= =D0=BB=D0=BA=D0=B0, =D0=BA=D0=B0=D1=88=D0=B5=D0=BC=D0=B8=D1=80=D0=B0. = "=D0=98=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA=D0= =B8=D0=B9 =D0=9F=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9" =D1=8F=D0=B2=D0=BB= =D1=8F=D0=B5=D1=82=D1=81=D1=8F =D0=BE=D1=84=D0=B8=D1=86=D0=B8=D0=B0=D0= =BB=D1=8C=D0=BD=D1=8B=D0=BC =D0=B4=D0=B8=D1=81=D1=82=D1=80=D0=B8=D0=B1= =D1=8C=D1=8E=D1=82=D0=BE=D1=80=D0=BE=D0=BC =D0=B1=D0=B5=D0=BB=D1=8C=D0= =B3=D0=B8=D0=B9=D1=81=D0=BA=D0=BE=D0=B9 =D1=84=D0=B8=D1=80=D0=BC=D1=8B= Scabal - =D0=BE=D0=B4=D0=BD=D0=BE=D0=B3=D0=BE =D0=B8=D0=B7 =D0=B2=D0=B5= =D0=B4=D1=83=D1=89=D0=B8=D1=85 =D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D1= =89=D0=B8=D0=BA=D0=BE=D0=B2 =D1=8D=D0=BB=D0=B8=D1=82=D0=BD=D1=8B=D1=85= =D1=82=D0=BA=D0=B0=D0=BD=D0=B5=D0=B9. =D0=A2=D0=B0=D0=BA=D0=B6=D0=B5 = =D0=BC=D0=B0=D1=81=D1=82=D0=B5=D1=80=D0=B0 =D0=BA=D0=BE=D0=BC=D0=BF=D0= =B0=D0=BD=D0=B8=D0=B8 =D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83= =D1=8E=D1=82 =D1=82=D0=BA=D0=B0=D0=BD=D0=B8 Charles Clayton, Loro Pian= a, Holland & Sherry, Fintes, Ermenegildo Zegna =D0=B8 Dormeuil.=20 =20 =D0=92 =D1=87=D0=B8=D1=81=D0=BB=D0=BE =D0=BF=D0=BE=D1=87=D0=B8=D1=82=D0= =B0=D1=82=D0=B5=D0=BB=D0=B5=D0=B9 =D0=B8 =D0=BF=D0=BE=D1=81=D1=82=D0=BE= =D1=8F=D0=BD=D0=BD=D1=8B=D1=85 =D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0= =BE=D0=B2 =C2=AB=D0=98=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80= =D1=81=D0=BA=D0=BE=D0=B3=D0=BE =D0=BF=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0= =B3=D0=BE=C2=BB =D0=B2=D1=85=D0=BE=D0=B4=D1=8F=D1=82 8 =D0=B3=D0=BB=D0= =B0=D0=B2 =D0=B3=D0=BE=D1=81=D1=83=D0=B4=D0=B0=D1=80=D1=81=D1=82=D0=B2= , =D1=87=D0=BB=D0=B5=D0=BD=D1=8B =D0=9F=D1=80=D0=B0=D0=B2=D0=B8=D1=82= =D0=B5=D0=BB=D1=8C=D1=81=D1=82=D0=B2=D0=B0 =D0=A0=D0=BE=D1=81=D1=81=D0= =B8=D0=B8, =D0=B7=D0=B2=D0=B5=D0=B7=D0=B4=D1=8B =D1=82=D0=B5=D0=BB=D0=B5= =D0=B2=D0=B8=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F =D0=B8 =D1=88=D0=BE=D1=83-=D0= =B1=D0=B8=D0=B7=D0=BD=D0=B5=D1=81=D0=B0, =D0=BF=D1=80=D0=B5=D0=B7=D0=B8= =D0=B4=D0=B5=D0=BD=D1=82 =D1=80=D0=B5=D1=81=D0=BF=D1=83=D0=B1=D0=BB=D0= =B8=D0=BA=D0=B8 =D0=90=D1=80=D0=BC=D0=B5=D0=BD=D0=B8=D1=8F =D0=A1=D0=B5= =D1=80=D0=B6 =D0=A1=D0=B0=D1=80=D0=B3=D0=BE=D1=81=D1=8F=D0=BD, =D0=BF=D1= =80=D0=B5=D0=B7=D0=B8=D0=B4=D0=B5=D0=BD=D1=82 =D1=80=D0=B5=D1=81=D0=BF= =D1=83=D0=B1=D0=BB=D0=B8=D0=BA=D0=B8 =D0=AE=D0=B6=D0=BD=D0=B0=D1=8F =D0= =9E=D1=81=D0=B5=D1=82=D0=B8=D1=8F =D0=AD=D0=B4=D1=83=D0=B0=D1=80=D0=B4= =D0=9A=D0=B0=D0=BA=D0=BE=D0=B9=D1=82=D1=8B, =D0=BF=D1=80=D0=B5=D0=B7=D0= =B8=D0=B4=D0=B5=D0=BD=D1=82 =D0=9A=D0=B0=D0=B7=D0=B0=D1=85=D1=81=D1=82= =D0=B0=D0=BD=D0=B0 =D0=9D=D1=83=D1=80=D1=81=D1=83=D0=BB=D1=82=D0=B0=D0= =BD =D0=9D=D0=B0=D0=B7=D0=B0=D1=80=D0=B1=D0=B0=D0=B5=D0=B2, =D0=BF=D1=80= =D0=B5=D0=B7=D0=B8=D0=B4=D0=B5=D0=BD=D1=82 =D0=99=D0=B5=D0=BC=D0=B5=D0= =BD=D0=B0 =D0=90=D0=BB=D0=B8 =D0=90=D0=B1=D0=B4=D0=B0=D0=BB=D0=BB=D0=B0= =D0=A1=D0=B0=D0=BB=D0=B5=D1=85, =D0=BB=D0=B8=D0=B4=D0=B5=D1=80 =D0=BF= =D0=B0=D1=80=D1=82=D0=B8=D0=B8 =D0=9B=D0=94=D0=9F=D0=A0, =D0=B2=D0=B8=D1= =86=D0=B5-=D1=81=D0=BF=D0=B8=D0=BA=D0=B5=D1=80 =D0=93=D0=BE=D1=81=D0=B4= =D1=83=D0=BC=D1=8B =D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80 =D0= =96=D0=B8=D1=80=D0=B8=D0=BD=D0=BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9, =D0=BF= =D1=80=D0=B5=D0=B7=D0=B8=D0=B4=D0=B5=D0=BD=D1=82 =D1=84=D0=B5=D0=B4=D0= =B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8 =D1=85=D0=BE=D0=BA=D0=BA=D0=B5=D1=8F= =D0=A0=D0=BE=D1=81=D1=81=D0=B8=D0=B8 =D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1= =81=D0=BB=D0=B0=D0=B2 =D0=A2=D1=80=D0=B5=D1=82=D1=8C=D1=8F=D0=BA =D0=B8= =D1=81=D0=BE=D1=82=D0=BD=D0=B8 =D1=82=D0=BE=D0=BF-=D0=BC=D0=B5=D0=BD= =D0=B5=D0=B4=D0=B6=D0=B5=D1=80=D0=BE=D0=B2 =D0=BA=D1=80=D1=83=D0=BF=D0= =BD=D0=B5=D0=B9=D1=88=D0=B8=D1=85 =D1=80=D0=BE=D1=81=D1=81=D0=B8=D0=B9= =D1=81=D0=BA=D0=B8=D1=85 =D0=B8 =D0=B7=D0=B0=D1=80=D1=83=D0=B1=D0=B5=D0= =B6=D0=BD=D1=8B=D1=85 =D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD=D0=B8=D0=B9= =2E =20 =D0=9A=D0=BE=D1=81=D1=82=D1=8E=D0=BC =D0=BC=D0=BE=D0=B6=D0=B5=D1=82 =D0= =BC=D0=BD=D0=BE=D0=B3=D0=BE=D0=B5 =D1=81=D0=BA=D0=B0=D0=B7=D0=B0=D1=82= =D1=8C =D0=BE =D1=81=D0=B2=D0=BE=D0=B5=D0=BC =D0=BE=D0=B1=D0=BB=D0=B0=D0= =B4=D0=B0=D1=82=D0=B5=D0=BB=D0=B5. =D0=9E=D0=BD =D0=BE=D1=82=D1=80=D0=B0= =D0=B6=D0=B0=D0=B5=D1=82 =D0=B5=D0=B3=D0=BE =D1=81=D1=82=D0=B0=D1=82=D1= =83=D1=81, =D1=81=D1=82=D0=B8=D0=BB=D1=8C, =D0=BF=D1=80=D0=BE=D1=84=D0= =B5=D1=81=D1=81=D0=B8=D0=BE=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD=D1=83=D1=8E = =D0=BF=D1=80=D0=B8=D0=BD=D0=B0=D0=B4=D0=BB=D0=B5=D0=B6=D0=BD=D0=BE=D1=81= =D1=82=D1=8C =D0=B8 =D0=B4=D0=B0=D0=B6=D0=B5 =D1=85=D0=B0=D1=80=D0=B0=D0= =BA=D1=82=D0=B5=D1=80. =D0=9F=D0=BE=D1=8D=D1=82=D0=BE=D0=BC=D1=83 =D0=BA= =D0=B0=D0=B6=D0=B4=D1=8B=D0=B9 =D1=83=D1=81=D0=BF=D0=B5=D1=88=D0=BD=D1= =8B=D0=B9 =D1=87=D0=B5=D0=BB=D0=BE=D0=B2=D0=B5=D0=BA =D0=B4=D0=BE=D1=81= =D1=82=D0=BE=D0=B8=D0=BD =D0=B8=D0=B4=D0=B5=D0=B0=D0=BB=D1=8C=D0=BD=D0= =BE =D1=81=D1=88=D0=B8=D1=82=D0=BE=D0=B3=D0=BE =D0=BA=D0=BE=D0=BC=D0=BF= =D0=BB=D0=B5=D0=BA=D1=82=D0=B0, =D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0= =B5=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE =D0=BF=D0=BE =D1=83=D0=BD=D0=B8=D0=BA= =D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=BC =D0=BC=D0=B5=D1=80=D0=BA=D0=B0=D0= =BC.=20 =20 =D0=9A =D1=82=D0=BE=D0=BC=D1=83 =D0=B6=D0=B5, =D0=BF=D0=BE =D0=B4=D0=B0= =D0=BD=D0=BD=D1=8B=D0=BC =D1=80=D0=B5=D0=B9=D1=82=D0=B8=D0=BD=D0=B3=D0= =B0 askmen.com, =D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD=D0=B8=D1=8F =C2=AB= =D0=98=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D1=81=D0=BA=D0=B8= =D0=B9 =D0=9F=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9=C2=BB =D1=8F=D0=B2=D0= =BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F =D0=BE=D0=B4=D0=BD=D0=BE=D0=B9 =D0=B8= =D0=B7 10 =D1=81=D0=B0=D0=BC=D1=8B=D1=85 =D0=BB=D1=83=D1=87=D1=88=D0=B8= =D1=85 =D0=BF=D0=BE=D1=80=D1=82=D0=BD=D1=8B=D1=85 =D0=B2 =D0=BC=D0=B8=D1= =80=D0=B5. =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, =D0=9D=D0=B8=D1=80=D0=B0=D0=B4=D0=B6 =D0=A5=D0=B5=D0=BC=D0=BD=D0=B0=D0= =BD=D0=B8 =D0=9F=D0=BE=D1=80=D1=82=D0=BD=D0=BE=D0=B9 =D0=A2=D0=B5=D0=BB=D0=B5=D1=84=D0=BE=D0=BD: +7(926)2732490=20 =D0=90=D0=B4=D1=80=D0=B5=D1=81: =D0=B3=D0=BE=D1=81=D1=82=D0=B8=D0=BD=D0= =B8=D1=86=D0=B5 "=D0=9E=D0=BA=D0=B0" =D0=B3. =D0=9D.=D0=9D=D0=BE=D0=B2=D0=B3=D0=BE=D1=80=D0=BE=D0=B4, =D0=BF= =D1=80. =D0=93=D0=B0=D0=B3=D0=B0=D1=80=D0=B8=D0=BD=D0=B0, =D0=B4.27 nizhniynovgorod@mytailor.ru =20 =20 =20 =D0=9C=D0=BE=D1=81=D0=BA=D0=B2=D0=B0, =D0=93=D0=BE=D1=81=D1=82=D0=B8=D0= =BD=D1=8B=D0=B9 =D0=94=D0=B2=D0=BE=D1=80, =D0=A0=D1=8B=D0=B1=D0=BD=D1=8B= =D0=B9 =D0=BF=D0=B5=D1=80., =D0=B4. 2, =D1=81=D0=B5=D0=BA=D1=86=D0=B8=D1= =8F 130-132 =D0=A2=D0=B5=D0=BB=D0=B5=D1=84=D0=BE=D0=BD: + 7 (495) 232 1441, e-mail= : clients@mytailor.ru=20 =D0=95=D1=81=D0=BB=D0=B8 =D0=B2=D1=8B =D0=BD=D0=B5 =D1=85=D0=BE=D1=82=D0= =B8=D1=82=D0=B5 =D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5 =D0=BF=D0=BE=D0=BB= =D1=83=D1=87=D0=B0=D1=82=D1=8C =D1=80=D0=B0=D1=81=D1=81=D1=8B=D0=BB=D0= =BA=D0=B8 =D0=BE=D1=82 =D0=BD=D0=B0=D1=81, =D0=BD=D0=B0=D0=B6=D0=BC=D0= =B8=D1=82=D0=B5 =D0=B7=D0=B4=D0=B5=D1=81=D1=8C. http://mytailor.ru=20 =20 From owner-freebsd-ppc@FreeBSD.ORG Thu Oct 11 17:38:46 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6731E67 for ; Thu, 11 Oct 2012 17:38:46 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 5B01B8FC14 for ; Thu, 11 Oct 2012 17:38:46 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id BB9E511EBB; Fri, 12 Oct 2012 03:38:38 +1000 (EST) Received: from vpn2ntap-210192.hq.netapp.com (pos-ext.netapp.com [198.95.226.40]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BGY14293 (AUTH peterg@ptree32.com.au); Fri, 12 Oct 2012 03:38:36 +1000 Message-ID: <50770419.1070600@freebsd.org> Date: Thu, 11 Oct 2012 11:38:33 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Justin Hibbits Subject: Re: CFT: Dtrace on PowerPC References: <20121009190838.283976e1@narn.knownspace> In-Reply-To: <20121009190838.283976e1@narn.knownspace> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Info: SPF_SOFTFAIL X-Junkmail-Status: score=6/51, host=dommail.onthenet.com.au Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 17:38:46 -0000 Outstanding work Justin ! I'll give it a spin. later, Peter. From owner-freebsd-ppc@FreeBSD.ORG Thu Oct 11 21:13:34 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 669C5C7C for ; Thu, 11 Oct 2012 21:13:34 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id F029B8FC0A for ; Thu, 11 Oct 2012 21:13:32 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q9BLDOxl094899; Thu, 11 Oct 2012 23:13:25 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <50773674.3050802@fgznet.ch> Date: Thu, 11 Oct 2012 23:13:24 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Justin Hibbits Subject: Re: CFT: Dtrace on PowerPC References: <20121009190838.283976e1@narn.knownspace> <507561A4.5040902@fgznet.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 21:13:34 -0000 Hi Justin, On 10.10.12 16:50, Justin Hibbits wrote: > On Wed, Oct 10, 2012 at 7:53 AM, Andreas Tobler > wrote: > > Hi Justin! > > > On 10.10.12 01:08, Justin Hibbits wrote: > > After a few days of development, and a few weeks of testing, here's > Dtrace on PowerPC. There is only one known issue that I know of so > far: dtruss kernel panics through an assertion. I have to > investigate > this some more, but some dtrace -n "" testing works. > > > Cool!!! > > Three things, I have not tested this code yet but I did look over it. > > - powerpc64 support is not yet complete, right? > > > Nope, ppc64 is not complete. It shouldn't be too much more work, though. Ok. > - sys/cddl/dev/dtrace/powerpc/__dtrace_asm.S and > sys/cddl/dev/dtrace/powerpc/__dtrace_subr.c have some mips leftovers > or are they intentional? ($FreeBSD, _FBSDID) > > > I believe these should change when actually committed (didn't set the > svn property when adding the code yet). The FBSDID yes, but I guess the part in the comment not. > - what is the hid.h include for in sys/powerpc/aim/locore32.S? > > > This is from another task I've been working on for something else. I'll > remember to remove it when doing the actual commit. Ok. > Thanks for (future) testing. One more thing, the patch for the binaries like dtrace etc. is also available? Or is it meant as an exercise for the user ;) Thanks, Andreas From owner-freebsd-ppc@FreeBSD.ORG Thu Oct 11 22:26:14 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F2D41BB for ; Thu, 11 Oct 2012 22:26:14 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8808FC08 for ; Thu, 11 Oct 2012 22:26:13 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i29so5067qaf.13 for ; Thu, 11 Oct 2012 15:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=0EFnxI7zjQ+GhgmyU2RW05Zx2TM+jm7xX4ZtqCY5jAw=; b=v/4SdtApJ/KbxAy61Q535xTvBr/cSNPzu6jBuTxBFpaNoOWuvfxUDQkEMuw5kcwZf6 hkpquCPfuGHBxPdI2OQCcBQD2l5iuXnFpmC2evgabU/YnLdoM7nF2DZXR7Pf2uz5iIP2 AlIlKNUczcxXL1bCW/EZSTUI3VApGHOifJXK/enPcr4YQqoUIuyb+Wu5AsLmrkiGOlrk YP0rEuDCkyQuFOX7kcfFHEUo27PPmqJi8iM8iVn90AgjiB5uSRGZ5MCbQk8Hw0C/CK8n 8wtiycj6P7iDbcE2ZFvtqrfnZ61VFIQpAQGo4/zQyzGaluCgyxo8vwuv2yMn+rZyTJLe vNag== Received: by 10.224.186.130 with SMTP id cs2mr4362987qab.22.1349994372964; Thu, 11 Oct 2012 15:26:12 -0700 (PDT) Received: from narn.knownspace (pool-108-48-127-15.washdc.fios.verizon.net. [108.48.127.15]) by mx.google.com with ESMTPS id fy1sm5630999qab.10.2012.10.11.15.26.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 15:26:12 -0700 (PDT) Date: Thu, 11 Oct 2012 18:26:09 -0400 From: Justin Hibbits To: Andreas Tobler Subject: Re: CFT: Dtrace on PowerPC Message-ID: <20121011182609.2330a94c@narn.knownspace> In-Reply-To: <50773674.3050802@fgznet.ch> References: <20121009190838.283976e1@narn.knownspace> <507561A4.5040902@fgznet.ch> <50773674.3050802@fgznet.ch> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/jXboBm+E73A=0uRlriZrvvt" Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 22:26:14 -0000 --MP_/jXboBm+E73A=0uRlriZrvvt Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, 11 Oct 2012 23:13:24 +0200 Andreas Tobler wrote: > Hi Justin, >=20 > On 10.10.12 16:50, Justin Hibbits wrote: >=20 > > On Wed, Oct 10, 2012 at 7:53 AM, Andreas Tobler > > > wrote: > > > > Hi Justin! > > > > > > On 10.10.12 01:08, Justin Hibbits wrote: > > > > After a few days of development, and a few weeks of > > testing, here's Dtrace on PowerPC. There is only one known issue > > that I know of so far: dtruss kernel panics through an assertion. > > I have to investigate > > this some more, but some dtrace -n "" testing works. > > > > > > Cool!!! > > > > Three things, I have not tested this code yet but I did look > > over it. > > > > - powerpc64 support is not yet complete, right? > > > > > > Nope, ppc64 is not complete. It shouldn't be too much more work, > > though. >=20 > Ok. >=20 > > - sys/cddl/dev/dtrace/powerpc/__dtrace_asm.S and > > sys/cddl/dev/dtrace/powerpc/__dtrace_subr.c have some mips > > leftovers or are they intentional? ($FreeBSD, _FBSDID) > > > > > > I believe these should change when actually committed (didn't set > > the svn property when adding the code yet). >=20 > The FBSDID yes, but I guess the part in the comment not. =46rom what I can find, all $FreeBSD$ keywords should be changed, even in the comments. If not, I'll fix it. >=20 > > - what is the hid.h include for in sys/powerpc/aim/locore32.S? > > > > > > This is from another task I've been working on for something else. > > I'll remember to remove it when doing the actual commit. >=20 > Ok. >=20 > > Thanks for (future) testing. >=20 > One more thing, the patch for the binaries like dtrace etc. is also=20 > available? Or is it meant as an exercise for the user ;) D'oh, forgot the makefiles. New patch :) > Thanks, > Andreas >=20 - Justin --MP_/jXboBm+E73A=0uRlriZrvvt Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=dtrace_ppc2.diff Index: cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c =================================================================== --- cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (revision 0) +++ cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (working copy) @@ -0,0 +1,75 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} Index: cddl/usr.sbin/Makefile =================================================================== --- cddl/usr.sbin/Makefile (revision 241450) +++ cddl/usr.sbin/Makefile (working copy) @@ -25,4 +25,10 @@ _dtrace= dtrace .endif +.if ${MACHINE_CPUARCH} == "powerpc" +_dtrace= dtrace +_dtruss= dtruss +_lockstat= lockstat +.endif + .include Index: cddl/lib/libdtrace/Makefile =================================================================== --- cddl/lib/libdtrace/Makefile (revision 241450) +++ cddl/lib/libdtrace/Makefile (working copy) @@ -74,6 +74,10 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.elif ${MACHINE_CPUARCH} == "powerpc" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Index: cddl/lib/Makefile =================================================================== --- cddl/lib/Makefile (revision 241450) +++ cddl/lib/Makefile (working copy) @@ -19,7 +19,8 @@ .endif .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_ARCH} == "powerpc" _drti= drti _libdtrace= libdtrace .endif Index: sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (working copy) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * XXX: Placeholder for PowerPC fasttrap code + */ Index: sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (working copy) @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif +/* + * XXXDTRACE: placehodler for PowerPC fasttrap stuff + */ + +typedef uint32_t fasttrap_instr_t; +#define FASTTRAP_SUNWDTRACE_SIZE 64 +#define FASTTRAP_INSTR 0x0FFFDDDD + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (revision 241450) +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (working copy) @@ -235,7 +235,7 @@ static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) || defined(__mips__) +#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif #endif @@ -10762,7 +10762,7 @@ #else int i; -#if defined(__amd64__) || defined(__mips__) +#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Index: sys/cddl/dev/dtrace/powerpc/regset.h =================================================================== Index: sys/cddl/dev/dtrace/powerpc/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (working copy) @@ -0,0 +1,510 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c 211608 2010-08-22 10:53:32Z rpaulo $ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "regset.h" + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +/* Offset to the LR Save word (ppc32) */ +#define RETURN_OFFSET 4 + +#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) + +greg_t +dtrace_getfp(void) +{ + return (greg_t)__builtin_frame_address(0); +} + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) sp)) + break; + + callpc = *(uintptr_t *)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(uintptr_t*)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +static int +dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, + uintptr_t sp) +{ + int ret = 0; + + ASSERT(pcstack == NULL || pcstack_limit > 0); + + while (pc != 0) { + ret++; + if (pcstack != NULL) { + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + } + + if (sp == 0) + break; + + pc = dtrace_fuword64((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword64((void *)sp); + } + + return (ret); +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + int n; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword32((void *) sp); + } + + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); + ASSERT(n >= 0); + ASSERT(n <= pcstack_limit); + + pcstack += n; + pcstack_limit -= n; + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + int n = 0; + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_FAULT)) + return (-1); + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + pc = dtrace_fuword64((void *) sp); + n++; + } + + n += dtrace_getustack_common(NULL, 0, pc, sp); + + return (n); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; +#ifdef notyet /* XXX signal stack */ + uintptr_t oldcontext; + size_t s1, s2; +#endif + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + +#ifdef notyet /* XXX signal stack */ + oldcontext = lwp->lwp_oldcontext; + s1 = sizeof (struct xframe) + 2 * sizeof (long); + s2 = s1 + sizeof (siginfo_t); +#endif + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = 0; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword64((void *)sp); + } + + while (pc != 0) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = sp; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + + if (sp == 0) + break; + +#ifdef notyet /* XXX signal stack */ + if (oldcontext == sp + s1 || oldcontext == sp + s2) { + ucontext_t *ucp = (ucontext_t *)oldcontext; + greg_t *gregs = ucp->uc_mcontext.gregs; + + sp = dtrace_fulword(&gregs[REG_FP]); + pc = dtrace_fulword(&gregs[REG_PC]); + + oldcontext = dtrace_fulword(&ucp->uc_link); + } else +#endif /* XXX */ + { + pc = dtrace_fuword32((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword32((void *)sp); + } + + /* + * This is totally bogus: if we faulted, we're going to clear + * the fault and break. This is to deal with the apparently + * broken Java stacks on x86. + */ + if (*flags & CPU_DTRACE_FAULT) { + *flags &= ~CPU_DTRACE_FAULT; + break; + } + } + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + return (0); +} + +#ifdef notyet +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) frame)) + break; + + callpc = *(void **)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(void **)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} +#endif + +int +dtrace_getstackdepth(int aframes) +{ + int depth = 0; + register_t sp; + + aframes++; + sp = dtrace_getfp(); + depth++; + for(;;) { + if (!INKERNEL((long) sp)) + break; + if (!INKERNEL((long) *(void **)sp)) + break; + depth++; + sp = *(uintptr_t *)sp; + } + if (depth < aframes) + return 0; + else + return depth - aframes; +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + if (reg < 32) + return (rp->fixreg[reg]); + + switch (reg) { + case 33: + return (rp->lr); + case 34: + return (rp->cr); + case 35: + return (rp->xer); + case 36: + return (rp->ctr); + case 37: + return (rp->srr0); + case 38: + return (rp->srr1); + case 39: + return (rp->exc); + default: + DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); + return (0); + } +} + +static int +dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +{ + ASSERT(INKERNEL(kaddr) && kaddr + size >= kaddr); + + if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = uaddr; + return (0); + } + + return (1); +} + +void +dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(uaddr, kaddr, size); +} + +void +dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(kaddr, uaddr, size); +} + +void +dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(uaddr, kaddr, size, flags); +} + +void +dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(kaddr, uaddr, size, flags); +} + +uint8_t +dtrace_fuword8(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword8_nocheck(uaddr)); +} + +uint16_t +dtrace_fuword16(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword16_nocheck(uaddr)); +} + +uint32_t +dtrace_fuword32(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword32_nocheck(uaddr)); +} + +uint64_t +dtrace_fuword64(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword64_nocheck(uaddr)); +} Index: sys/cddl/dev/dtrace/powerpc/dtrace_asm.S =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (working copy) @@ -0,0 +1,269 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S 233484 2012-03-26 01:26:33Z gonzo $ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "assym.s" + +#define _ASM + +#include +#include + +#include +/* +#include +*/ + +/* + * Primitives + */ + + .text + +/* +void dtrace_membar_producer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_producer) + blr +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_consumer) + blr +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ASENTRY_NOPROF(dtrace_interrupt_disable) + mfmsr %r3 + andi. %r0,%r3,~PSL_EE@l + mtmsr %r0 + blr +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ASENTRY_NOPROF(dtrace_interrupt_enable) + mtmsr %r3 + blr +END(dtrace_interrupt_enable) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ASENTRY_NOPROF(dtrace_cas32) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_cas32) + +/* +void * +dtrace_casptr(void *target, void *cmp, void *new) +*/ +ASENTRY_NOPROF(dtrace_casptr) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_casptr) + + +/* +uintptr_t +dtrace_fulword(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fulword) +END(dtrace_fulword) + +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword8_nocheck) + lbz %r3,0(%r3) + blr +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword16_nocheck) + lhz %r3,0(%r3) + blr +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword32_nocheck) + lwz %r3,0(%r3) + blr +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword64_nocheck) +#if defined(__powerpc64__) + ld %r3,0(%r3) +#else + lwz %r5,0(%r3) + lwz %r4,4(%r3) + mr %r3,%r5 +#endif + blr +END(dtrace_fuword64_nocheck) + +/* +XXX: unoptimized +void +dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ +ASENTRY_NOPROF(dtrace_copy) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f +2: + blr +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +*/ +ASENTRY_NOPROF(dtrace_copystr) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f + or %r3,%r3,%r3 + beq 2f + andi. %r0,%r5,0x0fff + beq 2f + lwz %r0,0(%r6) + andi. %r0,%r0,CPU_DTRACE_BADADDR + beq 1b +2: + blr +END(dtrace_copystr) + +/* +void dtrace_invop_init(void) +*/ +ASENTRY_NOPROF(dtrace_invop_init) + /* XXX: impement it properly -- implement dtrace_invop_start */ + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_init) + +/* +void dtrace_invop_uninit(void) +*/ +ASENTRY_NOPROF(dtrace_invop_uninit) + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_uninit) + +/* + * The panic() and cmn_err() functions invoke vpanic() as a common entry point + * into the panic code implemented in panicsys(). vpanic() is responsible + * for passing through the format string and arguments, and constructing a + * regs structure on the stack into which it saves the current register + * values. If we are not dying due to a fatal trap, these registers will + * then be preserved in panicbuf as the current processor state. Before + * invoking panicsys(), vpanic() activates the first panic trigger (see + * common/os/panic.c) and switches to the panic_stack if successful. Note that + * DTrace takes a slightly different panic path if it must panic from probe + * context. Instead of calling panic, it calls into dtrace_vpanic(), which + * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and + * branches back into vpanic(). + */ + +/* +void +vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(vpanic) /* Initial stack layout: */ + +vpanic_common: + blr +END(vpanic) + + + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */ + +#if 0 + bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ +#endif + b vpanic_common +END(dtrace_vpanic) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ASENTRY_NOPROF(dtrace_caller) + li %r3, -1 + blr +END(dtrace_caller) + Index: sys/cddl/dev/dtrace/powerpc/dtrace_subr.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (working copy) @@ -0,0 +1,201 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $ + * + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DELAYBRANCH(x) ((int)(x) < 0) + +extern uintptr_t dtrace_in_probe_addr; +extern int dtrace_in_probe; +extern dtrace_id_t dtrace_probeid_error; + +int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); + +typedef struct dtrace_invop_hdlr { + int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + struct dtrace_invop_hdlr *dtih_next; +} dtrace_invop_hdlr_t; + +dtrace_invop_hdlr_t *dtrace_invop_hdlr; + +int +dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +{ + dtrace_invop_hdlr_t *hdlr; + int rval; + + for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) + if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + return (rval); + + return (0); +} + + +/*ARGSUSED*/ +void +dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) +{ + /* + * No toxic regions? + */ +} + +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, + smp_no_rendevous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + +/* + * DTrace needs a high resolution time function which can + * be called from a probe context and guaranteed not to have + * instrumented with probes itself. + * + * Returns nanoseconds since boot. + */ +uint64_t +dtrace_gethrtime() +{ + struct timespec curtime; + + nanouptime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + +} + +uint64_t +dtrace_gethrestime(void) +{ + struct timespec curtime; + + getnanotime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); +} + +/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ +int +dtrace_trap(struct trapframe *frame, u_int type) +{ + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * Check if DTrace has enabled 'no-fault' mode: + * + */ + if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { + /* + * There are only a couple of trap types that are expected. + * All the rest will be handled in the usual way. + */ + switch (type) { + /* Page fault. */ + case EXC_DSI: + case EXC_DSE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->cpu.aim.dar; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + case EXC_ISI: + case EXC_ISE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->srr0; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + default: + /* Handle all other traps in the usual way. */ + break; + } + } + + /* Handle the trap in the usual way. */ + return (0); +} + +void +dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which, + int fault, int fltoffs, uintptr_t illval) +{ + + dtrace_probe(dtrace_probeid_error, (uint64_t)(uintptr_t)state, + (uintptr_t)epid, + (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs); +} Index: sys/modules/Makefile =================================================================== --- sys/modules/Makefile (revision 241450) +++ sys/modules/Makefile (working copy) @@ -803,6 +803,9 @@ _pccard= pccard _smbfs= smbfs _sound= sound +_cyclic= cyclic +_dtrace= dtrace +_opensolaris= opensolaris .endif .if ${MACHINE_ARCH} == "powerpc64" Index: sys/modules/wi/Makefile =================================================================== --- sys/modules/wi/Makefile (revision 241450) +++ sys/modules/wi/Makefile (working copy) @@ -7,4 +7,9 @@ card_if.h device_if.h bus_if.h pci_if.h pccarddevs.h \ opt_wlan.h +.if ${MACHINE_CPUARCH} == "powerpc" +SRCS+= if_wi_macio.c +SRCS+= ofw_bus_if.h +.endif + .include Index: sys/powerpc/aim/locore32.S =================================================================== --- sys/powerpc/aim/locore32.S (revision 241450) +++ sys/powerpc/aim/locore32.S (working copy) @@ -65,6 +65,8 @@ #include #include +#include "opt_kdtrace.h" + /* Locate the per-CPU data structure */ #define GET_CPUINFO(r) \ mfsprg0 r Index: lib/Makefile =================================================================== --- lib/Makefile (revision 241450) +++ lib/Makefile (working copy) @@ -209,6 +209,8 @@ .endif .if ${MACHINE_CPUARCH} == "powerpc" +_libproc= libproc +_librtld_db= librtld_db _libsmb= libsmb .endif Index: lib/libproc/proc_regs.c =================================================================== --- lib/libproc/proc_regs.c (revision 241450) +++ lib/libproc/proc_regs.c (working copy) @@ -60,6 +60,8 @@ *regvalue = regs.r_eip; #elif defined(__mips__) *regvalue = regs.r_regs[PC]; +#elif defined(__powerpc__) + *regvalue = regs.pc; #endif break; case REG_SP: @@ -69,6 +71,8 @@ *regvalue = regs.r_esp; #elif defined(__mips__) *regvalue = regs.r_regs[SP]; +#elif defined(__powerpc__) + *regvalue = regs.fixreg[1]; #endif break; default: @@ -99,6 +103,8 @@ regs.r_eip = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.pc = regvalue; #endif break; case REG_SP: @@ -108,6 +114,8 @@ regs.r_esp = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.fixreg[1] = regvalue; #endif break; default: Index: lib/libproc/proc_bkpt.c =================================================================== --- lib/libproc/proc_bkpt.c (revision 241450) +++ lib/libproc/proc_bkpt.c (working copy) @@ -47,6 +47,9 @@ #elif defined(__mips__) #define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__powerpc__) +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif --MP_/jXboBm+E73A=0uRlriZrvvt-- From owner-freebsd-ppc@FreeBSD.ORG Thu Oct 11 22:53:03 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C227FBD for ; Thu, 11 Oct 2012 22:53:03 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3855F8FC0C for ; Thu, 11 Oct 2012 22:53:02 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id y23so21395qad.13 for ; Thu, 11 Oct 2012 15:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=zDbh1kPbj/HIMIYCovym/G0zBn+bpt7XhVnSWMtaX8A=; b=Vcjo6wHc9QExOnStXG8T5UdPe+4zv6yLtuDUMaq3tR2wREjZ+aKwE3ohVVICZ3KP/U R7AS8KwcrdCmxReo/b+WXPex+Jx9ZE848CbTx1/rlhBNaQJqeTjTb8g7eV+kfqwIWoDP BvyUUrI02zlKhzhMin9eQR6LVmqruDPy2V8KN9tJM1oXp8Ppw0FQWW9V4FrOQgt48gPG aVchh2yJARJdQ47j37FAWjUxC2cMvp9EZuocdD6n4g/xJ7wlQN28An6poS4GfqkuU23t jfZrvufB/vkAdyDz8Erc5sMFVMEzSwj4mpNL8Cs0VsJ9RdcUEd2jmozYmaC7JKsZNxKw 7lDQ== Received: by 10.224.192.70 with SMTP id dp6mr4338711qab.87.1349995982161; Thu, 11 Oct 2012 15:53:02 -0700 (PDT) Received: from narn.knownspace (pool-108-48-127-15.washdc.fios.verizon.net. [108.48.127.15]) by mx.google.com with ESMTPS id x19sm4970810qeq.12.2012.10.11.15.53.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 15:53:01 -0700 (PDT) Date: Thu, 11 Oct 2012 18:52:59 -0400 From: Justin Hibbits To: Andreas Tobler Subject: Re: CFT: Dtrace on PowerPC Message-ID: <20121011185259.08cb2956@narn.knownspace> In-Reply-To: <50773674.3050802@fgznet.ch> References: <20121009190838.283976e1@narn.knownspace> <507561A4.5040902@fgznet.ch> <50773674.3050802@fgznet.ch> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/kq=KQQOav+pc79+hUczvDBG" Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 22:53:03 -0000 --MP_/kq=KQQOav+pc79+hUczvDBG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thu, 11 Oct 2012 23:13:24 +0200 Andreas Tobler wrote: > Hi Justin, > > On 10.10.12 16:50, Justin Hibbits wrote: > > > On Wed, Oct 10, 2012 at 7:53 AM, Andreas Tobler > > > wrote: > > > > Hi Justin! > > > > > > On 10.10.12 01:08, Justin Hibbits wrote: > > > > After a few days of development, and a few weeks of > > testing, here's Dtrace on PowerPC. There is only one known issue > > that I know of so far: dtruss kernel panics through an assertion. > > I have to investigate > > this some more, but some dtrace -n "" testing works. > > > > > > Cool!!! > > > > Three things, I have not tested this code yet but I did look > > over it. > > > > - powerpc64 support is not yet complete, right? > > > > > > Nope, ppc64 is not complete. It shouldn't be too much more work, > > though. > > Ok. > > > - sys/cddl/dev/dtrace/powerpc/__dtrace_asm.S and > > sys/cddl/dev/dtrace/powerpc/__dtrace_subr.c have some mips > > leftovers or are they intentional? ($FreeBSD, _FBSDID) > > > > > > I believe these should change when actually committed (didn't set > > the svn property when adding the code yet). > > The FBSDID yes, but I guess the part in the comment not. > > > - what is the hid.h include for in sys/powerpc/aim/locore32.S? > > > > > > This is from another task I've been working on for something else. > > I'll remember to remove it when doing the actual commit. > > Ok. > > > Thanks for (future) testing. > > One more thing, the patch for the binaries like dtrace etc. is also > available? Or is it meant as an exercise for the user ;) > > Thanks, > Andreas > Woops, more leftovers in my previous patch. - Justin --MP_/kq=KQQOav+pc79+hUczvDBG Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=dtrace_ppc3.diff Index: cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c =================================================================== --- cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (revision 0) +++ cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (working copy) @@ -0,0 +1,75 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} Index: cddl/usr.sbin/Makefile =================================================================== --- cddl/usr.sbin/Makefile (revision 241450) +++ cddl/usr.sbin/Makefile (working copy) @@ -25,4 +25,10 @@ _dtrace= dtrace .endif +.if ${MACHINE_CPUARCH} == "powerpc" +_dtrace= dtrace +_dtruss= dtruss +_lockstat= lockstat +.endif + .include Index: cddl/lib/libdtrace/Makefile =================================================================== --- cddl/lib/libdtrace/Makefile (revision 241450) +++ cddl/lib/libdtrace/Makefile (working copy) @@ -74,6 +74,10 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.elif ${MACHINE_CPUARCH} == "powerpc" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Index: cddl/lib/Makefile =================================================================== --- cddl/lib/Makefile (revision 241450) +++ cddl/lib/Makefile (working copy) @@ -19,7 +19,8 @@ .endif .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_ARCH} == "powerpc" _drti= drti _libdtrace= libdtrace .endif Index: sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (working copy) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * XXX: Placeholder for PowerPC fasttrap code + */ Index: sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (working copy) @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif +/* + * XXXDTRACE: placehodler for PowerPC fasttrap stuff + */ + +typedef uint32_t fasttrap_instr_t; +#define FASTTRAP_SUNWDTRACE_SIZE 64 +#define FASTTRAP_INSTR 0x0FFFDDDD + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (revision 241450) +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (working copy) @@ -235,7 +235,7 @@ static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) || defined(__mips__) +#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif #endif @@ -10762,7 +10762,7 @@ #else int i; -#if defined(__amd64__) || defined(__mips__) +#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Index: sys/cddl/dev/dtrace/powerpc/regset.h =================================================================== Index: sys/cddl/dev/dtrace/powerpc/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (working copy) @@ -0,0 +1,510 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c 211608 2010-08-22 10:53:32Z rpaulo $ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "regset.h" + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +/* Offset to the LR Save word (ppc32) */ +#define RETURN_OFFSET 4 + +#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) + +greg_t +dtrace_getfp(void) +{ + return (greg_t)__builtin_frame_address(0); +} + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) sp)) + break; + + callpc = *(uintptr_t *)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(uintptr_t*)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +static int +dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, + uintptr_t sp) +{ + int ret = 0; + + ASSERT(pcstack == NULL || pcstack_limit > 0); + + while (pc != 0) { + ret++; + if (pcstack != NULL) { + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + } + + if (sp == 0) + break; + + pc = dtrace_fuword64((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword64((void *)sp); + } + + return (ret); +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + int n; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword32((void *) sp); + } + + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); + ASSERT(n >= 0); + ASSERT(n <= pcstack_limit); + + pcstack += n; + pcstack_limit -= n; + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + int n = 0; + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_FAULT)) + return (-1); + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + pc = dtrace_fuword64((void *) sp); + n++; + } + + n += dtrace_getustack_common(NULL, 0, pc, sp); + + return (n); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; +#ifdef notyet /* XXX signal stack */ + uintptr_t oldcontext; + size_t s1, s2; +#endif + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + +#ifdef notyet /* XXX signal stack */ + oldcontext = lwp->lwp_oldcontext; + s1 = sizeof (struct xframe) + 2 * sizeof (long); + s2 = s1 + sizeof (siginfo_t); +#endif + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = 0; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword64((void *)sp); + } + + while (pc != 0) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = sp; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + + if (sp == 0) + break; + +#ifdef notyet /* XXX signal stack */ + if (oldcontext == sp + s1 || oldcontext == sp + s2) { + ucontext_t *ucp = (ucontext_t *)oldcontext; + greg_t *gregs = ucp->uc_mcontext.gregs; + + sp = dtrace_fulword(&gregs[REG_FP]); + pc = dtrace_fulword(&gregs[REG_PC]); + + oldcontext = dtrace_fulword(&ucp->uc_link); + } else +#endif /* XXX */ + { + pc = dtrace_fuword32((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword32((void *)sp); + } + + /* + * This is totally bogus: if we faulted, we're going to clear + * the fault and break. This is to deal with the apparently + * broken Java stacks on x86. + */ + if (*flags & CPU_DTRACE_FAULT) { + *flags &= ~CPU_DTRACE_FAULT; + break; + } + } + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + return (0); +} + +#ifdef notyet +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) frame)) + break; + + callpc = *(void **)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(void **)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} +#endif + +int +dtrace_getstackdepth(int aframes) +{ + int depth = 0; + register_t sp; + + aframes++; + sp = dtrace_getfp(); + depth++; + for(;;) { + if (!INKERNEL((long) sp)) + break; + if (!INKERNEL((long) *(void **)sp)) + break; + depth++; + sp = *(uintptr_t *)sp; + } + if (depth < aframes) + return 0; + else + return depth - aframes; +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + if (reg < 32) + return (rp->fixreg[reg]); + + switch (reg) { + case 33: + return (rp->lr); + case 34: + return (rp->cr); + case 35: + return (rp->xer); + case 36: + return (rp->ctr); + case 37: + return (rp->srr0); + case 38: + return (rp->srr1); + case 39: + return (rp->exc); + default: + DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); + return (0); + } +} + +static int +dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +{ + ASSERT(INKERNEL(kaddr) && kaddr + size >= kaddr); + + if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = uaddr; + return (0); + } + + return (1); +} + +void +dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(uaddr, kaddr, size); +} + +void +dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(kaddr, uaddr, size); +} + +void +dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(uaddr, kaddr, size, flags); +} + +void +dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(kaddr, uaddr, size, flags); +} + +uint8_t +dtrace_fuword8(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword8_nocheck(uaddr)); +} + +uint16_t +dtrace_fuword16(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword16_nocheck(uaddr)); +} + +uint32_t +dtrace_fuword32(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword32_nocheck(uaddr)); +} + +uint64_t +dtrace_fuword64(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword64_nocheck(uaddr)); +} Index: sys/cddl/dev/dtrace/powerpc/dtrace_asm.S =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (working copy) @@ -0,0 +1,269 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S 233484 2012-03-26 01:26:33Z gonzo $ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "assym.s" + +#define _ASM + +#include +#include + +#include +/* +#include +*/ + +/* + * Primitives + */ + + .text + +/* +void dtrace_membar_producer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_producer) + blr +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_consumer) + blr +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ASENTRY_NOPROF(dtrace_interrupt_disable) + mfmsr %r3 + andi. %r0,%r3,~PSL_EE@l + mtmsr %r0 + blr +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ASENTRY_NOPROF(dtrace_interrupt_enable) + mtmsr %r3 + blr +END(dtrace_interrupt_enable) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ASENTRY_NOPROF(dtrace_cas32) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_cas32) + +/* +void * +dtrace_casptr(void *target, void *cmp, void *new) +*/ +ASENTRY_NOPROF(dtrace_casptr) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_casptr) + + +/* +uintptr_t +dtrace_fulword(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fulword) +END(dtrace_fulword) + +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword8_nocheck) + lbz %r3,0(%r3) + blr +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword16_nocheck) + lhz %r3,0(%r3) + blr +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword32_nocheck) + lwz %r3,0(%r3) + blr +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword64_nocheck) +#if defined(__powerpc64__) + ld %r3,0(%r3) +#else + lwz %r5,0(%r3) + lwz %r4,4(%r3) + mr %r3,%r5 +#endif + blr +END(dtrace_fuword64_nocheck) + +/* +XXX: unoptimized +void +dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ +ASENTRY_NOPROF(dtrace_copy) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f +2: + blr +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +*/ +ASENTRY_NOPROF(dtrace_copystr) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f + or %r3,%r3,%r3 + beq 2f + andi. %r0,%r5,0x0fff + beq 2f + lwz %r0,0(%r6) + andi. %r0,%r0,CPU_DTRACE_BADADDR + beq 1b +2: + blr +END(dtrace_copystr) + +/* +void dtrace_invop_init(void) +*/ +ASENTRY_NOPROF(dtrace_invop_init) + /* XXX: impement it properly -- implement dtrace_invop_start */ + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_init) + +/* +void dtrace_invop_uninit(void) +*/ +ASENTRY_NOPROF(dtrace_invop_uninit) + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_uninit) + +/* + * The panic() and cmn_err() functions invoke vpanic() as a common entry point + * into the panic code implemented in panicsys(). vpanic() is responsible + * for passing through the format string and arguments, and constructing a + * regs structure on the stack into which it saves the current register + * values. If we are not dying due to a fatal trap, these registers will + * then be preserved in panicbuf as the current processor state. Before + * invoking panicsys(), vpanic() activates the first panic trigger (see + * common/os/panic.c) and switches to the panic_stack if successful. Note that + * DTrace takes a slightly different panic path if it must panic from probe + * context. Instead of calling panic, it calls into dtrace_vpanic(), which + * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and + * branches back into vpanic(). + */ + +/* +void +vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(vpanic) /* Initial stack layout: */ + +vpanic_common: + blr +END(vpanic) + + + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */ + +#if 0 + bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ +#endif + b vpanic_common +END(dtrace_vpanic) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ASENTRY_NOPROF(dtrace_caller) + li %r3, -1 + blr +END(dtrace_caller) + Index: sys/cddl/dev/dtrace/powerpc/dtrace_subr.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (working copy) @@ -0,0 +1,201 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $ + * + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DELAYBRANCH(x) ((int)(x) < 0) + +extern uintptr_t dtrace_in_probe_addr; +extern int dtrace_in_probe; +extern dtrace_id_t dtrace_probeid_error; + +int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); + +typedef struct dtrace_invop_hdlr { + int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + struct dtrace_invop_hdlr *dtih_next; +} dtrace_invop_hdlr_t; + +dtrace_invop_hdlr_t *dtrace_invop_hdlr; + +int +dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +{ + dtrace_invop_hdlr_t *hdlr; + int rval; + + for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) + if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + return (rval); + + return (0); +} + + +/*ARGSUSED*/ +void +dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) +{ + /* + * No toxic regions? + */ +} + +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, + smp_no_rendevous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + +/* + * DTrace needs a high resolution time function which can + * be called from a probe context and guaranteed not to have + * instrumented with probes itself. + * + * Returns nanoseconds since boot. + */ +uint64_t +dtrace_gethrtime() +{ + struct timespec curtime; + + nanouptime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + +} + +uint64_t +dtrace_gethrestime(void) +{ + struct timespec curtime; + + getnanotime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); +} + +/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ +int +dtrace_trap(struct trapframe *frame, u_int type) +{ + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * Check if DTrace has enabled 'no-fault' mode: + * + */ + if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { + /* + * There are only a couple of trap types that are expected. + * All the rest will be handled in the usual way. + */ + switch (type) { + /* Page fault. */ + case EXC_DSI: + case EXC_DSE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->cpu.aim.dar; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + case EXC_ISI: + case EXC_ISE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->srr0; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + default: + /* Handle all other traps in the usual way. */ + break; + } + } + + /* Handle the trap in the usual way. */ + return (0); +} + +void +dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which, + int fault, int fltoffs, uintptr_t illval) +{ + + dtrace_probe(dtrace_probeid_error, (uint64_t)(uintptr_t)state, + (uintptr_t)epid, + (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs); +} Index: sys/modules/Makefile =================================================================== --- sys/modules/Makefile (revision 241450) +++ sys/modules/Makefile (working copy) @@ -803,6 +803,9 @@ _pccard= pccard _smbfs= smbfs _sound= sound +_cyclic= cyclic +_dtrace= dtrace +_opensolaris= opensolaris .endif .if ${MACHINE_ARCH} == "powerpc64" Index: sys/powerpc/aim/locore32.S =================================================================== --- sys/powerpc/aim/locore32.S (revision 241450) +++ sys/powerpc/aim/locore32.S (working copy) @@ -65,6 +65,8 @@ #include #include +#include "opt_kdtrace.h" + /* Locate the per-CPU data structure */ #define GET_CPUINFO(r) \ mfsprg0 r Index: lib/Makefile =================================================================== --- lib/Makefile (revision 241450) +++ lib/Makefile (working copy) @@ -209,6 +209,8 @@ .endif .if ${MACHINE_CPUARCH} == "powerpc" +_libproc= libproc +_librtld_db= librtld_db _libsmb= libsmb .endif Index: lib/libproc/proc_regs.c =================================================================== --- lib/libproc/proc_regs.c (revision 241450) +++ lib/libproc/proc_regs.c (working copy) @@ -60,6 +60,8 @@ *regvalue = regs.r_eip; #elif defined(__mips__) *regvalue = regs.r_regs[PC]; +#elif defined(__powerpc__) + *regvalue = regs.pc; #endif break; case REG_SP: @@ -69,6 +71,8 @@ *regvalue = regs.r_esp; #elif defined(__mips__) *regvalue = regs.r_regs[SP]; +#elif defined(__powerpc__) + *regvalue = regs.fixreg[1]; #endif break; default: @@ -99,6 +103,8 @@ regs.r_eip = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.pc = regvalue; #endif break; case REG_SP: @@ -108,6 +114,8 @@ regs.r_esp = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.fixreg[1] = regvalue; #endif break; default: Index: lib/libproc/proc_bkpt.c =================================================================== --- lib/libproc/proc_bkpt.c (revision 241450) +++ lib/libproc/proc_bkpt.c (working copy) @@ -47,6 +47,9 @@ #elif defined(__mips__) #define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__powerpc__) +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif --MP_/kq=KQQOav+pc79+hUczvDBG-- From owner-freebsd-ppc@FreeBSD.ORG Thu Oct 11 22:58:53 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20CC65D2 for ; Thu, 11 Oct 2012 22:58:53 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id B2CA88FC0C for ; Thu, 11 Oct 2012 22:58:52 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i29so27565qaf.13 for ; Thu, 11 Oct 2012 15:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=3KGVF8pxcm768K+rfF/rqty8Q3AexHWjerShn5ZvFkE=; b=gNJYQoUCA/JMOlHXGlKRHHWj0Bz+vCNidmq2nRvI+i1ndJ9s4R1vcTslbFdl0h5ZME JS12tub/A/TxOVcw4ij4BDpFbX39eLvNH7Ahm11olZxmywIUI0SUmbd7a5vfl6ogCePH /u5dj9tVyC4kBxIGZZPKcExFbqrhGE7EBuAH5ZmrBtJsLjeOvB9h4GbV/laHtln3mOaW +mL0AvpswHyKw7zBZ21VcO21Uc95nSU9vmn1YqSCoIvROxTYJsJnbuaY9hEO6fdzK5V7 lSvxspmi3RZiZ3ZQ6Fgt9fHPpEnm5P046z2aJdtWhdVyTQ8QeqZh0+BrwEigWlThl0bx FBlA== Received: by 10.49.60.72 with SMTP id f8mr5612662qer.30.1349996331847; Thu, 11 Oct 2012 15:58:51 -0700 (PDT) Received: from narn.knownspace (pool-108-48-127-15.washdc.fios.verizon.net. [108.48.127.15]) by mx.google.com with ESMTPS id jw1sm4981454qeb.13.2012.10.11.15.58.51 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 15:58:51 -0700 (PDT) Date: Thu, 11 Oct 2012 18:58:49 -0400 From: Justin Hibbits To: Andreas Tobler Subject: Re: CFT: Dtrace on PowerPC Message-ID: <20121011185849.77dcd002@narn.knownspace> In-Reply-To: <50773674.3050802@fgznet.ch> References: <20121009190838.283976e1@narn.knownspace> <507561A4.5040902@fgznet.ch> <50773674.3050802@fgznet.ch> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/A61sMRJ_1PY8T7ZOu+_MYtd" Cc: freebsd-ppc@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 22:58:53 -0000 --MP_/A61sMRJ_1PY8T7ZOu+_MYtd Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thu, 11 Oct 2012 23:13:24 +0200 Andreas Tobler wrote: > Hi Justin, > > On 10.10.12 16:50, Justin Hibbits wrote: > > > On Wed, Oct 10, 2012 at 7:53 AM, Andreas Tobler > > > wrote: > > > > Hi Justin! > > > > > > On 10.10.12 01:08, Justin Hibbits wrote: > > > > After a few days of development, and a few weeks of > > testing, here's Dtrace on PowerPC. There is only one known issue > > that I know of so far: dtruss kernel panics through an assertion. > > I have to investigate > > this some more, but some dtrace -n "" testing works. > > > > > > Cool!!! > > > > Three things, I have not tested this code yet but I did look > > over it. > > > > - powerpc64 support is not yet complete, right? > > > > > > Nope, ppc64 is not complete. It shouldn't be too much more work, > > though. > > Ok. > > > - sys/cddl/dev/dtrace/powerpc/__dtrace_asm.S and > > sys/cddl/dev/dtrace/powerpc/__dtrace_subr.c have some mips > > leftovers or are they intentional? ($FreeBSD, _FBSDID) > > > > > > I believe these should change when actually committed (didn't set > > the svn property when adding the code yet). > > The FBSDID yes, but I guess the part in the comment not. > > > - what is the hid.h include for in sys/powerpc/aim/locore32.S? > > > > > > This is from another task I've been working on for something else. > > I'll remember to remove it when doing the actual commit. > > Ok. > > > Thanks for (future) testing. > > One more thing, the patch for the binaries like dtrace etc. is also > available? Or is it meant as an exercise for the user ;) > > Thanks, > Andreas > Let me try this one more time (serves me right for doing multiple projects in one tree). I hope I got this one right. (I swear I've tested all this code!) - Justin --MP_/A61sMRJ_1PY8T7ZOu+_MYtd Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=dtrace_ppc4.diff Index: cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c =================================================================== --- cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (revision 0) +++ cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (working copy) @@ -0,0 +1,75 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} Index: cddl/usr.sbin/Makefile =================================================================== --- cddl/usr.sbin/Makefile (revision 241450) +++ cddl/usr.sbin/Makefile (working copy) @@ -25,4 +25,10 @@ _dtrace= dtrace .endif +.if ${MACHINE_CPUARCH} == "powerpc" +_dtrace= dtrace +_dtruss= dtruss +_lockstat= lockstat +.endif + .include Index: cddl/lib/libdtrace/Makefile =================================================================== --- cddl/lib/libdtrace/Makefile (revision 241450) +++ cddl/lib/libdtrace/Makefile (working copy) @@ -74,6 +74,10 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.elif ${MACHINE_CPUARCH} == "powerpc" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Index: cddl/lib/Makefile =================================================================== --- cddl/lib/Makefile (revision 241450) +++ cddl/lib/Makefile (working copy) @@ -19,7 +19,8 @@ .endif .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_ARCH} == "powerpc" _drti= drti _libdtrace= libdtrace .endif Index: sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (working copy) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * XXX: Placeholder for PowerPC fasttrap code + */ Index: sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h =================================================================== --- sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (revision 0) +++ sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (working copy) @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif +/* + * XXXDTRACE: placehodler for PowerPC fasttrap stuff + */ + +typedef uint32_t fasttrap_instr_t; +#define FASTTRAP_SUNWDTRACE_SIZE 64 +#define FASTTRAP_INSTR 0x0FFFDDDD + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (revision 241450) +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c (working copy) @@ -235,7 +235,7 @@ static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) || defined(__mips__) +#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif #endif @@ -10762,7 +10762,7 @@ #else int i; -#if defined(__amd64__) || defined(__mips__) +#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Index: sys/cddl/dev/dtrace/powerpc/regset.h =================================================================== Index: sys/cddl/dev/dtrace/powerpc/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (working copy) @@ -0,0 +1,510 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c 211608 2010-08-22 10:53:32Z rpaulo $ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "regset.h" + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +/* Offset to the LR Save word (ppc32) */ +#define RETURN_OFFSET 4 + +#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) + +greg_t +dtrace_getfp(void) +{ + return (greg_t)__builtin_frame_address(0); +} + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) sp)) + break; + + callpc = *(uintptr_t *)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(uintptr_t*)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +static int +dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, + uintptr_t sp) +{ + int ret = 0; + + ASSERT(pcstack == NULL || pcstack_limit > 0); + + while (pc != 0) { + ret++; + if (pcstack != NULL) { + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + } + + if (sp == 0) + break; + + pc = dtrace_fuword64((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword64((void *)sp); + } + + return (ret); +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + int n; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword32((void *) sp); + } + + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); + ASSERT(n >= 0); + ASSERT(n <= pcstack_limit); + + pcstack += n; + pcstack_limit -= n; + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + int n = 0; + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_FAULT)) + return (-1); + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + pc = dtrace_fuword64((void *) sp); + n++; + } + + n += dtrace_getustack_common(NULL, 0, pc, sp); + + return (n); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; +#ifdef notyet /* XXX signal stack */ + uintptr_t oldcontext; + size_t s1, s2; +#endif + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + +#ifdef notyet /* XXX signal stack */ + oldcontext = lwp->lwp_oldcontext; + s1 = sizeof (struct xframe) + 2 * sizeof (long); + s2 = s1 + sizeof (siginfo_t); +#endif + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = 0; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = dtrace_fuword64((void *)sp); + } + + while (pc != 0) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = sp; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + + if (sp == 0) + break; + +#ifdef notyet /* XXX signal stack */ + if (oldcontext == sp + s1 || oldcontext == sp + s2) { + ucontext_t *ucp = (ucontext_t *)oldcontext; + greg_t *gregs = ucp->uc_mcontext.gregs; + + sp = dtrace_fulword(&gregs[REG_FP]); + pc = dtrace_fulword(&gregs[REG_PC]); + + oldcontext = dtrace_fulword(&ucp->uc_link); + } else +#endif /* XXX */ + { + pc = dtrace_fuword32((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword32((void *)sp); + } + + /* + * This is totally bogus: if we faulted, we're going to clear + * the fault and break. This is to deal with the apparently + * broken Java stacks on x86. + */ + if (*flags & CPU_DTRACE_FAULT) { + *flags &= ~CPU_DTRACE_FAULT; + break; + } + } + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + return (0); +} + +#ifdef notyet +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) frame)) + break; + + callpc = *(void **)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(void **)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} +#endif + +int +dtrace_getstackdepth(int aframes) +{ + int depth = 0; + register_t sp; + + aframes++; + sp = dtrace_getfp(); + depth++; + for(;;) { + if (!INKERNEL((long) sp)) + break; + if (!INKERNEL((long) *(void **)sp)) + break; + depth++; + sp = *(uintptr_t *)sp; + } + if (depth < aframes) + return 0; + else + return depth - aframes; +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + if (reg < 32) + return (rp->fixreg[reg]); + + switch (reg) { + case 33: + return (rp->lr); + case 34: + return (rp->cr); + case 35: + return (rp->xer); + case 36: + return (rp->ctr); + case 37: + return (rp->srr0); + case 38: + return (rp->srr1); + case 39: + return (rp->exc); + default: + DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); + return (0); + } +} + +static int +dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +{ + ASSERT(INKERNEL(kaddr) && kaddr + size >= kaddr); + + if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = uaddr; + return (0); + } + + return (1); +} + +void +dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(uaddr, kaddr, size); +} + +void +dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copy(kaddr, uaddr, size); +} + +void +dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(uaddr, kaddr, size, flags); +} + +void +dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, + volatile uint16_t *flags) +{ + if (dtrace_copycheck(uaddr, kaddr, size)) + dtrace_copystr(kaddr, uaddr, size, flags); +} + +uint8_t +dtrace_fuword8(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword8_nocheck(uaddr)); +} + +uint16_t +dtrace_fuword16(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword16_nocheck(uaddr)); +} + +uint32_t +dtrace_fuword32(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword32_nocheck(uaddr)); +} + +uint64_t +dtrace_fuword64(void *uaddr) +{ + if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + return (0); + } + return (dtrace_fuword64_nocheck(uaddr)); +} Index: sys/cddl/dev/dtrace/powerpc/dtrace_asm.S =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (working copy) @@ -0,0 +1,269 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S 233484 2012-03-26 01:26:33Z gonzo $ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "assym.s" + +#define _ASM + +#include +#include + +#include +/* +#include +*/ + +/* + * Primitives + */ + + .text + +/* +void dtrace_membar_producer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_producer) + blr +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_consumer) + blr +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ASENTRY_NOPROF(dtrace_interrupt_disable) + mfmsr %r3 + andi. %r0,%r3,~PSL_EE@l + mtmsr %r0 + blr +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ASENTRY_NOPROF(dtrace_interrupt_enable) + mtmsr %r3 + blr +END(dtrace_interrupt_enable) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ASENTRY_NOPROF(dtrace_cas32) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_cas32) + +/* +void * +dtrace_casptr(void *target, void *cmp, void *new) +*/ +ASENTRY_NOPROF(dtrace_casptr) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r6 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_casptr) + + +/* +uintptr_t +dtrace_fulword(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fulword) +END(dtrace_fulword) + +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword8_nocheck) + lbz %r3,0(%r3) + blr +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword16_nocheck) + lhz %r3,0(%r3) + blr +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword32_nocheck) + lwz %r3,0(%r3) + blr +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword64_nocheck) +#if defined(__powerpc64__) + ld %r3,0(%r3) +#else + lwz %r5,0(%r3) + lwz %r4,4(%r3) + mr %r3,%r5 +#endif + blr +END(dtrace_fuword64_nocheck) + +/* +XXX: unoptimized +void +dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ +ASENTRY_NOPROF(dtrace_copy) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f +2: + blr +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +*/ +ASENTRY_NOPROF(dtrace_copystr) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f + or %r3,%r3,%r3 + beq 2f + andi. %r0,%r5,0x0fff + beq 2f + lwz %r0,0(%r6) + andi. %r0,%r0,CPU_DTRACE_BADADDR + beq 1b +2: + blr +END(dtrace_copystr) + +/* +void dtrace_invop_init(void) +*/ +ASENTRY_NOPROF(dtrace_invop_init) + /* XXX: impement it properly -- implement dtrace_invop_start */ + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_init) + +/* +void dtrace_invop_uninit(void) +*/ +ASENTRY_NOPROF(dtrace_invop_uninit) + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_uninit) + +/* + * The panic() and cmn_err() functions invoke vpanic() as a common entry point + * into the panic code implemented in panicsys(). vpanic() is responsible + * for passing through the format string and arguments, and constructing a + * regs structure on the stack into which it saves the current register + * values. If we are not dying due to a fatal trap, these registers will + * then be preserved in panicbuf as the current processor state. Before + * invoking panicsys(), vpanic() activates the first panic trigger (see + * common/os/panic.c) and switches to the panic_stack if successful. Note that + * DTrace takes a slightly different panic path if it must panic from probe + * context. Instead of calling panic, it calls into dtrace_vpanic(), which + * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and + * branches back into vpanic(). + */ + +/* +void +vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(vpanic) /* Initial stack layout: */ + +vpanic_common: + blr +END(vpanic) + + + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */ + +#if 0 + bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ +#endif + b vpanic_common +END(dtrace_vpanic) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ASENTRY_NOPROF(dtrace_caller) + li %r3, -1 + blr +END(dtrace_caller) + Index: sys/cddl/dev/dtrace/powerpc/dtrace_subr.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (revision 0) +++ sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (working copy) @@ -0,0 +1,201 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $ + * + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DELAYBRANCH(x) ((int)(x) < 0) + +extern uintptr_t dtrace_in_probe_addr; +extern int dtrace_in_probe; +extern dtrace_id_t dtrace_probeid_error; + +int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); + +typedef struct dtrace_invop_hdlr { + int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + struct dtrace_invop_hdlr *dtih_next; +} dtrace_invop_hdlr_t; + +dtrace_invop_hdlr_t *dtrace_invop_hdlr; + +int +dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax) +{ + dtrace_invop_hdlr_t *hdlr; + int rval; + + for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) + if ((rval = hdlr->dtih_func(addr, stack, eax)) != 0) + return (rval); + + return (0); +} + + +/*ARGSUSED*/ +void +dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) +{ + /* + * No toxic regions? + */ +} + +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, + smp_no_rendevous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + +/* + * DTrace needs a high resolution time function which can + * be called from a probe context and guaranteed not to have + * instrumented with probes itself. + * + * Returns nanoseconds since boot. + */ +uint64_t +dtrace_gethrtime() +{ + struct timespec curtime; + + nanouptime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + +} + +uint64_t +dtrace_gethrestime(void) +{ + struct timespec curtime; + + getnanotime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); +} + +/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ +int +dtrace_trap(struct trapframe *frame, u_int type) +{ + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * Check if DTrace has enabled 'no-fault' mode: + * + */ + if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { + /* + * There are only a couple of trap types that are expected. + * All the rest will be handled in the usual way. + */ + switch (type) { + /* Page fault. */ + case EXC_DSI: + case EXC_DSE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->cpu.aim.dar; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + case EXC_ISI: + case EXC_ISE: + /* Flag a bad address. */ + cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = frame->srr0; + + /* + * Offset the instruction pointer to the instruction + * following the one causing the fault. + */ + frame->srr0 += sizeof(int); + return (1); + default: + /* Handle all other traps in the usual way. */ + break; + } + } + + /* Handle the trap in the usual way. */ + return (0); +} + +void +dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which, + int fault, int fltoffs, uintptr_t illval) +{ + + dtrace_probe(dtrace_probeid_error, (uint64_t)(uintptr_t)state, + (uintptr_t)epid, + (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs); +} Index: sys/modules/Makefile =================================================================== --- sys/modules/Makefile (revision 241450) +++ sys/modules/Makefile (working copy) @@ -803,6 +803,9 @@ _pccard= pccard _smbfs= smbfs _sound= sound +_cyclic= cyclic +_dtrace= dtrace +_opensolaris= opensolaris .endif .if ${MACHINE_ARCH} == "powerpc64" Index: sys/powerpc/aim/locore32.S =================================================================== --- sys/powerpc/aim/locore32.S (revision 241450) +++ sys/powerpc/aim/locore32.S (working copy) @@ -65,6 +65,8 @@ #include #include +#include "opt_kdtrace.h" + /* Locate the per-CPU data structure */ #define GET_CPUINFO(r) \ mfsprg0 r Index: sys/powerpc/aim/trap.c =================================================================== --- sys/powerpc/aim/trap.c (revision 241450) +++ sys/powerpc/aim/trap.c (working copy) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" +#include "opt_kdtrace.h" #include #include @@ -104,6 +105,33 @@ char *name; }; +#ifdef KDTRACE_HOOKS +#include + +/* + * This is a hook which is initialised by the dtrace module + * to handle traps which might occur during DTrace probe + * execution. + */ +dtrace_trap_func_t dtrace_trap_func; + +dtrace_doubletrap_func_t dtrace_doubletrap_func; + +/* + * This is a hook which is initialised by the systrace module + * when it is loaded. This keeps the DTrace syscall provider + * implementation opaque. + */ +systrace_probe_func_t systrace_probe_func; + +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; +#endif + static struct powerpc_exception powerpc_exceptions[] = { { 0x0100, "system reset" }, { 0x0200, "machine check" }, @@ -176,6 +204,28 @@ } else #endif +#ifdef KDTRACE_HOOKS + /* + * A trap can occur while DTrace executes a probe. Before + * executing the probe, DTrace blocks re-scheduling and sets + * a flag in it's per-cpu flags to indicate that it doesn't + * want to fault. On returning from the probe, the no-fault + * flag is cleared and finally re-scheduling is enabled. + * + * If the DTrace kernel module has registered a trap handler, + * call it and if it returns non-zero, assume that it has + * handled the trap and modified the trap frame so that this + * function can return normally. + */ + /* + * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + */ + if (!user) { + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + return; + } +#endif + if (user) { td->td_pticks = 0; td->td_frame = frame; @@ -617,6 +667,9 @@ PROC_LOCK(p); --p->p_lock; PROC_UNLOCK(p); + /* + * XXXDTRACE: add dtrace_doubletrap_func here? + */ } else { /* * Don't have to worry about process locking or stacks in the Index: sys/powerpc/aim/trap_subr32.S =================================================================== --- sys/powerpc/aim/trap_subr32.S (revision 241450) +++ sys/powerpc/aim/trap_subr32.S (working copy) @@ -240,6 +240,26 @@ mfsprg2 %r2; /* restore r2 & r3 */ \ mfsprg3 %r3 +#ifdef KDTRACE_HOOKS + .data + .globl dtrace_invop_jump_addr + .align 4 + .type dtrace_invop_jump_addr, @object + .size dtrace_invop_jump_addr, 8 +dtrace_invop_jump_addr: + .word 0 + .word 0 + .globl dtrace_invop_calltrap_addr + .align 4 + .type dtrace_invop_calltrap_addr, @object + .size dtrace_invop_calltrap_addr, 8 +dtrace_invop_calltrap_addr: + .word 0 + .word 0 + + .text +#endif + /* * The next two routines are 64-bit glue code. The first is used to test if * we are on a 64-bit system. By copying it to the illegal instruction Index: lib/Makefile =================================================================== --- lib/Makefile (revision 241450) +++ lib/Makefile (working copy) @@ -209,6 +209,8 @@ .endif .if ${MACHINE_CPUARCH} == "powerpc" +_libproc= libproc +_librtld_db= librtld_db _libsmb= libsmb .endif Index: lib/libproc/proc_regs.c =================================================================== --- lib/libproc/proc_regs.c (revision 241450) +++ lib/libproc/proc_regs.c (working copy) @@ -60,6 +60,8 @@ *regvalue = regs.r_eip; #elif defined(__mips__) *regvalue = regs.r_regs[PC]; +#elif defined(__powerpc__) + *regvalue = regs.pc; #endif break; case REG_SP: @@ -69,6 +71,8 @@ *regvalue = regs.r_esp; #elif defined(__mips__) *regvalue = regs.r_regs[SP]; +#elif defined(__powerpc__) + *regvalue = regs.fixreg[1]; #endif break; default: @@ -99,6 +103,8 @@ regs.r_eip = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.pc = regvalue; #endif break; case REG_SP: @@ -108,6 +114,8 @@ regs.r_esp = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.fixreg[1] = regvalue; #endif break; default: Index: lib/libproc/proc_bkpt.c =================================================================== --- lib/libproc/proc_bkpt.c (revision 241450) +++ lib/libproc/proc_bkpt.c (working copy) @@ -47,6 +47,9 @@ #elif defined(__mips__) #define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__powerpc__) +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif --MP_/A61sMRJ_1PY8T7ZOu+_MYtd--