From owner-cvs-src-old@FreeBSD.ORG Fri Nov 5 13:43:28 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 07922106564A for ; Fri, 5 Nov 2010 13:43:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CB5428FC24 for ; Fri, 5 Nov 2010 13:43:27 +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 oA5DhRWj056517 for ; Fri, 5 Nov 2010 13:43:27 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id oA5DhRNj056516 for cvs-src-old@freebsd.org; Fri, 5 Nov 2010 13:43:27 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <201011051343.oA5DhRNj056516@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Fri, 5 Nov 2010 13:42:58 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/amd64/amd64 machdep.c src/sys/arm/arm machdep.c src/sys/i386/i386 machdep.c src/sys/ia64/ia64 machdep.c src/sys/mips/mips machdep.c src/sys/pc98/pc98 machdep.c src/sys/powerpc/aim machdep.c src/sys/powerpc/booke machdep.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: Fri, 05 Nov 2010 13:43:28 -0000 jhb 2010-11-05 13:42:58 UTC FreeBSD src repository Modified files: sys/amd64/amd64 machdep.c sys/arm/arm machdep.c sys/i386/i386 machdep.c sys/ia64/ia64 machdep.c sys/mips/mips machdep.c sys/pc98/pc98 machdep.c sys/powerpc/aim machdep.c sys/powerpc/booke machdep.c sys/sparc64/sparc64 machdep.c sys/sun4v/sun4v machdep.c Log: SVN rev 214835 on 2010-11-05 13:42:58Z by jhb Adjust the order of operations in spinlock_enter() and spinlock_exit() to work properly with single-stepping in a kernel debugger. Specifically, these routines have always disabled interrupts before increasing the nesting count and restored the prior state of interrupts after decreasing the nesting count to avoid problems with a nested interrupt not disabling interrupts when acquiring a spin lock. However, trap interrupts for single-stepping can still occur even when interrupts are disabled. Now the saved state of interrupts is not saved in the thread until after interrupts have been disabled and the nesting count has been increased. Similarly, the saved state from the thread cannot be read once the nesting count has been decreased to zero. To fix this, use temporary variables to store interrupt state and shuffle it between the thread's MD area and the appropriate registers. In cooperation with: bde MFC after: 1 month Revision Changes Path 1.728 +10 -4 src/sys/amd64/amd64/machdep.c 1.38 +10 -4 src/sys/arm/arm/machdep.c 1.711 +10 -4 src/sys/i386/i386/machdep.c 1.264 +10 -4 src/sys/ia64/ia64/machdep.c 1.36 +10 -4 src/sys/mips/mips/machdep.c 1.431 +10 -4 src/sys/pc98/pc98/machdep.c 1.144 +10 -4 src/sys/powerpc/aim/machdep.c 1.30 +10 -4 src/sys/powerpc/booke/machdep.c 1.171 +6 -3 src/sys/sparc64/sparc64/machdep.c 1.25 +7 -6 src/sys/sun4v/sun4v/machdep.c