freebsd-skq/sys
kib 957270782d Improve MD page fault handlers.
Centralize calculation of signal and ucode delivered on unhandled page
fault in new function vm_fault_trap().  MD trap_pfault() now almost
always uses the signal numbers and error codes calculated in
consistent MI way.

This introduces the protection fault compatibility sysctls to all
non-x86 architectures which did not have that bug, but apparently they
were already much more wrong in selecting delivered signals on
protection violations.

Change the delivered signal for accesses to mapped area after the
backing object was truncated.  According to POSIX description for
mmap(2):
   The system shall always zero-fill any partial page at the end of an
   object. Further, the system shall never write out any modified
   portions of the last page of an object which are beyond its
   end. References within the address range starting at pa and
   continuing for len bytes to whole pages following the end of an
   object shall result in delivery of a SIGBUS signal.

   An implementation may generate SIGBUS signals when a reference
   would cause an error in the mapped object, such as out-of-space
   condition.
Adjust according to the description, keeping the existing
compatibility code for SIGSEGV/SIGBUS on protection failures.

For situations where kernel cannot handle page fault due to resource
limit enforcement, SIGBUS with a new error code BUS_OBJERR is
delivered.  Also, provide a new error code SEGV_PKUERR for SIGSEGV on
amd64 due to protection key access violation.

vm_fault_hold() is renamed to vm_fault().  Fixed some nits in
trap_pfault()s like mis-interpreting Mach errors as errnos.  Removed
unneeded truncations of the fault addresses reported by hardware.

PR:	211924
Reviewed by:	alc
Discussed with:	jilles, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21566
2019-09-27 18:43:36 +00:00
..
amd64 Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
arm Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
arm64 Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
bsm
cam Add kern.cam.da.X.quirks tunable, similar existing for ada. 2019-09-26 14:48:39 +00:00
cddl Implement x86 dtrace_invop_(un)init() in C. 2019-09-23 15:08:17 +00:00
compat sysent: regenerate after r352747. 2019-09-26 15:41:10 +00:00
conf Move EPOCH_TRACE to opt_global.h, so that any external modules that 2019-09-26 21:12:47 +00:00
contrib ipf mistakenly regards UDP packets with a checksum of 0xffff as bad. 2019-09-26 03:09:42 +00:00
crypto Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
ddb ddb(4): Add some support for lexing IPv6 addresses 2019-09-09 16:32:23 +00:00
dev nvdimm(4): Extract ACPI root bus driver 2019-09-27 16:32:44 +00:00
dts dtso: allwinner: Add an overlay for H3 thermal node 2019-08-24 13:26:34 +00:00
fs Replace all mtx_assert() calls for n_mtx and ncl_iod_mutex with macros. 2019-09-26 02:54:45 +00:00
gdb gdb(4): Root a sysctl tree at 'debug.gdb.' 2019-09-08 22:52:47 +00:00
geom Add a "count_until_fail" option to gnop, which says to start failing 2019-09-13 23:03:56 +00:00
gnu arm: dts: am33xx: Fix the region for uart0 2019-08-07 13:11:53 +00:00
i386 Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
isa
kern Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
kgssapi Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
libkern Remove zlib 1.0.4 from kernel. 2019-08-25 17:13:00 +00:00
mips Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
modules nvdimm(4): Extract ACPI root bus driver 2019-09-27 16:32:44 +00:00
net style(9): remove extraneous empty lines 2019-09-25 20:46:09 +00:00
net80211 Enhance the comment ieee80211_add_channel() to avoid a 2019-06-10 14:31:18 +00:00
netgraph avoid holding PCB mutex during copyin/copyout() 2019-08-30 16:35:31 +00:00
netinet Add new functionality to switch to using cookies exclusively when we the 2019-09-26 15:18:57 +00:00
netinet6 When processing an incoming IPv6 packet over the loopback interface which 2019-09-19 10:22:29 +00:00
netipsec Fix broken window replay check that will allow old packet to be accepted. 2019-09-06 14:30:23 +00:00
netpfil Drivers may pass runt packets to filter. This is okay. 2019-09-13 22:36:04 +00:00
netsmb Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
nfs
nfsclient
nfsserver
nlm
ofed OFED: Fix accidental double-copy of rdma_sdp.h in r351176 2019-08-18 04:19:41 +00:00
opencrypto Adjust the deprecated warnings for /dev/crypto to be less noisy. 2019-08-27 21:29:37 +00:00
powerpc Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
riscv Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
rpc Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
security vm_map_simplify_entry considers merging an entry with its two 2019-08-25 07:06:51 +00:00
sparc64 Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
sys Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
teken Adjust teken to allow build as part of loader 2019-09-05 18:07:40 +00:00
tests
tools fw_stub.awk: use @generated tag in generated files 2019-09-11 13:35:22 +00:00
ufs vfs: convert struct mount counters to per-cpu 2019-09-16 21:37:47 +00:00
vm Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
x86 Complete the removal of the "wire_count" field from struct vm_page. 2019-09-25 16:11:35 +00:00
xdr
xen
Makefile