aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/security
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.ibm.com>2022-01-27 12:49:55 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2022-03-01 23:38:12 +1100
commit6523dce86222451e5ca2df8a46597a217084bfdf (patch)
treeeff8f7bd95d4d150ef5ab023f986fc26d4a1734c /tools/testing/selftests/powerpc/security
parentselftests/powerpc/pmu: Add support for perf sampling tests (diff)
downloadlinux-6523dce86222451e5ca2df8a46597a217084bfdf.tar.gz
linux-6523dce86222451e5ca2df8a46597a217084bfdf.zip
selftests/powerpc/pmu: Add macros to parse event codes
Each platform has raw event encoding format which specifies the bit positions for different fields. The fields from event code gets translated into performance monitoring mode control register (MMCRx) settings. Patch add macros to extract individual fields from the event code. Add functions for sanity checks, since testcases currently are only supported in power9 and power10. Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> [mpe: Read PVR directly rather than using /proc/cpuinfo] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220127072012.662451-4-kjain@linux.ibm.com
Diffstat (limited to 'tools/testing/selftests/powerpc/security')
-rw-r--r--tools/testing/selftests/powerpc/security/spectre_v2.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/testing/selftests/powerpc/security/spectre_v2.c b/tools/testing/selftests/powerpc/security/spectre_v2.c
index 83647b8277e7..d42ca8c676c3 100644
--- a/tools/testing/selftests/powerpc/security/spectre_v2.c
+++ b/tools/testing/selftests/powerpc/security/spectre_v2.c
@@ -125,8 +125,6 @@ static enum spectre_v2_state get_sysfs_state(void)
#define PM_BR_PRED_PCACHE 0x048a0 // P9 only
#define PM_BR_MPRED_PCACHE 0x048b0 // P9 only
-#define SPRN_PVR 287
-
int spectre_v2_test(void)
{
enum spectre_v2_state state;