On Tue, Jul 14, 2015 at 03:11:50PM +0000, Ed Schouten wrote:
> Author: ed
> Date: Tue Jul 14 15:11:50 2015
> New Revision: 285540
> URL: https://svnweb.freebsd.org/changeset/base/285540
> 
> Log:
>   Implement thread_tcb_set() and thread_yield().
>   
>   The first system call is used to set the user TLS address. Right now
>   this system call is invoked by the C library for both the initial thread
>   and additional threads unconditionally, but in the future we'll only
>   call this if the architecture does not support this. On recent x86-64
>   CPUs we could use the WRFSBASE instruction.

You cannot use WRFSBASE, kernel does not support this. On the
next return from the syscall, or on the next context switch,
the bases are overwritten with the values supplied by the
sysarch({AMD64,I386}_SET_{F,G}SBASE).

I enabled the CR4 bit to make the read instruction accessible to
usermode, but write base requires additional code. Since it would lead
to at least one more branch in the doreti path, I did not implemented
this.
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to