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); } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"