Date: Sat, 30 Oct 2010 23:07:30 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: cvs-src-old@freebsd.org 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 Message-ID: <201010302307.o9UN7mF3034137@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010302307.o9UN7mF3034137>