Skip to content

Commit 777fb19

Browse files
brooniewilldeacon
authored andcommitted
kselftest/arm64: Add lsfe to the hwcaps test
This feature has no traps associated with it so the SIGILL is not reliable. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 09b5feb commit 777fb19

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

  • tools/testing/selftests/arm64/abi

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <asm/sigcontext.h>
1818
#include <asm/unistd.h>
1919

20+
#include <linux/auxvec.h>
21+
2022
#include "../../kselftest.h"
2123

2224
#define TESTS_PER_HWCAP 3
@@ -168,6 +170,18 @@ static void lse128_sigill(void)
168170
: "cc", "memory");
169171
}
170172

173+
static void lsfe_sigill(void)
174+
{
175+
float __attribute__ ((aligned (16))) mem;
176+
register float *memp asm ("x0") = &mem;
177+
178+
/* STFADD H0, [X0] */
179+
asm volatile(".inst 0x7c20801f"
180+
: "+r" (memp)
181+
:
182+
: "memory");
183+
}
184+
171185
static void lut_sigill(void)
172186
{
173187
/* LUTI2 V0.16B, { V0.16B }, V[0] */
@@ -761,6 +775,13 @@ static const struct hwcap_data {
761775
.cpuinfo = "lse128",
762776
.sigill_fn = lse128_sigill,
763777
},
778+
{
779+
.name = "LSFE",
780+
.at_hwcap = AT_HWCAP3,
781+
.hwcap_bit = HWCAP3_LSFE,
782+
.cpuinfo = "lsfe",
783+
.sigill_fn = lsfe_sigill,
784+
},
764785
{
765786
.name = "LUT",
766787
.at_hwcap = AT_HWCAP2,

0 commit comments

Comments
 (0)