freebsd-dev/sys/conf
Konstantin Belousov 8c6f8f3d5b 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
..
defines
files Replace GPLd headers from the Maestro3 driver with BSD licensed 2012-01-20 22:37:10 +00:00
files.amd64 Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
files.arm Add libkern/ucmpdi2.c 2011-10-26 19:07:36 +00:00
files.i386 For sys/dev/ce/tau32-ddk.c, disable the following warning when building 2011-12-29 21:17:35 +00:00
files.ia64 Switch to the event timers infrastructure. This includes: 2011-06-25 02:15:14 +00:00
files.mips FDT support for MIPS. 2011-10-18 07:29:21 +00:00
files.pc98 Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to 2011-06-22 21:04:13 +00:00
files.powerpc Add support for special keys (volume/brightness/eject) on Apple laptops with 2011-10-16 21:01:42 +00:00
files.sparc64 For sparc64 also adjust the geometry of da(4) driven disks to not overflow 2011-11-27 15:43:40 +00:00
kern.mk Disable several instances instances of clang's -Wself-assign warning. 2011-12-30 13:16:59 +00:00
kern.post.mk - CTF knob is now implemented using common scheme: MK_CTF=yes/no is 2011-11-30 18:11:49 +00:00
kern.pre.mk Revert r230390. 2012-01-21 11:42:40 +00:00
kmod_syms.awk
kmod.mk Unbreak several mips kernel configs after r230150 and r230152 to make 2012-01-18 15:25:34 +00:00
ldscript.amd64 The new binutils has correctly redefined MAXPAGESIZE on amd64 as 0x200000 2011-03-28 06:35:17 +00:00
ldscript.arm
ldscript.i386 Step 2: sync sys/conf/ldscript.i386 with the binutils 2.17.50 version, 2010-11-05 19:40:27 +00:00
ldscript.ia64 Stop linking against a direct-mapped virtual address and instead 2011-04-30 20:49:00 +00:00
ldscript.mips Let the linker pick the right output format automatically 2010-11-13 18:38:35 +00:00
ldscript.mips.cfe Remove commented out _DYNAMIC sections. 2011-01-20 19:20:23 +00:00
ldscript.mips.mips64 Remove commented out _DYNAMIC sections. 2011-01-20 19:20:23 +00:00
ldscript.mips.octeon1 In fact, we don't need any of these __DYNAMIC. it is a.out leftover and commented out. 2011-01-20 19:24:50 +00:00
ldscript.powerpc In fact, we don't need any of these __DYNAMIC. it is a.out leftover and commented out. 2011-01-20 19:24:50 +00:00
ldscript.powerpc64 Add the .opd section, this is helps booting a profiled kernel. 2012-01-20 18:52:31 +00:00
ldscript.sparc64 Merge binutils 2.17.50 to head. This brings a number of improvements to 2011-02-18 20:54:12 +00:00
Makefile.amd64 Upgrade our copy of llvm/clang to r126079, from upstream's trunk. 2011-02-20 19:33:47 +00:00
Makefile.arm Add -ffreestanding to the command line, so taht inflate.c compiles and link 2011-06-15 19:15:50 +00:00
Makefile.i386 Upgrade our copy of llvm/clang to r126079, from upstream's trunk. 2011-02-20 19:33:47 +00:00
Makefile.ia64 Remove definition of the GCC3 variable. It was introduced in rev. 2007-06-02 21:30:39 +00:00
Makefile.mips FDT support for MIPS. 2011-10-18 07:29:21 +00:00
Makefile.pc98 Revert config(8) version bump. It brings major pain for people working on 2007-05-16 17:23:54 +00:00
Makefile.powerpc Add -Wa,-many to CFLAGS on PowerPC. This aids in building a kernel using 2011-06-09 19:47:30 +00:00
Makefile.sparc64 Revert config(8) version bump. It brings major pain for people working on 2007-05-16 17:23:54 +00:00
makeLINT.mk Add LINT-NOINET LINT-NOINET6 and LINT-NOIP to the make clean target. 2011-11-27 13:53:36 +00:00
makeLINT.sed Match the files directive and all the ways to add or subtract options 2011-10-04 17:11:38 +00:00
newvers.sh Remove a bit of debugging that accidentally crept in earlier. 2011-11-29 21:28:48 +00:00
NOTES Add the CAM Target Layer (CTL). 2012-01-12 00:34:33 +00:00
options Stop overloading opt_global.h. 2012-01-16 05:07:32 +00:00
options.amd64 Make NKPT a kernel option on amd64 so that it can be set to a non-default 2011-08-26 17:08:22 +00:00
options.arm Add options I missed in the additionnal AT91 support commits. 2010-10-07 09:30:35 +00:00
options.i386 Make "options XENHVM" compile for i386, not just amd64 -- a largely 2011-01-04 14:49:54 +00:00
options.ia64 Provide groundwork for 32-bit binary compatibility on non-x86 platforms, 2010-03-11 14:49:06 +00:00
options.mips MIPS changes for Netlogic XLP support. 2011-07-16 20:31:29 +00:00
options.pc98 Unbreak the build for pc98. Specify the newly introduced, for ia32, 2010-01-16 12:24:12 +00:00
options.powerpc Import support for the Sony Playstation 3 using the OtherOS feature 2011-01-06 04:12:29 +00:00
options.sparc64 Add a driver for the `Fire' JBus to PCIe bridges found in at least 2009-12-27 16:55:44 +00:00
systags.sh