Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 08:16:59 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Ruslan Bukin <br@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r337127 - head/sys/riscv/riscv
Message-ID:  <7842b7e4-d14e-805f-719e-b393fc80b74c@FreeBSD.org>
In-Reply-To: <201808021213.w72CDqQV065424@repo.freebsd.org>
References:  <201808021213.w72CDqQV065424@repo.freebsd.org>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7842b7e4-d14e-805f-719e-b393fc80b74c>