arm64: alternatives: add cpu feature for lse atomics
authorWill Deacon <will.deacon@arm.com>
Wed, 4 Feb 2015 12:17:55 +0000 (12:17 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 27 Jul 2015 13:34:39 +0000 (14:34 +0100)
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 <steve.capper@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/cpufeature.h
arch/arm64/kernel/setup.c

index 40e106f81f27effd19d22d4a79dfbbd37755d089..d9262d4b4dcd8c9b6ee54b503ce56dc8ad74fbe8 100644 (file)
@@ -26,8 +26,9 @@
 #define ARM64_WORKAROUND_845719                        2
 #define ARM64_HAS_SYSREG_GIC_CPUIF             3
 #define ARM64_HAS_PAN                          4
+#define ARM64_CPU_FEAT_LSE_ATOMICS             5
 
-#define ARM64_NCAPS                            5
+#define ARM64_NCAPS                            6
 
 #ifndef __ASSEMBLY__
 
index b2f9895ecf7b5af6784f8d5a5232d55abaf7da60..f4fbbc884893f30f258df60858d933b95708c4d1 100644 (file)
@@ -284,6 +284,7 @@ static void __init setup_processor(void)
                default:
                case 2:
                        elf_hwcap |= HWCAP_ATOMICS;
+                       cpus_set_cap(ARM64_CPU_FEAT_LSE_ATOMICS);
                case 1:
                        /* RESERVED */
                case 0: