From owner-svn-src-all@freebsd.org Wed Aug 10 15:45:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C193BB5B31; Wed, 10 Aug 2016 15:45:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF8B1E38; Wed, 10 Aug 2016 15:45:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AFjPs3023638; Wed, 10 Aug 2016 15:45:25 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AFjPge023637; Wed, 10 Aug 2016 15:45:25 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608101545.u7AFjPge023637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 10 Aug 2016 15:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303923 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Wed, 10 Aug 2016 15:45:26 -0000 Author: ed Date: Wed Aug 10 15:45:25 2016 New Revision: 303923 URL: https://svnweb.freebsd.org/changeset/base/303923 Log: Make cpu_set_user_tls() work when called on the running thread. On all the other architectures, this function can also be called on the currently running thread. In this case, we shouldn't fix up the address in the PCB, but also patch up the register itself. Otherwise it will not become active and will simply become overwritten by the next switch. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7437 Modified: head/sys/arm64/arm64/vm_machdep.c Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed Aug 10 15:25:44 2016 (r303922) +++ head/sys/arm64/arm64/vm_machdep.c Wed Aug 10 15:45:25 2016 (r303923) @@ -201,6 +201,8 @@ cpu_set_user_tls(struct thread *td, void pcb = td->td_pcb; pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) + WRITE_SPECIALREG(tpidr_el0, tls_base); return (0); }