From owner-svn-src-all@freebsd.org Thu Aug 2 15:17:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 172C41069FD4; Thu, 2 Aug 2018 15:17:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B33478CB25; Thu, 2 Aug 2018 15:17:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1476310A87D; Thu, 2 Aug 2018 11:16:59 -0400 (EDT) Subject: Re: svn commit: r337127 - head/sys/riscv/riscv To: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808021213.w72CDqQV065424@repo.freebsd.org> From: John Baldwin Message-ID: <7842b7e4-d14e-805f-719e-b393fc80b74c@FreeBSD.org> Date: Thu, 2 Aug 2018 08:16:59 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201808021213.w72CDqQV065424@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 02 Aug 2018 11:17:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 15:17:02 -0000 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