From owner-freebsd-ia64@FreeBSD.ORG Thu Jun 21 17:42:28 2007 Return-Path: X-Original-To: ia64@freebsd.org Delivered-To: freebsd-ia64@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B16F616A468 for ; Thu, 21 Jun 2007 17:42:28 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.177]) by mx1.freebsd.org (Postfix) with ESMTP id 9EA3F13C4BB for ; Thu, 21 Jun 2007 17:42:28 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/smtpout07/MantshX 4.0) with ESMTP id l5LHgSda029276; Thu, 21 Jun 2007 10:42:28 -0700 (PDT) Received: from [192.168.1.2] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 4.0) with ESMTP id l5LHg7b6026214 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 21 Jun 2007 10:42:28 -0700 (PDT) In-Reply-To: <200706211132.32524.christian.kandeler@hob.de> References: <200706211132.32524.christian.kandeler@hob.de> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3700F902-9CC0-4A6A-B625-8E81C12C5D5E@mac.com> Content-Transfer-Encoding: 7bit From: Marcel Moolenaar Date: Thu, 21 Jun 2007 10:41:45 -0700 To: Christian Kandeler X-Mailer: Apple Mail (2.752.3) Cc: ia64@freebsd.org Subject: Re: Syscalls and RSE X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 17:42:28 -0000 On Jun 21, 2007, at 2:32 AM, Christian Kandeler wrote: > Hi, > > I think I have spotted a problem with the Backing Store switch for > syscalls. > In epc_syscall, no flushrs is done; instead, the number of dirty > registers is > saved. But isn't it necessary in this case to restore the RNAT > register after > setting the new BspStore? Hi Christian, When we switch to the kernel stack, we align BSPSTORE to the user stack (WRT to NaT collections). In other words we preserve the least significant 9 bits of BSPSTORE. Since these bits determine when a NaT collection will happen and which bit in the RNAT register will take the NaT bit of the stacked register on a flush, we effectively preserved all the NaT bits without explicitly saving or restoring anything. Since, by preserving the alignment, any NaT collections that happen on the kernel stack (including those that contain NaT bits of user space registers) would have happened at the same time on the user stack if we didn't switch to the kernel stack. As such, we never clobber "used" bits in the RNAT register and it also allows us to flush the dirty registers onto the kernel stack and copy them back to user space knowing that any NaT collections on the kernel stack will be copied to the right location on the user stack. Also, any NaT bits left in RNAT after the loadrs on our way out of the kernel will be those of the user process. FYI, -- Marcel Moolenaar xcllnt@mac.com