Skip to content

Commit

Permalink
arm64: barrier: Add CSDB macros to control data-value prediction
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Will Deacon authored and Catalin Marinas committed Feb 6, 2018
1 parent 439e70e commit 669474e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/arm64/include/asm/assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@
hint #16
.endm

/*
* Value prediction barrier
*/
.macro csdb
hint #20
.endm

/*
* NOP sequence
*/
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/include/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define dsb(opt) asm volatile("dsb " #opt : : : "memory")

#define psb_csync() asm volatile("hint #17" : : : "memory")
#define csdb() asm volatile("hint #20" : : : "memory")

#define mb() dsb(sy)
#define rmb() dsb(ld)
Expand Down

0 comments on commit 669474e

Please sign in to comment.