File tree Expand file tree Collapse file tree 5 files changed +15
-13
lines changed Expand file tree Collapse file tree 5 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -1363,6 +1363,11 @@ config ARM64_PAN
1363
1363
instruction if the cpu does not implement the feature.
1364
1364
1365
1365
config ARM64_LSE_ATOMICS
1366
+ bool
1367
+ default ARM64_USE_LSE_ATOMICS
1368
+ depends on $(as-instr,.arch_extension lse)
1369
+
1370
+ config ARM64_USE_LSE_ATOMICS
1366
1371
bool "Atomic instructions"
1367
1372
depends on JUMP_LABEL
1368
1373
default y
Original file line number Diff line number Diff line change @@ -30,11 +30,8 @@ LDFLAGS_vmlinux += --fix-cortex-a53-843419
30
30
endif
31
31
endif
32
32
33
- # Check for binutils support for specific extensions
34
- lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1)
35
-
36
- ifeq ($(CONFIG_ARM64_LSE_ATOMICS ) , y)
37
- ifeq ($(lseinstr),)
33
+ ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS ) , y)
34
+ ifneq ($(CONFIG_ARM64_LSE_ATOMICS), y)
38
35
$(warning LSE atomics not supported by binutils)
39
36
endif
40
37
endif
@@ -53,11 +50,11 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
53
50
endif
54
51
endif
55
52
56
- KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr ) $( brokengasinst ) \
53
+ KBUILD_CFLAGS += -mgeneral-regs-only $(brokengasinst ) \
57
54
$(compat_vdso ) $(cc_has_k_constraint )
58
55
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
59
56
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
60
- KBUILD_AFLAGS += $(lseinstr ) $( brokengasinst ) $(compat_vdso )
57
+ KBUILD_AFLAGS += $(brokengasinst ) $(compat_vdso )
61
58
62
59
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
63
60
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
Original file line number Diff line number Diff line change 12
12
13
13
#include <linux/stringify.h>
14
14
15
- #if IS_ENABLED ( CONFIG_ARM64_LSE_ATOMICS ) && IS_ENABLED ( CONFIG_AS_LSE )
15
+ #ifdef CONFIG_ARM64_LSE_ATOMICS
16
16
#define __LL_SC_FALLBACK (asm_ops ) \
17
17
" b 3f\n" \
18
18
" .subsection 1\n" \
Original file line number Diff line number Diff line change 4
4
5
5
#include <asm/atomic_ll_sc.h>
6
6
7
- #if defined( CONFIG_AS_LSE ) && defined( CONFIG_ARM64_LSE_ATOMICS )
7
+ #ifdef CONFIG_ARM64_LSE_ATOMICS
8
8
9
9
#include <linux/compiler_types.h>
10
10
#include <linux/export.h>
@@ -36,13 +36,13 @@ static inline bool system_uses_lse_atomics(void)
36
36
#define ARM64_LSE_ATOMIC_INSN (llsc , lse ) \
37
37
ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS)
38
38
39
- #else /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
39
+ #else /* CONFIG_ARM64_LSE_ATOMICS */
40
40
41
41
static inline bool system_uses_lse_atomics (void ) { return false; }
42
42
43
43
#define __lse_ll_sc_body (op , ...) __ll_sc_##op(__VA_ARGS__)
44
44
45
45
#define ARM64_LSE_ATOMIC_INSN (llsc , lse ) llsc
46
46
47
- #endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
47
+ #endif /* CONFIG_ARM64_LSE_ATOMICS */
48
48
#endif /* __ASM_LSE_H */
Original file line number Diff line number Diff line change @@ -1291,7 +1291,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
1291
1291
.cpu_enable = cpu_enable_pan ,
1292
1292
},
1293
1293
#endif /* CONFIG_ARM64_PAN */
1294
- #if defined( CONFIG_AS_LSE ) && defined ( CONFIG_ARM64_LSE_ATOMICS )
1294
+ #ifdef CONFIG_ARM64_LSE_ATOMICS
1295
1295
{
1296
1296
.desc = "LSE atomic instructions" ,
1297
1297
.capability = ARM64_HAS_LSE_ATOMICS ,
@@ -1302,7 +1302,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
1302
1302
.sign = FTR_UNSIGNED ,
1303
1303
.min_field_value = 2 ,
1304
1304
},
1305
- #endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
1305
+ #endif /* CONFIG_ARM64_LSE_ATOMICS */
1306
1306
{
1307
1307
.desc = "Software prefetching using PRFM" ,
1308
1308
.capability = ARM64_HAS_NO_HW_PREFETCH ,
You can’t perform that action at this time.
0 commit comments