freebsd-dev/sys/arm/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
..
autoconf.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
bcopy_page.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
bcopyinout_xscale.S Revert r336773: it removed too much. 2018-07-27 21:25:01 +00:00
bcopyinout.S Revert r336773: it removed too much. 2018-07-27 21:25:01 +00:00
blockio.S
bus_space_asm_generic.S Remove arm's cpuconf.h, and references to it, after moving a few lines from 2017-01-16 16:44:13 +00:00
bus_space_base.c Include machine/acle-compat.h in cdefs.h on arm if the compiler doesn't 2016-05-25 19:44:26 +00:00
bus_space_generic.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
busdma_machdep-v4.c Move phys_avail definition into MI code. It is consumed in the MI layer and 2019-08-16 00:45:14 +00:00
busdma_machdep-v6.c Move phys_avail definition into MI code. It is consumed in the MI layer and 2019-08-16 00:45:14 +00:00
copystr.S Remove unused implementations of copyoutstr(). 2018-04-17 17:20:04 +00:00
cpu_asm-v6.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
cpufunc_asm_arm9.S Remove old CPU_ values from the arm cpufunc code. These have been removed. 2018-07-28 12:00:32 +00:00
cpufunc_asm_arm11x6.S Remove arm11x6_setttb and armv7_setttb as they are unused. While here 2016-10-25 16:25:06 +00:00
cpufunc_asm_armv4.S Fix the spelling of armv4_idcache_inv_all in an END macro. 2018-08-14 15:42:27 +00:00
cpufunc_asm_armv5_ec.S Only build the cache handling code we need when building the arm ELF 2018-07-28 12:50:09 +00:00
cpufunc_asm_armv7.S Remove the dead code from ARM cpufunc_* files. 2018-07-18 10:33:07 +00:00
cpufunc_asm_pj4b.S
cpufunc_asm_sheeva.S Only build the cache handling code we need when building the arm ELF 2018-07-28 12:50:09 +00:00
cpufunc_asm.S Remove an old comment now the code it references has been removed. 2018-08-14 15:48:13 +00:00
cpufunc.c Use the cp15 functions to read cp15 registers rather than using assembly 2018-07-28 17:21:34 +00:00
cpuinfo.c Implement mitigation for Spectre version 2 attacks on ARMv7. 2018-01-27 11:19:41 +00:00
db_disasm.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
db_interface.c
db_trace.c Add the missing void to function signatures in much of the arm code. 2016-12-13 13:43:22 +00:00
debug_monitor.c [qemu] Fix VERSATILEPB kernel boot in QEMU broken by r300968 2016-12-29 21:55:23 +00:00
disassem.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
dump_machdep.c Revert r336773: it removed too much. 2018-07-27 21:25:01 +00:00
elf_machdep.c Remove sv_pagesize, originally introduced with r100384. 2019-03-01 16:16:38 +00:00
elf_note.S
exception.S Revert r336773: it removed too much. 2018-07-27 21:25:01 +00:00
fiq_subr.S Include machine/armreg.h after machine/asm.h to ensure __ARM_ARCH is 2016-11-07 11:01:09 +00:00
fiq.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
fusu.S Provide protection against starvation of the ll/sc loops when accessing userpace. 2019-07-12 18:43:24 +00:00
gdb_machdep.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
genassym.c Implement mitigation for Spectre version 2 attacks on ARMv7. 2018-01-27 11:19:41 +00:00
generic_timer.c Only set up the interrupts that will actually be used in arm generic_timer. 2019-04-17 15:27:11 +00:00
gic_acpi.c Add missing ACPI GICv2 MSI/MSI-X attachment 2019-06-28 01:17:33 +00:00
gic_common.h Move common GIC interrupt numbers to the common header. These are the same 2018-06-19 16:14:23 +00:00
gic_fdt.c Remove teh non-INTRNG code from the ARM GIC interrupt controller driver. 2018-07-30 10:55:02 +00:00
gic.c Remove the check that the Arm generic interrupt controller variant is 2018-09-06 17:25:01 +00:00
gic.h Remove teh non-INTRNG code from the ARM GIC interrupt controller driver. 2018-07-30 10:55:02 +00:00
hypervisor-stub.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
identcpu-v4.c Remove cpu_pfr from arm. It's unused. 2018-08-14 16:01:25 +00:00
identcpu-v6.c Add a hw.model sysctl oid for armv6/7 which reports the CPU model, similar 2018-02-26 23:58:56 +00:00
in_cksum_arm.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
in_cksum.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
intr.c follow-up to r336635, update TAILQ to CK_SLIST for ie_handlers 2018-07-23 15:36:55 +00:00
locore-v4.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
locore-v6.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
locore.S
machdep_boot.c Eliminate an unused var warning-error; the var is used only when parsing 2018-07-14 16:33:11 +00:00
machdep_intr.c
machdep_kdb.c Plug memory disclosures via ptrace(2). 2018-12-03 20:54:17 +00:00
machdep_ptrace.c Implement 'domainset', a cpuset based NUMA policy mechanism. This allows 2018-01-12 22:48:23 +00:00
machdep.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
mem.c Move phys_avail definition into MI code. It is consumed in the MI layer and 2019-08-16 00:45:14 +00:00
minidump_machdep.c Move phys_avail definition into MI code. It is consumed in the MI layer and 2019-08-16 00:45:14 +00:00
mp_machdep.c Centralize __pcpu definitions. 2019-08-29 07:25:27 +00:00
mpcore_timer.c Add a missing \n to a bootverbose printf. 2019-01-07 16:36:45 +00:00
mpcore_timervar.h
nexus.c Enable setting the dma tag at the nexus level 2017-06-21 18:25:35 +00:00
nexusvar.h Enable setting the dma tag at the nexus level 2017-06-21 18:25:35 +00:00
ofw_machdep.c "Buses" is the preferred plural of "bus" 2017-01-15 17:54:01 +00:00
physmem.c ARM kernel can get RAM regions three ways: 2019-08-31 21:28:06 +00:00
pl190.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
pl310.c Revert r339421 due to unintended files included to commit. 2018-10-18 15:17:58 +00:00
platform_if.m All armv6 platforms have the same implementation of platform_lastaddr. 2016-12-16 10:31:13 +00:00
platform_pl310_if.m Add external PLATFORM access on arm, and use it in the pl310 driver. 2017-07-11 16:30:16 +00:00
platform.c Add external PLATFORM access on arm, and use it in the pl310 driver. 2017-07-11 16:30:16 +00:00
pmap-v4.c Revert r352406, which contained changes I didn't intend to commit. 2019-09-16 15:04:45 +00:00
pmap-v6.c Complete the removal of the "wire_count" field from struct vm_page. 2019-09-25 16:11:35 +00:00
pmu.c hwpmc: simplify calling convention for hwpmc interrupt handling 2018-06-08 04:58:03 +00:00
ptrace_machdep.c Drop "All rights reserved" from my copyright statements. 2019-03-06 22:11:45 +00:00
sc_machdep.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
setcpsr.S
setstack.s Include machine/armreg.h after machine/asm.h to ensure __ARM_ARCH is 2016-11-07 11:01:09 +00:00
stack_machdep.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
stdatomic.c sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
support.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
swtch-v4.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
swtch-v6.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
swtch.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
sys_machdep.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
syscall.c Don't pass error from syscallenter() to syscallret(). 2019-07-15 21:25:16 +00:00
trap-v4.c Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
trap-v6.c Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
uio_machdep.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
undefined.c Raise a proper SIGTRAP / TRAP_TRACE signal for a PT_STEP step on arm. 2018-07-25 18:11:37 +00:00
unwind.c
vfp.c Use the correct register when storing the arm VFP state. 2018-08-27 10:08:27 +00:00
vm_machdep.c amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00