svn commit: r285540 - in head/sys/compat: cloudabi cloudabi64

Konstantin Belousov kostikbel at gmail.com
Tue Jul 14 16:07:05 UTC 2015


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.


More information about the svn-src-head mailing list