Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2002 12:29:26 +0100
From:      Espen Skoglund <esk@ira.uka.de>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        ia64@freebsd.org
Subject:   Re: libc_r: syscalls, epc and unwinding [was: Re: setjmp/longjmp and libc_r...]
Message-ID:  <15832.53014.422459.568935@i30nb20.ira.uka.de>
In-Reply-To: <20021117185344.GA603@athlon.pn.xcllnt.net>
References:  <200211140640.gAE6eNq9016231@repoman.freebsd.org> <200211161101.38075.dfr@nlsystems.com> <20021116172102.GA618@dhcp01.pn.xcllnt.net> <200211171017.30008.dfr@nlsystems.com> <20021117185344.GA603@athlon.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
[Marcel Moolenaar]
> On Sun, Nov 17, 2002 at 10:17:29AM +0000, Doug Rabson wrote:
>> Why would EPC syscalls make this easier? Obviously they would be faster 
>> but I can't quite see how they would make it easier to switch the 
>> inaccessable parts of the register state.

> It allows the hybrid user-syscall solution.

> This is what I have now:

> 1.  USRSTACK = VM_MAX_ADDRESS = VM_MAXUSER_ADDRESS-(1024*1024)
> 	I currently deal with page faults in the 1M area by special
> 	casing them in trap.c. Probably not right, but I claim
> 	ignorance :-)

> 2.  Syscalls look like:
> 	#define SYSCALLNUM(name)        SYS_ ## name
> 	#define GATEWAY_PAGE            ((5 << 61) - 1048576)

> 	#define CALLSYS_NOERROR(name)                                   \
> 	        mov             r8 = SYSCALLNUM(name) ;                 \
> 	        movl            r14 = GATEWAY_PAGE ;;                   \
> 	        nop.m           0 ;                                     \
> 	        mov             b7 = r14 ;                              \
> 	        br.call.sptk    b6 = b7

> 3.  The "gateway" page as I call it will have the epc, the stackframe
>     setup and such, but other than that I can do anything I want in
>     user space.

Some questions from an ignorant  non-kernel guy.

Why don't you have a separate entry point for each system call rather
than having each call go to the generic GETAWAY_PAGE entry point?
This could allow you to do special optimizations.  Some system calls,
e.g., gettimeofday(), might even be run without even doing an epc.
Having separate entry points should also make it a whole lot easier
for the branch prediction unit to do the right thing.  On the other
hand, you would have to predefine the entry points in the syscall ABI,
and memory/cache footprint would probably increase a bit.

It would also be nice to have the getaway page mapped into the kernel
region.  This would allow the TLB entries for the getaway page to be
shared among all address spaces.

	eSk



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ia64" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15832.53014.422459.568935>