[PATCH] selftests/powerpc: Fix "no_handler" EBB selftest for ISA v3.1
Athira Rajeev
atrajeev at linux.vnet.ibm.com
Fri May 21 00:35:58 AEST 2021
The "no_handler_test" in ebb selftests attempts to read the PMU
registers after closing of the event via helper function
"dump_ebb_state". With the MMCR0 control bit (PMCCEXT) in ISA v3.1,
read access to group B registers is restricted when MMCR0 PMCC=0b00.
Hence the call to dump_ebb_state after closing of event will generate
a SIGILL, which is expected.
Test has below in logs:
<<>>
!! child died by signal 4
failure: no_handler_test
<<>>
In other platforms (like power9), the older behaviour works where
group B PMU SPRs are readable. Patch fixes the selftest to handle
the sigill for ISA v3.1.
Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>
Reported-by: Shirisha Ganta <shirisha.ganta1 at ibm.com>
---
tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c b/tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
index fc5bf48..5f57a9d 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
+++ b/tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
@@ -50,7 +50,17 @@ static int no_handler_test(void)
event_close(&event);
- dump_ebb_state();
+ /*
+ * For ISA v3.1, verify the test takes a SIGILL when reading
+ * PMU regs after the event is closed. With the control bit
+ * in MMCR0 (PMCCEXT) restricting access to group B PMU regs,
+ * sigill is expected.
+ */
+
+ if (have_hwcap2(PPC_FEATURE2_ARCH_3_1))
+ FAIL_IF(catch_sigill(dump_ebb_state));
+ else
+ dump_ebb_state();
/* The real test is that we never took an EBB at 0x0 */
--
1.8.3.1
More information about the Linuxppc-dev
mailing list