freebsd-skq/sys
kib 361bfae5c2 Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs.  As a side-effect, it enables AVX on capable
CPUs.

In particular:

- Query the CPU support for XSAVE, list of the supported extensions
  and the required size of FPU save area. The hw.use_xsave tunable is
  provided for disabling XSAVE, and hw.xsave_mask may be used to
  select the enabled extensions.

- Remove the FPU save area from PCB and dynamically allocate the
  (run-time sized) user save area on the top of the kernel stack,
  right above the PCB. Reorganize the thread0 PCB initialization to
  postpone it after BSP is queried for save area size.

- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
  well. FPU state is only useful for suspend, where it is saved in
  dynamically allocated suspfpusave area.

- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
  enabled.

- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
  mcontext_t has a valid pointer to out-of-struct extended FPU
  state. Signal handlers are supplied with stack-allocated fpu
  state. The sigreturn(2) and setcontext(2) syscall honour the flag,
  allowing the signal handlers to inspect and manipilate extended
  state in the interrupted context.

- The getcontext(2) never returns extended state, since there is no
  place in the fixed-sized mcontext_t to place variable-sized save
  area. And, since mcontext_t is embedded into ucontext_t, makes it
  impossible to fix in a reasonable way.  Instead of extending
  getcontext(2) syscall, provide a sysarch(2) facility to query
  extended FPU state.

- Add ptrace(2) support for getting and setting extended state; while
  there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.

- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
  consumers, making it opaque. Internally, struct fpu_kern_ctx now
  contains a space for the extended state. Convert in-kernel consumers
  of fpu_kern KPI both on i386 and amd64.

First version of the support for AVX was submitted by Tim Bird
<tim.bird am sony com> on behalf of Sony. This version was written
from scratch.

Tested by:	pho (previous version), Yamagi Burmeister <lists yamagi org>
MFC after:	1 month
2012-01-21 17:45:27 +00:00
..
amd64 Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
arm Add parentheses where required. Without them, `sizeof LDBL_MAX' 2012-01-20 06:51:41 +00:00
boot Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT such that 2012-01-19 01:25:50 +00:00
bsm
cam Quiet some clang warnings when compiling CTL. 2012-01-19 18:42:03 +00:00
cddl By default turn off prefetch when listing snapshots. 2012-01-20 22:04:59 +00:00
compat Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
conf Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
contrib Allocate our mbuf with m_get2(). 2012-01-17 12:14:26 +00:00
crypto Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
ddb Use strchr() and strrchr(). 2012-01-02 12:12:10 +00:00
dev Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
fs Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
gdb kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
geom Allow an MBR primary or extended Linux swap partition to be specified 2012-01-13 18:32:56 +00:00
gnu Replace GPLd headers from the Maestro3 driver with BSD licensed 2012-01-20 22:37:10 +00:00
i386 Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
ia64 Add parentheses where required. Without them, `sizeof LDBL_MAX' 2012-01-20 06:51:41 +00:00
isa - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
kern Use separate buffer for global path to avoid overflow of path buffer. 2012-01-21 00:06:21 +00:00
kgssapi Add missing break statement to make sure all 3DES etypes really are treated 2011-10-10 09:13:07 +00:00
libkern Implement extensions on top of standards instead of the other way around. 2012-01-03 07:05:30 +00:00
mips We use port_index field of struct octusb_qh to reference USB state 2012-01-20 23:37:04 +00:00
modules Replace GPLd headers from the Maestro3 driver with BSD licensed 2012-01-20 22:37:10 +00:00
net - Fix trivial typo 2012-01-14 17:07:52 +00:00
net80211 Fix the hwmp code to handle nodes in a "line" topology. 2012-01-21 00:42:28 +00:00
netatalk Convert all users of IF_ADDR_LOCK to use new locking macros that specify 2012-01-05 19:00:36 +00:00
netgraph The newhook method can be called in ISR context at 2012-01-17 18:10:25 +00:00
netinet Remove a superfluous INET6 check (no opt_inet6.h included anyway). 2012-01-20 17:18:54 +00:00
netinet6 Small cleanup, no functional change. 2012-01-15 14:03:05 +00:00
netipsec Remove unused 'plen' variable. 2011-11-26 23:57:03 +00:00
netipx Convert all users of IF_ADDR_LOCK to use new locking macros that specify 2012-01-05 19:00:36 +00:00
netnatm
netncp Change ncp_scan_bindery_object() to pass a constant search string. 2011-10-16 08:44:03 +00:00
netsmb Add unicode support to msdosfs and smbfs; original pathes from imura, 2011-11-18 03:05:20 +00:00
nfs Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl() 2011-12-13 07:02:48 +00:00
nfsclient Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfsserver Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0, 2011-12-15 02:26:53 +00:00
nlm Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
ofed Remove spurious 8bit chars, turning files into plain ASCII. 2012-01-15 13:23:54 +00:00
opencrypto Add the fo_chown and fo_chmod methods to struct fileops and use them 2011-08-16 20:07:47 +00:00
pc98 Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
pci To save more power, switch to 10/100Mbps link when controller is 2011-11-23 23:29:18 +00:00
powerpc This commit adds profiling support for powerpc64. Now we can do application 2012-01-20 22:34:19 +00:00
rpc Both a crash reported on freebsd-current on Oct. 18 under the 2011-11-03 14:38:03 +00:00
security Use strchr() and strrchr(). 2012-01-02 12:12:10 +00:00
sparc64 Add the CAM Target Layer (CTL). 2012-01-12 00:34:33 +00:00
sys Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
teken Link the demo application against ncursesw to make Unicode work. 2011-10-13 14:20:27 +00:00
tools Restore the comment that I removed by accident. 2011-11-09 13:26:59 +00:00
ufs There are several bugs/hangs when trying to take a snapshot on a UFS/FFS 2012-01-17 01:14:56 +00:00
vm Revert r212360 now that PowerPC can handle large sparse arguments to 2012-01-17 00:31:09 +00:00
x86 Fix a few bugs in the SRAT parsing code: 2012-01-03 20:53:58 +00:00
xdr
xen s/timout/timeout 2011-12-15 06:29:13 +00:00
Makefile Improve the cscope target's handling of MD directories. Automatically 2012-01-03 17:31:27 +00:00