From owner-cvs-src-old@FreeBSD.ORG Sat Oct 30 23:07:48 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C50751065670 for ; Sat, 30 Oct 2010 23:07:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 94E5E8FC1E for ; Sat, 30 Oct 2010 23:07:48 +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 o9UN7mp3034138 for ; Sat, 30 Oct 2010 23:07:48 GMT (envelope-from nwhitehorn@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o9UN7mF3034137 for cvs-src-old@freebsd.org; Sat, 30 Oct 2010 23:07:48 GMT (envelope-from nwhitehorn@repoman.freebsd.org) Message-Id: <201010302307.o9UN7mF3034137@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to nwhitehorn@repoman.freebsd.org using -f From: Nathan Whitehorn Date: Sat, 30 Oct 2010 23:07:30 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/powerpc/aim copyinout.c slb.c swtch64.S trap.c trap_subr32.S trap_subr64.S vm_machdep.c src/sys/powerpc/include pcb.h slb.h sr.h src/sys/powerpc/powerpc exec_machdep.c genassym.c 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: Sat, 30 Oct 2010 23:07:48 -0000 nwhitehorn 2010-10-30 23:07:30 UTC FreeBSD src repository Modified files: sys/powerpc/aim copyinout.c slb.c swtch64.S trap.c trap_subr32.S trap_subr64.S vm_machdep.c sys/powerpc/include pcb.h slb.h sr.h sys/powerpc/powerpc exec_machdep.c genassym.c Log: SVN rev 214574 on 2010-10-30 23:07:30Z by nwhitehorn Restructure the way the copyin/copyout segment is stored to prevent a concurrency bug. Since all SLB/SR entries were invalidated during an exception, a decrementer exception could cause the user segment to be invalidated during a copyin()/copyout() without a thread switch that would cause it to be restored from the PCB, potentially causing the operation to continue on invalid memory. This is now handled by explicit restoration of segment 12 from the PCB on 32-bit systems and a check in the Data Segment Exception handler on 64-bit. While here, cause copyin()/copyout() to check whether the requested user segment is already installed, saving some pipeline flushes, and fix the synchronization primitives around the mtsr and slbmte instructions to prevent accessing stale segments. MFC after: 2 weeks Revision Changes Path 1.20 +16 -13 src/sys/powerpc/aim/copyinout.c 1.5 +7 -7 src/sys/powerpc/aim/slb.c 1.2 +8 -8 src/sys/powerpc/aim/swtch64.S 1.87 +9 -1 src/sys/powerpc/aim/trap.c 1.2 +9 -2 src/sys/powerpc/aim/trap_subr32.S 1.3 +1 -1 src/sys/powerpc/aim/trap_subr64.S 1.130 +0 -1 src/sys/powerpc/aim/vm_machdep.c 1.16 +0 -1 src/sys/powerpc/include/pcb.h 1.3 +7 -0 src/sys/powerpc/include/slb.h 1.9 +0 -4 src/sys/powerpc/include/sr.h 1.4 +0 -1 src/sys/powerpc/powerpc/exec_machdep.c 1.68 +3 -2 src/sys/powerpc/powerpc/genassym.c