Skip to content

Commit ebfc726

Browse files
mrutland-armwilldeacon
authored andcommitted
arm64: barrier: Restore spec_bar() macro
Upcoming errata workarounds will need to use SB from C code. Restore the spec_bar() macro so that we can use SB. This is effectively a revert of commit: 4f30ba1 ("arm64: barrier: Remove spec_bar() macro") Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: James Morse <james.morse@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20240508081400.235362-2-mark.rutland@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent fec50db commit ebfc726

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/arm64/include/asm/barrier.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
*/
4141
#define dgh() asm volatile("hint #6" : : : "memory")
4242

43+
#define spec_bar() asm volatile(ALTERNATIVE("dsb nsh\nisb\n", \
44+
SB_BARRIER_INSN"nop\n", \
45+
ARM64_HAS_SB))
46+
4347
#ifdef CONFIG_ARM64_PSEUDO_NMI
4448
#define pmr_sync() \
4549
do { \

0 commit comments

Comments
 (0)