Date: Thu, 21 Jun 2007 10:41:45 -0700 From: Marcel Moolenaar <xcllnt@mac.com> To: Christian Kandeler <christian.kandeler@hob.de> Cc: ia64@freebsd.org Subject: Re: Syscalls and RSE Message-ID: <3700F902-9CC0-4A6A-B625-8E81C12C5D5E@mac.com> In-Reply-To: <200706211132.32524.christian.kandeler@hob.de> References: <200706211132.32524.christian.kandeler@hob.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3700F902-9CC0-4A6A-B625-8E81C12C5D5E>