freebsd-dev/sys/amd64
Mark Johnston 4b136ef259 amd64: Set GS.base before calling init_secondary() on APs
KMSAN instrumentation requires thread-local storage to track
initialization state for function parameters and return values.  This
buffer is accessed as part of each function prologue.  It is provided by
the KMSAN runtime, which looks up a pointer in the current thread's
structure.

When KMSAN is configured, init_secondary() is instrumented, but this
means that GS.base must be initialized first, otherwise the runtime
cannot safely access curthread.  Work around this by loading GS.base
before calling init_secondary(), so that the runtime can at least check
curthread == NULL and return a pointer to some dummy storage.  Note that
init_secondary() still must reload GS.base after calling lgdt(), which
loads a selector into %gs, which in turn clears the base register.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31336
2021-07-29 10:22:37 -04:00
..
acpica acpi: Fix a repeated comment typo 2021-07-19 17:19:23 +01:00
amd64 amd64: Set GS.base before calling init_secondary() on APs 2021-07-29 10:22:37 -04:00
cloudabi32 Pass the syscall number to capsicum permission-denied signals 2021-07-16 18:06:44 +01:00
cloudabi64 Pass the syscall number to capsicum permission-denied signals 2021-07-16 18:06:44 +01:00
conf xen/timer: make xen timer optional 2021-07-28 17:27:03 +02:00
ia32 Pass the syscall number to capsicum permission-denied signals 2021-07-16 18:06:44 +01:00
include amd64: rework AP startup 2021-07-27 20:11:15 +03:00
linux linux(4): Fix gcc buld. 2021-07-29 09:52:33 +03:00
linux32 linux(4): Fix gcc buld. 2021-07-29 09:52:33 +03:00
pci
sgx Convert remaining cap_rights_init users to cap_rights_init_one 2021-01-12 13:16:10 +00:00
vmm vmm: Fix AMD-vi using wrong rid range 2021-07-14 01:53:10 +08:00
Makefile