freebsd-dev/sys/amd64
Konstantin Belousov 617a11eab6 x86: initialize use_xsave once
The explanation from https://reviews.freebsd.org/D39637 by stevek:
The "use_xsave" variable is a global and that is only supposed to be
initialized early before scheduling gets started. However, with the way
the ifuncs for "fpusave" and "fpurestore" are implemented, the value
could be changed at runtime when scheduling is active if "use_xsave"
was set to 0 by the tunable. This leaves a window of opportunity where
"use_xsave" gets re-initialized to 1 and a context switch could occur
with a thread that was not set up to be able to use xsave functionality.
This can lead to an "privileged instruction fault".

The fix is to protect "use_xsave" from being initialized more than once.

Reported and reviewed by:	stevek
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39660
2023-04-19 02:22:28 +03:00
..
acpica amd64 wakeup: recalculate mitigations after APICs are woken 2023-03-29 21:45:20 +03:00
amd64 x86: initialize use_xsave once 2023-04-19 02:22:28 +03:00
conf xen/efi: make Xen PV EFI clock optional 2023-04-14 15:58:47 +02:00
ia32 amd64 ia32 vdso: always define some __vdso_ symbols 2023-02-09 04:36:40 +02:00
include amd64: fix PKRU and swapout interaction 2023-04-15 02:53:59 +03:00
linux linux(4): Regen for close_range syscall 2023-04-04 23:23:37 +03:00
linux32 linux(4): Regen for close_range syscall 2023-04-04 23:23:37 +03:00
pci
sgx sgx: Remove unused variable. 2022-04-07 17:01:28 -07:00
vmm bhyve: Remove vmctx member from struct vm_snapshot_meta. 2023-03-24 11:49:06 -07:00
Makefile Bring the tags and links entries for amd64 up to date. 2021-09-27 20:04:51 -07:00