Skip to content

Commit d964b72

Browse files
committed
arm64: alternatives: add cpu feature for lse atomics
Add a CPU feature for the LSE atomic instructions, so that they can be patched in at runtime when we detect that they are supported. Reviewed-by: Steve Capper <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 40a1db2 commit d964b72

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
#define ARM64_WORKAROUND_845719 2
2727
#define ARM64_HAS_SYSREG_GIC_CPUIF 3
2828
#define ARM64_HAS_PAN 4
29+
#define ARM64_CPU_FEAT_LSE_ATOMICS 5
2930

30-
#define ARM64_NCAPS 5
31+
#define ARM64_NCAPS 6
3132

3233
#ifndef __ASSEMBLY__
3334

arch/arm64/kernel/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ static void __init setup_processor(void)
284284
default:
285285
case 2:
286286
elf_hwcap |= HWCAP_ATOMICS;
287+
cpus_set_cap(ARM64_CPU_FEAT_LSE_ATOMICS);
287288
case 1:
288289
/* RESERVED */
289290
case 0:

0 commit comments

Comments
 (0)