mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
amd64: switch to amd64_set_tlsbase to set tls base
Reported and tested: Alex S <iwtcex@gmail.com> Tested by: pho Reviewed by: olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50482
This commit is contained in:
parent
2e7cf772a4
commit
aef025fc9b
2 changed files with 5 additions and 3 deletions
|
|
@ -543,10 +543,12 @@ allocate_initial_tls(Obj_Entry *objs)
|
|||
addr = allocate_tls(objs, 0, TLS_TCB_SIZE, TLS_TCB_ALIGN);
|
||||
|
||||
/*
|
||||
* This does not use _tcb_set() as it calls amd64_set_fsbase()
|
||||
* This does not use _tcb_set() as it calls amd64_set_tlsbase()
|
||||
* which is an ifunc and rtld must not use ifuncs.
|
||||
*/
|
||||
if (__getosreldate() >= P_OSREL_WRFSBASE &&
|
||||
if (__getosreldate() >= P_OSREL_TLSBASE)
|
||||
sysarch(AMD64_SET_TLSBASE, &addr);
|
||||
else if (__getosreldate() >= P_OSREL_WRFSBASE &&
|
||||
(cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0)
|
||||
wrfsbase((uintptr_t)addr);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static __inline void
|
|||
_tcb_set(struct tcb *tcb)
|
||||
{
|
||||
#ifdef __amd64__
|
||||
amd64_set_fsbase(tcb);
|
||||
amd64_set_tlsbase(tcb);
|
||||
#else
|
||||
i386_set_gsbase(tcb);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue