freebsd-dev/sys
Konstantin Belousov 333d0c6060 Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage
mostly meets the guidelines set by the Intel SDM:
1. We use XRSTOR and XSAVE from the same CPL using the same linear
   address for the store area
2. Contrary to the recommendations, we cannot zero the FPU save area
   for a new thread, since fork semantic requires the copy of the
   previous state. This advice seemingly contradicts to the advice
   from the item 6.
3. We do use XSAVEOPT in the context switch code only, and the area
   for XSAVEOPT already always contains the data saved by XSAVE.
4. We do not modify the save area between XRSTOR, when the area is
   loaded into FPU context, and XSAVE. We always spit the fpu context
   into save area and start emulation when directly writing into FPU
   context.
5. We do not use segmented addressing to access save area, or rather,
   always address it using %ds basing.
6. XSAVEOPT can be only executed in the area which was previously
   loaded with XRSTOR, since context switch code checks for FPU use by
   outgoing thread before saving, and thread which stopped emulation
   forcibly get context loaded with XRSTOR.
7. The PCB cannot be paged out while FPU emulation is turned off, since
   stack of the executing thread is never swapped out.

The context switch code is patched to issue XSAVEOPT instead of XSAVE
if supported. This approach eliminates one conditional in the context
switch code, which would be needed otherwise.

For user-visible machine context to have proper data, fpugetregs()
checks for unsaved extension blocks and manually copies pristine FPU
state into them, according to the description provided by CPUID leaf
0xd.

MFC after:  1 month
2012-07-14 15:48:30 +00:00
..
amd64 Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage 2012-07-14 15:48:30 +00:00
arm Add preliminary support for Atmel SAM9260-EK evaluation kit. 2012-07-14 06:13:23 +00:00
boot Fix domain. 2012-07-14 01:45:35 +00:00
bsm
cam The call to disk_resize causes a panic if DIAGNOSTIC is set. 2012-07-14 02:59:11 +00:00
cddl r237748 continuation: fix nopw (0f 1f) behavior with respect to modifiers 2012-07-06 14:45:30 +00:00
compat Extend the KPI to lock and unlock f_offset member of struct file. It 2012-07-02 21:01:03 +00:00
conf Merge ACPICA 20120711. 2012-07-11 23:18:35 +00:00
contrib Merge ACPICA 20120711. 2012-07-11 23:18:35 +00:00
crypto
ddb Update the ddb and gdb backends for the new 'trace_thread' hook. 2012-04-12 21:34:58 +00:00
dev Fix build breakage when one isn't building with IEEE80211_SUPPORT_SUPERG. 2012-07-14 12:15:20 +00:00
fs Remove a check on MNTK_UPDATE that is not really necessary as it is 2012-07-10 00:23:25 +00:00
gdb Update the ddb and gdb backends for the new 'trace_thread' hook. 2012-04-12 21:34:58 +00:00
geom Add trivial resize handling to gnop(8). 2012-07-07 22:22:13 +00:00
gnu/fs Fix build: 2012-05-23 06:49:50 +00:00
i386 Add a clts() wrapper around the 'clts' instruction to <machine/cpufunc.h> 2012-07-09 20:55:39 +00:00
ia64 Move PCPU initialization to a new function called cpu_pcpu_setup(). 2012-07-08 18:00:22 +00:00
isa
kern Make the interval timings for EVFILT_TIMER more accurate. tvtohz() always 2012-07-13 13:24:33 +00:00
kgssapi
libkern Fix unloading of libiconv module. 2012-06-11 17:42:39 +00:00
mips Support Netlogic XLP 8xx B1 revisions in xlpge. 2012-07-09 10:39:57 +00:00
modules Merge ACPICA 20120711. 2012-07-11 23:18:35 +00:00
net Simplify error case 2012-07-10 20:59:35 +00:00
net80211 Add a check for dynamic OFDM/CCK channel types. 2012-07-01 04:25:49 +00:00
netatalk
netgraph Make radix lookup on src and dst flow addresses optional 2012-06-18 13:56:36 +00:00
netinet Fix a bug introduced in r237715. 2012-07-09 10:59:39 +00:00
netinet6 Remove "prefer_source" address selection option. FreeBSD has had an 2012-07-09 06:21:46 +00:00
netipsec
netipx
netnatm
netncp Add characters mapping for codepages used in Germany. 2012-06-01 03:59:08 +00:00
netsmb Change a duplicated check to clarify that we really want to set a 2012-07-10 21:02:59 +00:00
nfs
nfsclient PR# 165923 reported intermittent write failures for dirty 2012-05-12 12:02:51 +00:00
nfsserver
nlm
ofed Fix clang warning when compiling iw_cxgb. 2012-06-25 16:52:27 +00:00
opencrypto
pc98 Partially revert r217515 so that the mem_range_softc variable is always 2012-07-09 20:42:08 +00:00
pci intpm: add ATI IXP400 pci id 2012-04-16 10:33:46 +00:00
powerpc Avoid recursion on the pvh global lock in the aim oea pmap. 2012-07-10 22:10:21 +00:00
rpc
security Check vplabel for NULL before dereferencing it. Fixes a panic 2012-05-03 15:51:34 +00:00
sparc64 Switch back to the 4BSD scheduler for now. There is some more or less 2012-06-30 14:55:36 +00:00
sys Merge OpenSSL 1.0.1c. 2012-07-12 19:30:53 +00:00
teken
tools
ufs Extend the KPI to lock and unlock f_offset member of struct file. It 2012-07-02 21:01:03 +00:00
vm Document the object type movements, related to swp_pager_copy(), 2012-07-11 01:04:59 +00:00
x86 Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage 2012-07-14 15:48:30 +00:00
xdr
xen blkif interface comment cleanups. No functional changes 2012-02-29 17:47:01 +00:00
Makefile Add sys/ofed to the 'make cscope' target. 2012-03-20 18:05:15 +00:00