Date: Fri, 5 Nov 2010 13:42:58 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: cvs-src-old@freebsd.org 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 ... Message-ID: <201011051343.oA5DhRNj056516@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011051343.oA5DhRNj056516>