Defend agains branch predictor target injection (Spectre "variant 2")
authorkettenis <kettenis@openbsd.org>
Wed, 17 Jan 2018 10:22:25 +0000 (10:22 +0000)
committerkettenis <kettenis@openbsd.org>
Wed, 17 Jan 2018 10:22:25 +0000 (10:22 +0000)
commitd855ec95cfe64f13b6899415be9c24dc9be8ec49
treee12400a648150669550395b17bcc1d026bf6d041
parent88672784c8989279f379384ef76ac52682805eab
Defend agains branch predictor target injection (Spectre "variant 2")
attacks by flushing the branch predictor cache (BTB) on context switches
and page faults in kkernel address space.  Note that this relies on the
presence of firmware (such as Arm Trusted Firmware) that provides PSCI
services that flush the BTB on entry as described in Arm Trusted Firmware
Security Advisory TFV 6.

ok patrick@, visa@
sys/arch/arm64/arm64/cpu.c
sys/arch/arm64/arm64/pmap.c
sys/arch/arm64/arm64/trap.c
sys/arch/arm64/include/cpu.h