Skip to content

Commit 338a835

Browse files
jgoulyctmarinas
authored andcommitted
arm64: add FEAT_LRCPC3 HWCAP
FEAT_LRCPC3 adds more instructions to support the Release Consistency model. Add a HWCAP so that userspace can make decisions about instructions it can use. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20230919162757.2707023-2-joey.gouly@arm.com [catalin.marinas@arm.com: change the HWCAP number] Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 3accaef commit 338a835

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ HWCAP2_HBC
311311
HWCAP2_SVE_B16B16
312312
Functionality implied by ID_AA64ZFR0_EL1.B16B16 == 0b0001.
313313

314+
HWCAP2_LRCPC3
315+
Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0011.
316+
314317
4. Unused AT_HWCAP bits
315318
-----------------------
316319

arch/arm64/include/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
#define KERNEL_HWCAP_MOPS __khwcap2_feature(MOPS)
141141
#define KERNEL_HWCAP_HBC __khwcap2_feature(HBC)
142142
#define KERNEL_HWCAP_SVE_B16B16 __khwcap2_feature(SVE_B16B16)
143+
#define KERNEL_HWCAP_LRCPC3 __khwcap2_feature(LRCPC3)
143144

144145
/*
145146
* This yields a mask that user programs can use to figure out what

arch/arm64/include/uapi/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@
105105
#define HWCAP2_MOPS (1UL << 43)
106106
#define HWCAP2_HBC (1UL << 44)
107107
#define HWCAP2_SVE_B16B16 (1UL << 45)
108+
#define HWCAP2_LRCPC3 (1UL << 46)
108109

109110
#endif /* _UAPI__ASM_HWCAP_H */

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
28092809
HWCAP_CAP(ID_AA64ISAR1_EL1, FCMA, IMP, CAP_HWCAP, KERNEL_HWCAP_FCMA),
28102810
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, IMP, CAP_HWCAP, KERNEL_HWCAP_LRCPC),
28112811
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, LRCPC2, CAP_HWCAP, KERNEL_HWCAP_ILRCPC),
2812+
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, LRCPC3, CAP_HWCAP, KERNEL_HWCAP_LRCPC3),
28122813
HWCAP_CAP(ID_AA64ISAR1_EL1, FRINTTS, IMP, CAP_HWCAP, KERNEL_HWCAP_FRINT),
28132814
HWCAP_CAP(ID_AA64ISAR1_EL1, SB, IMP, CAP_HWCAP, KERNEL_HWCAP_SB),
28142815
HWCAP_CAP(ID_AA64ISAR1_EL1, BF16, IMP, CAP_HWCAP, KERNEL_HWCAP_BF16),

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ static const char *const hwcap_str[] = {
128128
[KERNEL_HWCAP_MOPS] = "mops",
129129
[KERNEL_HWCAP_HBC] = "hbc",
130130
[KERNEL_HWCAP_SVE_B16B16] = "sveb16b16",
131+
[KERNEL_HWCAP_LRCPC3] = "lrcpc3",
131132
};
132133

133134
#ifdef CONFIG_COMPAT

arch/arm64/tools/sysreg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,7 @@ UnsignedEnum 23:20 LRCPC
13091309
0b0000 NI
13101310
0b0001 IMP
13111311
0b0010 LRCPC2
1312+
0b0011 LRCPC3
13121313
EndEnum
13131314
UnsignedEnum 19:16 FCMA
13141315
0b0000 NI

0 commit comments

Comments
 (0)