summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-03-11 21:04:58 +0000
committerderaadt <deraadt@openbsd.org>2020-03-11 21:04:58 +0000
commit7323b495710d85ef50663a834dec01b4b7c01b64 (patch)
tree00cf58d04e9529ffb6f98d571c1f0fd0e8b597f6
parentNo need to pass 20000 to scsi_mode_sense[_big]() as the desired (diff)
downloadwireguard-openbsd-7323b495710d85ef50663a834dec01b4b7c01b64.tar.xz
wireguard-openbsd-7323b495710d85ef50663a834dec01b4b7c01b64.zip
Anthony Steinhauser reports that 32-bit arm cpus have the same speculation
problems as 64-bit models. "movs pc, lr" is the pre-VM legacy eret and as such also requires speculation blockers. Idiomatically spray "dsb nsh; ish" after each such occurance because it is cheap. (I find it very interesting 2/3 of these occur at end of a .o, so the instructions speculatively executed are from a randomly different .o file after each kernel relink...) ok kettenis
-rw-r--r--sys/arch/arm/arm/cpuswitch7.S4
-rw-r--r--sys/arch/arm/arm/exception.S4
-rw-r--r--sys/arch/arm/arm/irq_dispatch.S4
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/arm/arm/cpuswitch7.S b/sys/arch/arm/arm/cpuswitch7.S
index cd5997330c4..c3ea66df10e 100644
--- a/sys/arch/arm/arm/cpuswitch7.S
+++ b/sys/arch/arm/arm/cpuswitch7.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpuswitch7.S,v 1.15 2020/01/06 15:53:00 kettenis Exp $ */
+/* $OpenBSD: cpuswitch7.S,v 1.16 2020/03/11 21:04:58 deraadt Exp $ */
/* $NetBSD: cpuswitch.S,v 1.41 2003/11/15 08:44:18 scw Exp $ */
/*
@@ -238,3 +238,5 @@ ENTRY(proc_trampoline)
PULLFRAME
movs pc, lr /* Exit */
+ dsb nsh
+ isb
diff --git a/sys/arch/arm/arm/exception.S b/sys/arch/arm/arm/exception.S
index 8e649178c05..908912a2176 100644
--- a/sys/arch/arm/arm/exception.S
+++ b/sys/arch/arm/arm/exception.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: exception.S,v 1.9 2018/08/06 18:39:13 kettenis Exp $ */
+/* $OpenBSD: exception.S,v 1.10 2020/03/11 21:04:58 deraadt Exp $ */
/* $NetBSD: exception.S,v 1.13 2003/10/31 16:30:15 scw Exp $ */
/*
@@ -93,6 +93,8 @@ ASENTRY_NP(swi_entry)
DO_AST
PULLFRAME
movs pc, lr /* Exit */
+ dsb nsh
+ isb
/*
* prefetch_abort_entry:
diff --git a/sys/arch/arm/arm/irq_dispatch.S b/sys/arch/arm/arm/irq_dispatch.S
index 032592b516c..f6228cdc014 100644
--- a/sys/arch/arm/arm/irq_dispatch.S
+++ b/sys/arch/arm/arm/irq_dispatch.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: irq_dispatch.S,v 1.15 2018/08/06 18:39:13 kettenis Exp $ */
+/* $OpenBSD: irq_dispatch.S,v 1.16 2020/03/11 21:04:58 deraadt Exp $ */
/* $NetBSD: irq_dispatch.S,v 1.5 2003/10/30 08:57:24 scw Exp $ */
/*
@@ -128,6 +128,8 @@ ASENTRY_NP(irq_entry)
DO_AST
PULLFRAMEFROMSVCANDEXIT
movs pc, lr /* Exit */
+ dsb nsh
+ isb
.bss
.align 2