svn commit: r337127 - head/sys/riscv/riscv

John Baldwin jhb at FreeBSD.org
Thu Aug 2 15:17:02 UTC 2018


On 8/2/18 5:13 AM, Ruslan Bukin wrote:
> Author: br
> Date: Thu Aug  2 12:13:52 2018
> New Revision: 337127
> URL: https://svnweb.freebsd.org/changeset/base/337127
> 
> Log:
>   Don't overwrite tp in set_mcontext().
>   
>   This makes libthr/swapcontext_test:swapcontext1 happy.
>   
>   Sponsored by:	DARPA, AFRL

This seems a bit odd.  Is get_mcontext() not setting gp_tp correctly, or is
makecontext() not preserving it perhaps?

In general I feel like we should be saving/restoring 'tp' in the trapframe
on kernel entry/exit like other GPRs instead of in the pcb and then
including it in 'struct reg'.  This makes it possible for debuggers to
handle TLS variables more sanely (and in general we need to fix the various
struct reg in FreeBSD architectures to include TLS registers when possible,
such as adding fs_base and gs_base on x86).  It would be nice if RISC-V
started off on the correct foot here.

-- 
John Baldwin


More information about the svn-src-all mailing list