Skip to content

Commit fabf056

Browse files
jgoulywilldeacon
authored andcommitted
kselftest/arm64: add HWCAP test for FEAT_S1POE
Check that when POE is enabled, the POR_EL0 register is accessible. Signed-off-by: Joey Gouly <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Mark Brown <[email protected]> Cc: Shuah Khan <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent f5b5ea5 commit fabf056

File tree

1 file changed

+14
-0
lines changed
  • tools/testing/selftests/arm64/abi

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ static void pmull_sigill(void)
156156
asm volatile(".inst 0x0ee0e000" : : : );
157157
}
158158

159+
static void poe_sigill(void)
160+
{
161+
/* mrs x0, POR_EL0 */
162+
asm volatile("mrs x0, S3_3_C10_C2_4" : : : "x0");
163+
}
164+
159165
static void rng_sigill(void)
160166
{
161167
asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0");
@@ -601,6 +607,14 @@ static const struct hwcap_data {
601607
.cpuinfo = "pmull",
602608
.sigill_fn = pmull_sigill,
603609
},
610+
{
611+
.name = "POE",
612+
.at_hwcap = AT_HWCAP2,
613+
.hwcap_bit = HWCAP2_POE,
614+
.cpuinfo = "poe",
615+
.sigill_fn = poe_sigill,
616+
.sigill_reliable = true,
617+
},
604618
{
605619
.name = "RNG",
606620
.at_hwcap = AT_HWCAP2,

0 commit comments

Comments
 (0)