Subject: Re: per-cpu TSS
To: Frank van der Linden <fvdl@netbsd.org>
From: Bang Jun-Young <junyoung@netbsd.org>
List: port-i386
Date: 11/13/2003 22:36:31
On Thu, Nov 13, 2003 at 01:38:32PM +0100, Frank van der Linden wrote:
> On Thu, Nov 13, 2003 at 10:11:13AM +0900, YAMAMOTO Takashi wrote:
> > i thought task switch using tss was rather slower.  have you measured?
> 
> Btw, if we want to speed up the syscall path, we should be using sysenter/
> sysret on P4s. This is actually most efficiently supported with a
> per-CPU TSS. Otherwise, you need to do a wrmsr for each context
> switch, and wrmsr is very slow.
> 
> With a per-CPU TSS, you can just point the SYSENTER_ESP MSR at the
> per-CPU TSS, and grab the actual kernel stack pointer out of
> tss_esp0 (this is safe, sysenter disables interrupts). This is what
> Linux does. Note that Linux used to use the TSS structures for
> switching, but moved away from it.

A problem with sysenter/sysexit is that it requires code segment and
stack segment of 4GB limit. So it can't coexist with non-executable
stack.

Jun-Young

-- 
Bang Jun-Young <junyoung@NetBSD.org>