freebsd-dev/sys/dev
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
..
aac - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
acpi_support - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
acpica Further relax the strictness of enforcing allocations to only come from 2011-12-29 16:23:14 +00:00
adb Add support for special keys (volume/brightness/eject) on Apple laptops with 2011-10-16 21:01:42 +00:00
adlink Remove an unnecessary INTR_MPSAFE and a comment suggesting it was 2011-01-06 21:02:14 +00:00
advansys Fix typos - remove duplicate "the". 2011-02-21 09:01:34 +00:00
ae To send a frame, controller requires a prepended TX header and 2011-11-11 19:15:32 +00:00
age Close a race where SIOCGIFMEDIA ioctl get inconsistent link status. 2011-10-17 19:49:00 +00:00
agp Do a sweep of the tree replacing calls to pci_find_extcap() with calls to 2011-03-23 13:10:15 +00:00
aha
ahb
ahci Convert files to UTF-8 2012-01-15 13:23:18 +00:00
aic
aic7xxx Add "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no 2011-12-16 00:04:28 +00:00
alc Close a race where SIOCGIFMEDIA ioctl get inconsistent link status. 2011-10-17 19:49:00 +00:00
ale Close a race where SIOCGIFMEDIA ioctl get inconsistent link status. 2011-10-17 19:49:00 +00:00
amdsbwd amdsbwd: update to support SB8xx southbridges 2011-06-07 06:18:02 +00:00
amdtemp
amr - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
an ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
arcmsr - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than 2011-11-23 21:43:51 +00:00
asmc
asr Merge from r225950: 2011-10-13 20:06:19 +00:00
ata Convert files to UTF-8 2012-01-15 13:23:18 +00:00
ath Break out the "memory" EEPROM data read method from being AR9130 specific 2012-01-15 19:22:34 +00:00
atkbdc Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
auxio
bce Rework link state tracking and remove superfluous link UP/DOWN 2011-12-13 18:11:25 +00:00
bfe ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
bge Oops, fix logic error introduced in r230337. 2012-01-19 20:28:58 +00:00
bktr Remove a few bits of FreeBSD 2.x compatibility code. 2011-11-14 18:21:27 +00:00
bm ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
buslogic Remove some always-true comparisons. 2011-01-18 15:23:16 +00:00
bwi Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
bwn Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
bxe Remove spurious 8bit chars, turning files into plain ASCII. 2012-01-15 13:23:33 +00:00
cardbus Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
cas - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
ce Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c, 2011-12-29 17:46:24 +00:00
cesa - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
cfe kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
cfi Merge r221614,221696,221737,221840 from largeSMP project branch: 2011-05-22 20:55:54 +00:00
ciss Add support for HP P420 to ciss(4) 2012-01-18 19:35:16 +00:00
cm Replace inline static' by static inline'. 2011-12-13 14:06:01 +00:00
cmx
coretemp #PROCHOT assertion is sticky after reading the MSR (accordingly with 2011-09-19 10:58:30 +00:00
cp Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c, 2011-12-29 17:46:24 +00:00
cpuctl Add VIA microde update support to cpuctl(4) and cpucontrol(8). 2011-12-12 12:30:44 +00:00
cpufreq
cs Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
ct
ctau Fix typos - remove duplicate "the". 2011-02-21 09:01:34 +00:00
cx
cxgb Fix return value of function. 2011-12-23 01:39:10 +00:00
cxgbe Many updates to cxgbe(4) 2011-12-16 02:09:51 +00:00
cy
dc Use DEVMETHOD_END. 2011-11-23 20:27:26 +00:00
dcons kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
de Replace inline static' by static inline'. 2011-12-13 14:06:01 +00:00
digi
dpms
dpt
drm In sys/dev/drm/radeon_state.c, use the correct printf length modifiers 2011-12-30 02:07:50 +00:00
e1000 clear the pointer after freeing the mbuf. Without that, we 2012-01-12 17:30:44 +00:00
ed Fix off by one error in mbuf access. Previously it caused panic. 2011-12-05 18:10:43 +00:00
eisa - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
en Remove duplicate header includes 2011-06-28 08:36:48 +00:00
ep ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
esp s/timout/timeout 2011-12-15 06:29:13 +00:00
et style. No functional changes. 2012-01-10 20:52:02 +00:00
ex Convert files to UTF-8 2012-01-15 13:23:18 +00:00
exca
fatm Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need 2011-01-18 21:14:23 +00:00
fb Convert files to UTF-8 2012-01-15 13:23:43 +00:00
fdc Replace inline static' by static inline'. 2011-12-13 14:06:01 +00:00
fdt DEBUG is a kernel option. Don't define it here, as it breaks LINT. 2011-12-30 04:00:31 +00:00
fe
firewire ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
flash Add a couple more SPI flash device IDs found in commercial 2012-01-04 04:17:03 +00:00
fxp TCP header size is represented by number of 32bits words. 2011-12-19 19:00:34 +00:00
gem - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
glxiic Fix breakage on pc98 by redefining DEBUG(). 2011-05-15 19:04:08 +00:00
glxsb
gpio Fix broken locking that I introduced in the previous commit. 2011-12-20 03:25:11 +00:00
hatm
hifn - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
hme - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
hpt27xx Remove spurious 8bit chars, turning files into plain ASCII. 2012-01-15 13:23:33 +00:00
hptiop - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than 2011-11-23 21:43:51 +00:00
hptmv Remove spurious 8bit chars, turning files into plain ASCII. 2012-01-15 13:23:33 +00:00
hptrr - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than 2011-11-23 21:43:51 +00:00
hwpmc Clean up a switch statement for uncore events on Westmere processors. 2012-01-13 17:13:46 +00:00
ic
ichsmb - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
ichwd Remove use of explicit bus space tags and handles and use methods that 2012-01-05 16:27:32 +00:00
ida - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
ie ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
ieee488 Convert files to UTF-8 2012-01-15 13:23:43 +00:00
if_ndis ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
iicbus IIC bitbang changes - prepare to make the bit delay configurable; debug print changes. 2011-12-20 02:49:01 +00:00
iir Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
io
ipmi Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
ips
ipw Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
iscsi/initiator Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
isp Fix target mode compilation issues that arose after a change 2011-12-27 14:59:24 +00:00
ispfw Update firmware to more recent versions. 2011-01-05 23:15:22 +00:00
iwi Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
iwn Don't rely on MCS7 being at index 7 while determining the amount 2012-01-03 09:42:31 +00:00
ixgb ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
ixgbe netmap-related changes: 2012-01-19 09:36:19 +00:00
jme - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP 2011-05-03 19:51:29 +00:00
joy
kbd Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
kbdmux Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP. 2011-07-17 08:19:19 +00:00
ksyms Get rid of D_PSEUDO. 2011-10-18 08:09:44 +00:00
le Make sparc64 compatible with NEW_PCIB and enable it: 2011-10-02 23:22:38 +00:00
led MFgraid/head r218174: 2011-03-24 08:56:12 +00:00
lge ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
lindev
lmc In r191367 the need for if_free_type() was removed and a new member 2011-11-11 22:57:52 +00:00
malo Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
mc146818
mca - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
mcd
md Document a large number of currently undocumented sysctls. While here 2011-12-13 00:38:50 +00:00
mem Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set(). 2011-01-17 22:58:28 +00:00
mfi - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
mge Convert the PHY drivers to honor the mii_flags passed down and convert 2010-10-15 14:52:11 +00:00
mii - In mii_attach(9) just set the driver for a newly added miibus(4) instance 2011-12-05 21:38:45 +00:00
mk48txx Add support for MK48T37. 2011-05-15 13:17:08 +00:00
mlx - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
mly Add descriptor sense support to CAM, and honor sense residuals properly in 2011-10-03 20:32:55 +00:00
mmc Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
mn
mps Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see 2011-12-28 22:49:28 +00:00
mpt Increase the IOC port initialization timeouts by ten times to what the 2011-11-01 18:28:33 +00:00
mse
msk ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
mvs Rename device_delete_all_children() into device_delete_children(). 2011-11-22 21:56:55 +00:00
mwl Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
mxge Use strchr() and strrchr(). 2012-01-02 12:12:10 +00:00
my ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
ncv
netmap indentation and whitespace fixes 2012-01-13 11:58:06 +00:00
nfe ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
nge - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
nmdm Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
nsp
null Fix for PR 138526. 2012-01-11 15:00:16 +00:00
nve ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
nvram
nvram2env Import nvram2env, a device driver which imports various NVRAM-style 2011-04-03 11:55:48 +00:00
nxge Convert files to UTF-8 2012-01-15 13:23:43 +00:00
ofw kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
patm Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. 2011-01-19 00:57:58 +00:00
pbio
pccard Replace inline static' by static inline'. 2011-12-13 14:06:01 +00:00
pccbb - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
pcf
pci Properly return success once a matching VPD entry is found in 2012-01-19 21:38:19 +00:00
pcn - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
pdq
powermac_nvram Add support for the Sharp/Micron flash chips to powermac_mvram(4). 2010-09-05 20:04:02 +00:00
ppbus Rename device_delete_all_children() into device_delete_children(). 2011-11-22 21:56:55 +00:00
ppc Rename device_delete_all_children() into device_delete_children(). 2011-11-22 21:56:55 +00:00
pst Convert files to UTF-8 2012-01-15 13:23:18 +00:00
pty Fix whitespace inconsistencies in the TTY layer and its drivers owned by me. 2011-06-26 18:26:20 +00:00
puc - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
qlxgb ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
quicc - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
ral Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
random Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
rc
re Fix a logic error which resulted in putting PHY into sleep when WOL 2012-01-19 20:13:16 +00:00
rndtest Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
rp
rt ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
safe - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
sbni
scc - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
scd
sdhci Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
sec - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
sf - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
sfxge Update recently added drivers to use the if_*addr_r*lock() wrapper 2012-01-05 18:32:37 +00:00
sge - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
si
siba Rename device_delete_all_children() into device_delete_children(). 2011-11-22 21:56:55 +00:00
siis Rename device_delete_all_children() into device_delete_children(). 2011-11-22 21:56:55 +00:00
sio kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
sis ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
sk ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
smbus - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
smc - Import the common MII bitbang'ing code from NetBSD and convert drivers to 2011-11-01 16:13:59 +00:00
sn ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
snc ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
snp Second-to-last commit implementing Capsicum capabilities in the FreeBSD 2011-08-11 12:30:23 +00:00
sound Replace GPLd headers from the Maestro3 driver with BSD licensed 2012-01-20 22:37:10 +00:00
speaker Do not define bool/true/false if the symbols already exist. 2011-12-12 18:43:24 +00:00
spibus Replace inline static' by static inline'. 2011-12-13 14:06:01 +00:00
ste - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
stg
stge ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
streams Add the fo_chown and fo_chmod methods to struct fileops and use them 2011-08-16 20:07:47 +00:00
sym Merge from r225950: 2011-10-07 08:59:54 +00:00
syscons Convert files to UTF-8 2012-01-15 13:23:18 +00:00
tdfx Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
ti Eliminate vestiges of page coloring. 2011-12-15 05:07:16 +00:00
tl ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
tpm
trm
tsec ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
twa s/timout/timeout 2011-12-15 06:29:13 +00:00
twe - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
tws Match surrounding style. 2012-01-16 06:00:44 +00:00
tx - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP 2011-05-03 19:51:29 +00:00
txp Do a sweep of the tree replacing calls to pci_find_extcap() with calls to 2011-03-23 13:10:15 +00:00
uart Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card 2012-01-19 02:47:11 +00:00
ubsec - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
usb Add support for the DesignWare USB 2.0 OTG controller chipset. 2012-01-21 13:31:38 +00:00
utopia
vge - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
viawd Correctly spell my email address. 2011-12-22 15:13:32 +00:00
virtio Catch up with Bryan Venteicher's virtio Hg repo: 2011-12-06 06:28:32 +00:00
vkbd Get rid of D_PSEUDO. 2011-10-18 08:09:44 +00:00
vr Announce flow control capability to PHY drivers and enable flow 2011-11-28 19:03:59 +00:00
vte Remove unused variable mii. 2011-11-23 05:34:01 +00:00
vx ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
vxge Remove spurious 8bit chars, turning files into plain ASCII. 2012-01-15 13:23:54 +00:00
watchdog - Add the possibility to reuse the already last used timeout when patting 2011-04-27 16:43:03 +00:00
wb ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again 2012-01-07 09:41:57 +00:00
wds
wi Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
wl
wpi Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
wtap Introduce wtap, the beginnings of a net80211 wlan simulator. 2012-01-11 17:41:14 +00:00
xe Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
xen Make XENHVM work on i386. The __ffs() function counts bits starting from 2012-01-16 02:38:45 +00:00
xl Use DEVMETHOD_END. 2011-11-23 20:27:26 +00:00