freebsd-dev/sys/arm/include
Michal Meloun a36b6ec0f9 Implement mitigation for Spectre version 2 attacks on ARMv7.
Similarly as we already do for arm64, for mitigation is necessary to
flush branch predictor when we:
- do task switch
- receive prefetch abort on non-userspace address

The user can disable this mitigation by setting 'machdep.disable_bp_hardening'
sysctl variable, or it can check actual system status by reading
'machdep.spectre_v2_safe'

The situation is complicated by fact that:
- for Cortex-A8, the BPIALL instruction is effectively NOP until the IBE bit
  in ACTLR is set.
- for Cortex-A15, the BPIALL is always NOP. The branch predictor can be
  only flushed by doing ICIALLU with special bit (Enable invalidates  of BTB)
  set in ACTLR.

Since access to the ACTLR register is locked to secure monitor/firmware on
most boards, they will also need update of firmware / U-boot.
In worst case, when secure monitor is on-chip ROM (e.g. PandaBoard),
the board is unfixable.

MFC after:	2 weeks
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D13931
2018-01-27 11:19:41 +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 spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +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 sys/arm: further adoption of SPDX licensing ID tags. 2017-11-27 15:04:10 +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 Rename pte.h to pte-v4.h and start including directly either pte-v4.h 2016-02-19 09:23:32 +00:00
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 ARM: Define PCI_RES_BUS resource for platforms having NEW_PCIB enabled. 2015-12-02 14:24:14 +00:00
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 Move the check to see if we are tracing a function with the DTrace Function 2015-12-05 09:32:36 +00:00
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