Syscalls and RSE

Marcel Moolenaar xcllnt at mac.com
Thu Jun 21 17:42:28 UTC 2007


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 at mac.com




More information about the freebsd-ia64 mailing list