Skip to content

Commit 2baca17

Browse files
committed
Merge branch 'for-next/feat_lse128' into for-next/core
* for-next/feat_lse128: : HWCAP for FEAT_LSE128 kselftest/arm64: add FEAT_LSE128 to hwcap test arm64: add FEAT_LSE128 HWCAP
2 parents 023113f + 72e3019 commit 2baca17

File tree

7 files changed

+29
-0
lines changed

7 files changed

+29
-0
lines changed

Documentation/arch/arm64/elf_hwcaps.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ HWCAP2_SVE_B16B16
314314
HWCAP2_LRCPC3
315315
Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0011.
316316

317+
HWCAP2_LSE128
318+
Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0011.
319+
317320
4. Unused AT_HWCAP bits
318321
-----------------------
319322

arch/arm64/include/asm/hwcap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
#define KERNEL_HWCAP_HBC __khwcap2_feature(HBC)
142142
#define KERNEL_HWCAP_SVE_B16B16 __khwcap2_feature(SVE_B16B16)
143143
#define KERNEL_HWCAP_LRCPC3 __khwcap2_feature(LRCPC3)
144+
#define KERNEL_HWCAP_LSE128 __khwcap2_feature(LSE128)
144145

145146
/*
146147
* 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
@@ -106,5 +106,6 @@
106106
#define HWCAP2_HBC (1UL << 44)
107107
#define HWCAP2_SVE_B16B16 (1UL << 45)
108108
#define HWCAP2_LRCPC3 (1UL << 46)
109+
#define HWCAP2_LSE128 (1UL << 47)
109110

110111
#endif /* _UAPI__ASM_HWCAP_H */

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
27462746
HWCAP_CAP(ID_AA64ISAR0_EL1, SHA2, SHA512, CAP_HWCAP, KERNEL_HWCAP_SHA512),
27472747
HWCAP_CAP(ID_AA64ISAR0_EL1, CRC32, IMP, CAP_HWCAP, KERNEL_HWCAP_CRC32),
27482748
HWCAP_CAP(ID_AA64ISAR0_EL1, ATOMIC, IMP, CAP_HWCAP, KERNEL_HWCAP_ATOMICS),
2749+
HWCAP_CAP(ID_AA64ISAR0_EL1, ATOMIC, FEAT_LSE128, CAP_HWCAP, KERNEL_HWCAP_LSE128),
27492750
HWCAP_CAP(ID_AA64ISAR0_EL1, RDM, IMP, CAP_HWCAP, KERNEL_HWCAP_ASIMDRDM),
27502751
HWCAP_CAP(ID_AA64ISAR0_EL1, SHA3, IMP, CAP_HWCAP, KERNEL_HWCAP_SHA3),
27512752
HWCAP_CAP(ID_AA64ISAR0_EL1, SM3, IMP, CAP_HWCAP, KERNEL_HWCAP_SM3),

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static const char *const hwcap_str[] = {
129129
[KERNEL_HWCAP_HBC] = "hbc",
130130
[KERNEL_HWCAP_SVE_B16B16] = "sveb16b16",
131131
[KERNEL_HWCAP_LRCPC3] = "lrcpc3",
132+
[KERNEL_HWCAP_LSE128] = "lse128",
132133
};
133134

134135
#ifdef CONFIG_COMPAT

arch/arm64/tools/sysreg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,7 @@ EndEnum
12391239
UnsignedEnum 23:20 ATOMIC
12401240
0b0000 NI
12411241
0b0010 IMP
1242+
0b0011 FEAT_LSE128
12421243
EndEnum
12431244
UnsignedEnum 19:16 CRC32
12441245
0b0000 NI

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ static void lrcpc_sigill(void)
8181
asm volatile(".inst 0xb8bfc3e0" : : : );
8282
}
8383

84+
static void lse128_sigill(void)
85+
{
86+
u64 __attribute__ ((aligned (16))) mem[2] = { 10, 20 };
87+
register u64 *memp asm ("x0") = mem;
88+
register u64 val0 asm ("x1") = 5;
89+
register u64 val1 asm ("x2") = 4;
90+
91+
/* SWPP X1, X2, [X0] */
92+
asm volatile(".inst 0x19228001"
93+
: "+r" (memp), "+r" (val0), "+r" (val1)
94+
:
95+
: "cc", "memory");
96+
}
97+
8498
static void mops_sigill(void)
8599
{
86100
char dst[1], src[1];
@@ -390,6 +404,13 @@ static const struct hwcap_data {
390404
.sigbus_fn = uscat_sigbus,
391405
.sigbus_reliable = true,
392406
},
407+
{
408+
.name = "LSE128",
409+
.at_hwcap = AT_HWCAP2,
410+
.hwcap_bit = HWCAP2_LSE128,
411+
.cpuinfo = "lse128",
412+
.sigill_fn = lse128_sigill,
413+
},
393414
{
394415
.name = "MOPS",
395416
.at_hwcap = AT_HWCAP2,

0 commit comments

Comments
 (0)