summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-06-05Switch from lazy FPU switching to semi-eager FPU switching: track whetherPhilip Guenther
curproc's xstate ("extended state") is loaded in the CPU or not. - context switch, sendsig(), vmm, and doing CPU crypto in the kernel all check the flag and, if set, save the old thread's state to the PCB, clear the flag, and then load the _blank_ state - when returning to userspace, if the flag is clear then set it and restore the thread's state This simpler tracking also fixes the restoring of FPU state after nested signal handlers. With this, %cr0's TS flag is never set, the FPU #DNA trap can no longer happen, and IPIs are no longer necessary for flushing or syncing FPU state; on the other hand, restoring xstate while returning to userspace means we have to handle xrstor faulting if we could be loading an altered state. If that happens, reset the state, fake a #GP fault (SIGBUS), and recheck for ASTs. While here, regularize fxsave/fxrstor vs xsave/xrstor handling, by using codepatching to switch to xsave/xrstor when present in the CPU. In addition, code patch in use of xsaveopt in most places when the CPU supports that. Use the 64bit-wide variants of the instructions in all cases so that x87 instruction fault IPs are reported correctly. This change has three motivations: 1) with modern clang, SSE registers are used even in rcrt0.o, making lazy FPU switching a smaller benefit vs trap costs 2) the Intel SDM warns that lazy FPU switching may increase power costs 3) post-Spectre rumors suggest that the %cr0 TS flag might not block speculation, permitting leaking of information about FPU state (AES keys?) across protection boundaries. tested by many in snaps; prodding from deraadt@
2018-06-05Turn all instances of Fn into proper cross references. While here, removeanton
redundant references to termios and favor Po/Pc for parenthesis enclosing. ok jmc@ schwarze@
2018-06-05document "match tag"; ok gillesJason McIntyre
2018-06-05Split "return to userspace via iretq" from intr_fast_exit into intr_user_exit.Philip Guenther
Move AST handling from the bottom of alltraps and Xdoreti to the top of the new routine. syscall-return-via-iretq and the FPU #DNA trap jump into intr_user_exit after the AST check (already performed for the former, skipped for the latter) Delete a couple debugging hooks mlarkin@ and I used during Meltdown work tested by many in snaps; thanks to brynet@ for spurious interrrupt testing earlier reviews and comments kettenis@ mlarkin@; prodding from deraadt@
2018-06-04Remove the cpu_reset_needs_v4_MMU_disable flag; it's always true for hardwareMark Kettenis
that OpenBSD runs on. ok patrick@
2018-06-04Use process-private futexes. This avoids the overhead of calling into uvmMark Kettenis
to look up the mapping for the futex address. ok visa@, mpi@
2018-06-04honor SIZE extension when advertised by peerGilles Chehade
ok millert@
2018-06-04for "match", document that envelopes that do not match anything are rejected,Jason McIntyre
and that rules are evaluated sequentially, first match wins; ok gilles
2018-06-04remove "from local" (the default) from one of the match rules: the lineJason McIntyre
immediately above also uses this notation, it's shorter, and it keeps two examples in the man page which claim to be the same as the default config (but with exceptions) in sync; ok gilles
2018-06-04Sync VFS documentation with realitykn
Missed during the "Namecache revamp" in 2009. Reported by Georg Bege <georg at bege dot email>, thanks. OK visa jmc mpi jca
2018-06-04Allow specifying binary via ROUTEkn
OK bluhm jca
2018-06-04Zap unused mifi_t.kn
OK bluhm mpi jca
2018-06-04Zap unused sockaddr.kn
OK bluhm deraadt jca
2018-06-04drop BUMPTIMEcheloha
unused since v1.76, ca 5.3 ok kettenis@ deraadt@
2018-06-04Fix file descriptor leak.Gerhard Roth
Patch submitted by Nan Xiao, ok tb@ sthen@ millert@ deraadt@ jca@
2018-06-04tweak previous;Jason McIntyre
2018-06-04add support for mda wrappers allowing postmaster to define command wrappersGilles Chehade
that will be executed (with recipient privileges) before calling the users' mail delivery agent ok eric@
2018-06-04in non-DIAGNOSTIC kernels, rw_assert_wrlock becomes a nop which leaves theTheo de Raadt
local variable dangling, so calculate the lock address by hand at invocation ok kettenis
2018-06-044-bit bus width is mandatory for SDIO cards that support High SpeedPatrick Wildt
mode, so switch from 1-bit to 4-bit bus width if the host controller supports it. ok kettenis@
2018-06-04Remove the extra pager code when compiled without the BACKWARDS flag.Martijn van Duren
Most terminals have scrollback options, or can be achieved via tmux, so it's not needed. OK millert@
2018-06-04Definitively choose the existing semantics for the scroll and null command.Martijn van Duren
POSIX states: "An empty command list shall be equivalent to the p command", so changing the behaviour of a null-command in any other case is a violation of POSIX. OK millert@
2018-06-04The function pf_create_state() calls pf_set_protostate() beforeAlexander Bluhm
pf_state_insert(), so the state key has not been set. When inlining, the compiler recognized the NULL pointer dereference in s->key[PF_SK_STACK]->proto and optimized it away. But if pf.c was compiled with -fno-inline, the system crashed during boot. Add a NULL check in pf_set_protostate() to handle the situation when the function is called. OK sashan@ henning@
2018-06-04tweak the text of the relaying example: make it clear that the exampleJason McIntyre
allows delivery as well as relaying (for authenticated users), and that passing to an external mda is possible, but not required; ok gilles
2018-06-04Cleanup IPsec output error handling with consistent goto drop.Alexander Bluhm
from markus@; OK mpi@
2018-06-04"match auth" matches transactions that *have been* authenticated;Jason McIntyre
ok gilles
2018-06-04Switch to SDIO High Speed mode if the host controller supports it.Patrick Wildt
ok kettenis@
2018-06-04imxesdhc(4) also supports High Speed mode for SD.Patrick Wildt
ok kettenis@
2018-06-04Remove unused/commented out includes.Mark Kettenis
2018-06-04Remove unused include.Mark Kettenis
2018-06-04Remove unused include.Mark Kettenis
2018-06-04Nuke unused variable.Kevin Lo
ok deraadt@
2018-06-04Add VB_DUPOK to suppress witness(4) warning of concurrent mount locks.Philip Guenther
Use that in three places: - vfs_stall() - sys_mount() - dounmount()'s MNT_FORCE-does-recursive-unmounts case ok deraadt@ visa@
2018-06-04...and correct the count at which warning normally occursPhilip Guenther
2018-06-04Xr witness 4Philip Guenther
2018-06-04Add RW_DUPOK for suppressing witness checks for specific rw_enter() callsPhilip Guenther
ok deraadt@ visa@
2018-06-03Use variable names for rtable and rdomain consistently in the in_pcbAlexander Bluhm
functions. discussed with and OK mpi@ visa@
2018-06-03Add ret protctor options as no-ops.mortimer
2018-06-03Rename the incpb table field inpt_hash to inpt_mask as it containsAlexander Bluhm
the hashmask. For the resize calculations it is clearer to use the field inpt_size. OK visa@ mpi@
2018-06-03Fix previous by restoring inadvertantly deleted check forKenneth R Westerback
get_recorded_lease() returning NULL. Should fix segmentation fault reported by Klemens Nanni on bugs@.
2018-06-03Consistently call the inpcb table parameter "table" in in6_pcbnotify().Alexander Bluhm
OK visa@ mpi@
2018-06-03Remove #ifdef __XSCALE__ bits. No binary change.Mark Kettenis
ok deraadt@
2018-06-03SIOCSIFNETMASK takes a 'struct ifreq', so use 'ifr' for it and drop theTheo Buehler
now unused 'ifra' from in_ioctl(). Discussed with mpi and visa
2018-06-03on i386, libm does sysctl to discover is the system has SSE. WhitelistTheo de Raadt
that sysctl in pledge. Discovered by Stuart Cassoff
2018-06-03Change the set_parent() interface to pass the full parent specificationMark Kettenis
(including the phandle). ok patrick@
2018-06-03Better version of the refactoring attempted in r1.154. Move SIOCSIFADDRTheo Buehler
to its own function and merge the two switches in in_ioctl_change_ifaddr(). Finally: each ioctl has its own case and privilege check. ok visa As an aside, an audit of the ports tree has shown that we should continue to support the legacy ioctls SIOCSIF{,BRD,DST}ADDR, SIOCSIFNETMASK despite the fact that they have been deprecated for the better part of two decades and FreeBSD dropped support 7 years ago. Too many ports still rely on them. Thanks to sthen and visa for their help with that.
2018-06-03Make DMA work on Samsung Exynos. The crucial bit that makes it work isMark Kettenis
setting the FIFO thresholds apropriately. The code now also makes an attempt to recover from failed DMA transfers.
2018-06-03On amd64, arm64, armv7, i386 and sparc64 /usr/bin/{cc,c++,clang++,clang-cpp}Robert Peichaer
and /usr/libexec/cpp are supposed to be hardlinks of /usr/bin/clang. The move of /usr/bin/cc to the base set to allow kernel relinking resulted in it being a copy and not a hardlink. Move the other files to the base set too to ensure all are hardlinks. Noticed by Anthony Coulter OK deraadt
2018-06-03Allocate a dedicated buffer for use when deriving a shared key duringJoel Sing
client KEX DHE processing, rather than reusing the buffer that is used to send/receive handshake messages. ok beck@ inoguchi@
2018-06-03Check the return value from DH_size() in ssl3_send_client_kex_dhe().Joel Sing
ok beck@ inoguchi@
2018-06-03Implement process-shared futexes. These are now the default implementation.Mark Kettenis
Introduce process-private futexs. These will bypass the uvm mapping lookup and should be slightly more efficient. ok visa@, mpi@