freebsd-dev/sys/arm
Konstantin Belousov df08823d07 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
..
allwinner arm: allwinner: Set aw_ccu to BUS_PASS_BUS 2019-08-15 18:57:48 +00:00
altera/socfpga o Add support for multi-port instances of Synopsys DesignWare APB GPIO 2019-09-04 15:37:24 +00:00
amlogic/aml8726 Implement missing MMCBR ivars 2019-07-04 14:15:04 +00:00
annapurna/alpine arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
arm Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
broadcom/bcm2835 [rpi] Inherit framebuffer BPP value from the VideoCore firmware 2019-09-08 09:47:21 +00:00
cloudabi32 Remove sv_pagesize, originally introduced with r100384. 2019-03-01 16:16:38 +00:00
conf Include dwgpio to the build. 2019-09-04 15:55:44 +00:00
freescale Apply a runtime patch to the FDT data for imx6 to fix iomuxc problems. 2019-09-15 19:38:15 +00:00
include Centralize __pcpu definitions. 2019-08-29 07:25:27 +00:00
mv arm64: a37x0_gpio: Use syscon instead of MMIO region 2019-08-19 14:28:54 +00:00
nvidia Change synchonization rules for vm_page reference counting. 2019-09-09 21:32:42 +00:00
qemu arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
ralink Remove support for kernel.tramp and kernel.tramp.gz 2019-07-27 17:24:19 +00:00
rockchip Include eventhandler.h in more compilation units 2019-05-21 01:18:43 +00:00
samsung/exynos exynos5: avoid NULL deref in error case 2019-08-30 00:36:17 +00:00
ti Make the ti_sysc device quiet. It's an internal utility pseudo-device 2019-09-15 01:02:01 +00:00
versatile Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
xilinx arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00