Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2016 17:58:12 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r304172 - releng/11.0/sys/arm64/arm64
Message-ID:  <201608151758.u7FHwCMG065806@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Mon Aug 15 17:58:12 2016
New Revision: 304172
URL: https://svnweb.freebsd.org/changeset/base/304172

Log:
  MFC r303923:
  
    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
  Differential Revision: https://reviews.freebsd.org/D7437
  Approved by: re

Modified:
  releng/11.0/sys/arm64/arm64/vm_machdep.c
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/sys/arm64/arm64/vm_machdep.c
==============================================================================
--- releng/11.0/sys/arm64/arm64/vm_machdep.c	Mon Aug 15 17:55:56 2016	(r304171)
+++ releng/11.0/sys/arm64/arm64/vm_machdep.c	Mon Aug 15 17:58:12 2016	(r304172)
@@ -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);
 }



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