freebsd-dev/sys/arm
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
..
allwinner Convert extres/phy to kobj model. 2018-01-20 17:02:17 +00:00
altera/socfpga dwmmc: Fully subclass driver 2017-12-30 22:01:17 +00:00
amlogic/aml8726 Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
annapurna/alpine Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 2017-12-28 07:31:14 +00:00
arm Implement mitigation for Spectre version 2 attacks on ARMv7. 2018-01-27 11:19:41 +00:00
at91 Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
broadcom/bcm2835 Add skeleton manual page for bcm283x_pwm 2018-01-22 07:43:54 +00:00
cavium/cns11xx Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
cloudabi32 Correct some more places where TO_PTR() should be used. 2017-11-26 14:53:56 +00:00
conf arm: lpc: Remove support 2018-01-24 22:04:16 +00:00
freescale Add support to the imx5/6 watchdog for the external reset signal. Also, if 2018-01-26 17:55:17 +00:00
include Implement mitigation for Spectre version 2 attacks on ARMv7. 2018-01-27 11:19:41 +00:00
mv o Move sdhci_fdt to the generic files list. 2018-01-25 17:16:29 +00:00
nvidia Convert extres/phy to kobj model. 2018-01-20 17:02:17 +00:00
qemu Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 2017-12-28 07:31:14 +00:00
ralink Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
rockchip dwmmc: Fully subclass driver 2017-12-30 22:01:17 +00:00
samsung/exynos dwmmc: Fully subclass driver 2017-12-30 22:01:17 +00:00
ti Make kernel option KERNVIRTADDR optional, remove it from std.<platform> 2017-12-30 00:20:49 +00:00
versatile Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 2017-12-28 07:31:14 +00:00
xilinx o Move sdhci_fdt to the generic files list. 2018-01-25 17:16:29 +00:00
xscale Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00