]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
arm64: barrier: Add CSDB macros to control data-value prediction
authorWill Deacon <will.deacon@arm.com>
Mon, 5 Feb 2018 15:34:16 +0000 (15:34 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Tue, 27 Feb 2018 16:32:59 +0000 (11:32 -0500)
Commit 669474e772b9 upstream.

For CPUs capable of data value prediction, CSDB waits for any outstanding
predictions to architecturally resolve before allowing speculative execution
to continue. Provide macros to expose it to the arch code.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6afdaf109c34acd9cbc85ef687e3e4e991e5fd89)

CVE-2017-5753
CVE-2017-5715
CVE-2017-5754

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/barrier.h

index 2c17b0db4b48df4e96aa31998b547c7baab69ebb..0890ddcd45a667de301eeb35bfb23a9d1978b788 100644 (file)
        dmb     \opt
        .endm
 
+/*
+ * Value prediction barrier
+ */
+       .macro  csdb
+       hint    #20
+       .endm
+
 /*
  * NOP sequence
  */
index 0fe7e43b7fbc26bf2f6f2a47354a21943ae56ab9..c68fdc5707edbcac307884988337844c3d0d0c9c 100644 (file)
@@ -31,6 +31,8 @@
 #define dmb(opt)       asm volatile("dmb " #opt : : : "memory")
 #define dsb(opt)       asm volatile("dsb " #opt : : : "memory")
 
+#define csdb()         asm volatile("hint #20" : : : "memory")
+
 #define mb()           dsb(sy)
 #define rmb()          dsb(ld)
 #define wmb()          dsb(st)