Skip to content

Commit 023113f

Browse files
committed
Merge branch 'for-next/feat_lrcpc3' into for-next/core
* for-next/feat_lrcpc3: : HWCAP for FEAT_LRCPC3 selftests/arm64: add HWCAP2_LRCPC3 test arm64: add FEAT_LRCPC3 HWCAP
2 parents 2a3f8ce + 80652cc commit 023113f

File tree

7 files changed

+28
-0
lines changed

7 files changed

+28
-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
@@ -2766,6 +2766,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
27662766
HWCAP_CAP(ID_AA64ISAR1_EL1, FCMA, IMP, CAP_HWCAP, KERNEL_HWCAP_FCMA),
27672767
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, IMP, CAP_HWCAP, KERNEL_HWCAP_LRCPC),
27682768
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, LRCPC2, CAP_HWCAP, KERNEL_HWCAP_ILRCPC),
2769+
HWCAP_CAP(ID_AA64ISAR1_EL1, LRCPC, LRCPC3, CAP_HWCAP, KERNEL_HWCAP_LRCPC3),
27692770
HWCAP_CAP(ID_AA64ISAR1_EL1, FRINTTS, IMP, CAP_HWCAP, KERNEL_HWCAP_FRINT),
27702771
HWCAP_CAP(ID_AA64ISAR1_EL1, SB, IMP, CAP_HWCAP, KERNEL_HWCAP_SB),
27712772
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

tools/testing/selftests/arm64/abi/hwcap.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,19 @@ static void uscat_sigbus(void)
295295
asm volatile(".inst 0xb820003f" : : : );
296296
}
297297

298+
static void lrcpc3_sigill(void)
299+
{
300+
int data[2] = { 1, 2 };
301+
302+
register int *src asm ("x0") = data;
303+
register int data0 asm ("w2") = 0;
304+
register int data1 asm ("w3") = 0;
305+
306+
/* LDIAPP w2, w3, [x0] */
307+
asm volatile(".inst 0x99431802"
308+
: "=r" (data0), "=r" (data1) : "r" (src) :);
309+
}
310+
298311
static const struct hwcap_data {
299312
const char *name;
300313
unsigned long at_hwcap;
@@ -354,6 +367,13 @@ static const struct hwcap_data {
354367
.cpuinfo = "ilrcpc",
355368
.sigill_fn = ilrcpc_sigill,
356369
},
370+
{
371+
.name = "LRCPC3",
372+
.at_hwcap = AT_HWCAP2,
373+
.hwcap_bit = HWCAP2_LRCPC3,
374+
.cpuinfo = "lrcpc3",
375+
.sigill_fn = lrcpc3_sigill,
376+
},
357377
{
358378
.name = "LSE",
359379
.at_hwcap = AT_HWCAP,

0 commit comments

Comments
 (0)