freebsd-dev/sys/arm/include
Jonathan T. Looney beb2406556 amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits
correctly for the data contained on each memory page.

There are several components to this change:
 * Add a variable to indicate the start of the R/W portion of the
   initial memory.
 * Stop detecting NX bit support for each AP.  Instead, use the value
   from the BSP and, if supported, activate the feature on the other
   APs just before loading the correct page table.  (Functionally, we
   already assume that the BSP and all APs had the same support or
   lack of support for the NX bit.)
 * Set the RW and NX bits correctly for the kernel text, data, and
   BSS (subject to some caveats below).
 * Ensure DDB can write to memory when necessary (such as to set a
   breakpoint).
 * Ensure GDB can write to memory when necessary (such as to set a
   breakpoint).  For this purpose, add new MD functions gdb_begin_write()
   and gdb_end_write() which the GDB support code can call before and
   after writing to memory.

This change is not comprehensive:
 * It doesn't do anything to protect modules.
 * It doesn't do anything for kernel memory allocated after the kernel
   starts running.
 * In order to avoid excessive memory inefficiency, it may let multiple
   types of data share a 2M page, and assigns the most permissions
   needed for data on that page.

Reviewed by:	jhb, kib
Discussed with:	emaste
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D14282
2018-03-06 14:28:37 +00:00
..
_align.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
_bus.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
_inttypes.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
_limits.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
_stdint.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
_types.h Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
acle-compat.h
armreg.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
asm.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
asmacros.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
at91_gpio.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
atags.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
atomic-v4.h Remove register keyword from sys/ and ANSIfy prototypes 2017-05-17 00:34:34 +00:00
atomic-v6.h Correct the IT instruction in atomic_fcmpset_64(). 2017-01-29 13:31:56 +00:00
atomic.h Remove arm-specific implementations of atomic_load/store_xxx() now that 2017-12-20 20:41:51 +00:00
blockio.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
board.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
bus_dma.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
bus.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
clock.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
counter.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
cpu-v4.h All CP15 registers are bit fields or counters, don't use signed type 2017-11-05 16:52:54 +00:00
cpu-v6.h All CP15 registers are bit fields or counters, don't use signed type 2017-11-05 16:52:54 +00:00
cpu.h Include machine/acle-compat.h in cdefs.h on arm if the compiler doesn't 2016-05-25 19:44:26 +00:00
cpufunc.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
cpuinfo.h Implement mitigation for Spectre version 2 attacks on ARMv7. 2018-01-27 11:19:41 +00:00
db_machdep.h Fix printing of negative offsets (typically from frame pointers) again. 2017-03-26 18:46:35 +00:00
debug_monitor.h Improve ARM debug_monitor for SMP machines 2016-05-29 17:35:38 +00:00
disassem.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
dump.h
efi.h Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
elf.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
endian.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
exec.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
fdt.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
fiq.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
float.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
floatingpoint.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
frame.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
gdb_machdep.h amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
ieee.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ieeefp.h
in_cksum.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
intr.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
kdb.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
limits.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
machdep.h Save VFP state in getcontext(3) on ARM. 2017-10-16 12:53:54 +00:00
md_var.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
memdev.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
metadata.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
minidump.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
ofw_machdep.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
param.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
pcb.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
pcpu.h Implement mitigation for Spectre version 2 attacks on ARMv7. 2018-01-27 11:19:41 +00:00
physmem.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
pl310.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
platform.h
platformvar.h Add external PLATFORM access on arm, and use it in the pl310 driver. 2017-07-11 16:30:16 +00:00
pmap_var.h Don't use atomic operations for page table entries and handle access 2016-04-22 06:32:27 +00:00
pmap-v4.h Define CPU_XSCALE_CORE3 when relevant. 2017-09-19 23:41:55 +00:00
pmap-v6.h Implement tunable CPU quirks. 2017-06-13 12:07:18 +00:00
pmap.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
pmc_mdep.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
proc.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
profile.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
psl.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
pte-v4.h
pte-v6.h Fix TEX index acquisition using L2 attributes 2017-07-27 23:14:17 +00:00
ptrace.h Add ptrace operations to fetch and store VFP registers. 2017-09-14 15:03:43 +00:00
reg.h Cleanup structures related to VFP and/or mcontext_t. 2017-03-24 11:46:49 +00:00
reloc.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
resource.h
runq.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
sc_machdep.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
setjmp.h
sf_buf.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
sigframe.h
signal.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
smp.h Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
stack.h
stdarg.h Introduce an architecture-agnostic <sys/_stdarg.h> to reduce 2017-12-25 20:54:00 +00:00
swi.h
sysarch.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
sysreg.h Add the virtualisation special register definitions. 2017-12-14 13:19:43 +00:00
trap.h
ucontext.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
undefined.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
utrap.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
vdso.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
vfp.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
vm.h sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +00:00
vmparam.h Define PHYS_TO_DMAP() and DMAP_TO_PHYS() as panics on the architectures 2018-01-19 22:17:13 +00:00