From owner-cvs-all Tue Apr 24 14: 6:57 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id F091A37B423; Tue, 24 Apr 2001 14:06:53 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3OL6rZ03237; Tue, 24 Apr 2001 14:06:53 -0700 (PDT) (envelope-from jhb) Message-Id: <200104242106.f3OL6rZ03237@freefall.freebsd.org> From: John Baldwin Date: Tue, 24 Apr 2001 14:06:53 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/alpha/alpha exception.s genassym.c interrupt.c machdep.c trap.c src/sys/alpha/include proc.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG jhb 2001/04/24 14:06:53 PDT Modified files: sys/alpha/alpha exception.s genassym.c interrupt.c machdep.c trap.c sys/alpha/include proc.h Log: Add a new field 'md_kernnest' to the alpha machine dependent process structure. This field keeps track of how many levels deep we are nested into the kernel. The nesting level is bumped at the start of a trap, interrupt, syscall, or exception and is decremented on return. This is used to detect the case when the kernel is returning back to a kernel context in exception_return(). If we are returning to the kernel we need to update the globaldata pointer register saved in the stack frame in case we have switched CPU's between taking the initial interrupt that saved the frame and returning. If we don't do this fixup it is possible for a CPU to use the wrong per-cpu data. On UP systems this is not a problem, so the code is conditional on SMP. A count was used instead of simply checking the process status register in the frame during exception_return() since there are critical sections at the very start and end of a trap, exception, or interrupt from userland in which we could trash the t7 register being used in userland. The counter is incremented after adn before these critical sections respectively so that we will not overwrite the saved t7 register if we are interrupted during one of these critical sections. Revision Changes Path 1.10 +32 -15 src/sys/alpha/alpha/exception.s 1.29 +4 -1 src/sys/alpha/alpha/genassym.c 1.48 +11 -1 src/sys/alpha/alpha/interrupt.c 1.125 +4 -1 src/sys/alpha/alpha/machdep.c 1.57 +23 -3 src/sys/alpha/alpha/trap.c 1.10 +2 -1 src/sys/alpha/include/proc.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message