From owner-cvs-src-old@FreeBSD.ORG Thu Jun 23 22:21:51 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C7F106567E for ; Thu, 23 Jun 2011 22:21:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id CA6968FC18 for ; Thu, 23 Jun 2011 22:21:51 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p5NMLpg8077607 for ; Thu, 23 Jun 2011 22:21:51 GMT (envelope-from nwhitehorn@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p5NMLp5q077606 for cvs-src-old@freebsd.org; Thu, 23 Jun 2011 22:21:51 GMT (envelope-from nwhitehorn@repoman.freebsd.org) Message-Id: <201106232221.p5NMLp5q077606@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to nwhitehorn@repoman.freebsd.org using -f From: Nathan Whitehorn Date: Thu, 23 Jun 2011 22:21:28 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/powerpc/aim copyinout.c locore32.S locore64.S machdep.c mp_cpudep.c swtch32.S swtch64.S trap.c trap_subr32.S trap_subr64.S src/sys/powerpc/booke copyinout.c interrupt.c trap.c src/sys/powerpc/include pcpu.h src/sys/powerpc/ofw ofwcall32.S ... X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 22:21:52 -0000 nwhitehorn 2011-06-23 22:21:28 UTC FreeBSD src repository Modified files: sys/powerpc/aim copyinout.c locore32.S locore64.S machdep.c mp_cpudep.c swtch32.S swtch64.S trap.c trap_subr32.S trap_subr64.S sys/powerpc/booke copyinout.c interrupt.c trap.c sys/powerpc/include pcpu.h sys/powerpc/ofw ofwcall32.S sys/powerpc/powerpc mp_machdep.c Log: SVN rev 223485 on 2011-06-23 22:21:28Z by nwhitehorn Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64) instead of a PCPU field for curthread. This averts a race on SMP systems with a high interrupt rate where the thread looking up the value of curthread could be preempted and migrated between obtaining the PCPU pointer and reading the value of pc_curthread, resulting in curthread being observed to be the current thread on the thread's original CPU. This played merry havoc with the system, in particular with mutexes. Many thanks to jhb for helping me work this one out. Note that Book-E is in principle susceptible to the same problem, but has not been modified yet due to lack of Book-E hardware. MFC after: 2 weeks Revision Changes Path 1.25 +11 -11 src/sys/powerpc/aim/copyinout.c 1.3 +1 -2 src/sys/powerpc/aim/locore32.S 1.5 +1 -2 src/sys/powerpc/aim/locore64.S 1.155 +2 -2 src/sys/powerpc/aim/machdep.c 1.14 +1 -1 src/sys/powerpc/aim/mp_cpudep.c 1.4 +8 -10 src/sys/powerpc/aim/swtch32.S 1.6 +8 -10 src/sys/powerpc/aim/swtch64.S 1.92 +3 -3 src/sys/powerpc/aim/trap.c 1.5 +10 -4 src/sys/powerpc/aim/trap_subr32.S 1.8 +9 -4 src/sys/powerpc/aim/trap_subr64.S 1.3 +8 -8 src/sys/powerpc/booke/copyinout.c 1.7 +1 -1 src/sys/powerpc/booke/interrupt.c 1.9 +3 -3 src/sys/powerpc/booke/trap.c 1.35 +8 -0 src/sys/powerpc/include/pcpu.h 1.2 +8 -6 src/sys/powerpc/ofw/ofwcall32.S 1.40 +0 -4 src/sys/powerpc/powerpc/mp_machdep.c