Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2015 19:06:59 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Ed Schouten <ed@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r285540 - in head/sys/compat: cloudabi cloudabi64
Message-ID:  <20150714160659.GY2404@kib.kiev.ua>
In-Reply-To: <201507141511.t6EFBoNg056572@repo.freebsd.org>
References:  <201507141511.t6EFBoNg056572@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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