tools/testing/selftests/powerpc: Enable pmu selftests for power11
PATCH v2 1/5 tools/testing/selftests/powerpc: Enable pmu selftests for power11
Add check for power11 pvr in the selftest utility functions. Selftests uses pvr value to check for platform support inorder to run the tests. pvr is also used to send the extended mask value to capture sampling registers.
Update some of the utility functions to use hwcap2 inorder to return platform specific bits from sampling registers.
---
Changelog:
v1 -> v2
No code changes. Rebased to latest upstream
.../selftests/powerpc/pmu/sampling_tests/misc.c | 11 ++++++++++- .../selftests/powerpc/pmu/sampling_tests/misc.h | 10 ++++++---- 2 files changed, 16 insertions(+), 5 deletions(-)
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c +10 -1
@@ -59,6 +59,7 @@ static void init_ev_encodes(void) ev_shift_thd_stop =32 ;switch (pvr) { +case POWER11 :case POWER10 : ev_mask_thd_cmp =0x3ffff ; ev_shift_thd_cmp =0 ;
@@ -129,8 +130,14 @@ int platform_check_for_tests(void)* Check for supported platforms * for sampling test */ -if ((pvr !=POWER10 ) && (pvr !=POWER9 )) +switch (pvr) { +case POWER11 : +case POWER10 : +case POWER9 : +break ; +default : goto out; + }/* * Check PMU driver registered by looking for
@@ -499,6 +506,8 @@ static bool auxv_generic_compat_pmu(void) base_pvr =POWER9 ; else if (!strcmp(auxv_base_platform(), "power10")) base_pvr =POWER10 ; + else if (!strcmp(auxv_base_platform(), "power11")) + base_pvr =POWER11 ;return (!base_pvr); }
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h +6 -4
@@ -8,10 +8,12 @@#include <sys/stat.h> #include "../event.h" +#define POWER11 0x82#define POWER10 0x80#define POWER9 0x4e#define PERF_POWER9_MASK 0x7f8ffffffffffff#define PERF_POWER10_MASK 0x7ffffffffffffff +#define PERF_POWER11_MASK PERF_POWER10_MASK#define MMCR0_FC56 0x00000010UL/* freeze counters 5 and 6 */ #define MMCR0_PMCCEXT 0x00000200UL/* PMCCEXT control */
@@ -165,21 +167,21 @@ static inline int get_mmcr2_fcta(u64 mmcr2, int pmc)static inline int get_mmcr2_l2l3 (u64 mmcr2,int pmc) { -if (pvr ==POWER10 ) +if (have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ))return ((mmcr2 &0xf8 ) >>3 );return 0 ; }static inline int get_mmcr3_src (u64 mmcr3,int pmc) { -if (pvr !=POWER10 ) +if (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ))return 0 ;return ((mmcr3 >> ((49 - (15 * ((pmc) -1 ))))) &0x7fff ); }static inline int get_mmcra_thd_cmp (u64 mmcra,int pmc) { -if (pvr ==POWER10 ) +if (have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ))return ((mmcra >>45 ) &0x7ff );return ((mmcra >>45 ) &0x3ff ); }
@@ -191,7 +193,7 @@ static inline int get_mmcra_sm(u64 mmcra, int pmc)static inline u64 get_mmcra_bhrb_disable (u64 mmcra,int pmc) { -if (pvr ==POWER10 ) +if (have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ))return mmcra &BHRB_DISABLE ;return 0 ; }
Signature · 1 line
2.43.5
PATCH v2 2/5 tools/testing/selftests/powerpc: Add check for power11 pvr for pmu selfests
Some of the tests depends on pvr value to choose the event. Example:
- event_alternatives_tests_p10: alternative event depends on registered PMU driver which is based on pvr
- generic_events_valid_test varies based on platform
- bhrb_filter_map_test: again its dependent on pmu to decide which bhrb filter to use
- reserved_bits_mmcra_sample_elig_mode: randome sampling mode reserved bits is also varies based on platform
---
Changelog:
v1 -> v2
No code changes. Rebased to latest upstream
.../pmu/event_code_tests/event_alternatives_tests_p10.c | 3 ++- .../pmu/event_code_tests/generic_events_valid_test.c | 3 ++- .../reserved_bits_mmcra_sample_elig_mode_test.c | 3 ++- .../powerpc/pmu/sampling_tests/bhrb_filter_map_test.c | 7 +++++-- 4 files changed, 11 insertions(+), 5 deletions(-)
tools/testing/selftests/powerpc/pmu/event_code_tests/event_alternatives_tests_p10.c +2 -1
@@ -26,6 +26,7 @@ static int event_alternatives_tests_p10(void) {struct event *e, events[5 ];int i; +int pvr =PVR_VER (mfspr (SPRN_PVR ));/* Check for platform support for the test */ SKIP_IF (platform_check_for_tests ());
@@ -36,7 +37,7 @@ static int event_alternatives_tests_p10(void)* code and using PVR will work correctly for all cases * including generic compat mode. */ -SKIP_IF (PVR_VER (mfspr (SPRN_PVR )) !=POWER10 ); +SKIP_IF ((pvr !=POWER10 ) && (pvr !=POWER11 ));SKIP_IF (check_for_generic_compat_pmu ());
tools/testing/selftests/powerpc/pmu/event_code_tests/generic_events_valid_test.c +2 -1
@@ -17,6 +17,7 @@static int generic_events_valid_test (void ) {struct event event; +int pvr =mfspr (SPRN_PVR );/* Check for platform support for the test */ SKIP_IF (platform_check_for_tests ());
@@ -31,7 +32,7 @@ static int generic_events_valid_test(void)* - PERF_COUNT_HW_STALLED_CYCLES_BACKEND * - PERF_COUNT_HW_REF_CPU_CYCLES */ -if (PVR_VER (mfspr (SPRN_PVR )) ==POWER10 ) { +if ((pvr ==POWER10 ) || (pvr ==POWER11 )) {event_init_opts (&event,PERF_COUNT_HW_CPU_CYCLES ,PERF_TYPE_HARDWARE ,"event" );FAIL_IF (event_open (&event));event_close (&event);
tools/testing/selftests/powerpc/pmu/event_code_tests/reserved_bits_mmcra_sample_elig_mode_test.c +2 -1
@@ -21,6 +21,7 @@static int reserved_bits_mmcra_sample_elig_mode (void ) {struct event event; +int pvr =PVR_VER (mfspr (SPRN_PVR ));/* Check for platform support for the test */ SKIP_IF (platform_check_for_tests ());
@@ -59,7 +60,7 @@ static int reserved_bits_mmcra_sample_elig_mode(void)* is reserved in power10 and 0xC is reserved in * power9. */ -if (PVR_VER (mfspr (SPRN_PVR )) ==POWER10 ) { +if ((pvr ==POWER10 ) || (pvr ==POWER11 )) {event_init (&event,0x100401e0 );FAIL_IF (!event_open (&event)); }else if (PVR_VER (mfspr (SPRN_PVR )) ==POWER9 ) {
tools/testing/selftests/powerpc/pmu/sampling_tests/bhrb_filter_map_test.c +5 -2
@@ -83,13 +83,16 @@ static int bhrb_filter_map_test(void)* using PVR will work correctly for all cases including generic * compat mode. */ -if (PVR_VER (mfspr (SPRN_PVR )) ==POWER10 ) { +switch (PVR_VER (mfspr (SPRN_PVR ))) { +case POWER11 : +case POWER10 :for (i =0 ; i <ARRAY_SIZE (bhrb_filter_map_valid_p10); i++) { event.attr.branch_sample_type = bhrb_filter_map_valid_p10[i];FAIL_IF (event_open (&event));event_close (&event); } - }else { +break ; +default :for (i =0 ; i <ARRAY_SIZE (bhrb_filter_map_valid_p10); i++) { event.attr.branch_sample_type = bhrb_filter_map_valid_p10[i];FAIL_IF (!event_open (&event));
Signature · 1 line
2.43.5
Re: [PATCH V2 2/5] tools/testing/selftests/powerpc: Add check for power11 pvr for pmu selfests
On 13/01/25 1:28 pm, Athira Rajeev wrote:
Some of the tests depends on pvr value to choose the event. Example:
- event_alternatives_tests_p10: alternative event depends on registered PMU driver which is based on pvr
- generic_events_valid_test varies based on platform
- bhrb_filter_map_test: again its dependent on pmu to decide which bhrb filter to use
- reserved_bits_mmcra_sample_elig_mode: randome sampling mode reserved bits is also varies based on platform
I have tested the patches on PowerPC by compiling and running pmu selftest.
For the series:
---
Changelog:
v1 -> v2
No code changes. Rebased to latest upstream
.../pmu/event_code_tests/event_alternatives_tests_p10.c | 3 ++- .../pmu/event_code_tests/generic_events_valid_test.c | 3 ++- .../reserved_bits_mmcra_sample_elig_mode_test.c | 3 ++- .../powerpc/pmu/sampling_tests/bhrb_filter_map_test.c | 7 +++++-- 4 files changed, 11 insertions(+), 5 deletions(-)
tools/testing/selftests/powerpc/pmu/event_code_tests/event_alternatives_tests_p10.c +2 -1
@@ -26,6 +26,7 @@ static int event_alternatives_tests_p10(void) {struct event *e, events[5 ];int i; +int pvr =PVR_VER (mfspr (SPRN_PVR ));/* Check for platform support for the test */ SKIP_IF (platform_check_for_tests ());
@@ -36,7 +37,7 @@ static int event_alternatives_tests_p10(void)* code and using PVR will work correctly for all cases * including generic compat mode. */ -SKIP_IF (PVR_VER (mfspr (SPRN_PVR )) !=POWER10 ); +SKIP_IF ((pvr !=POWER10 ) && (pvr !=POWER11 ));SKIP_IF (check_for_generic_compat_pmu ());
tools/testing/selftests/powerpc/pmu/event_code_tests/generic_events_valid_test.c +2 -1
@@ -17,6 +17,7 @@static int generic_events_valid_test (void ) {struct event event; +int pvr =mfspr (SPRN_PVR );/* Check for platform support for the test */ SKIP_IF (platform_check_for_tests ());
@@ -31,7 +32,7 @@ static int generic_events_valid_test(void)* - PERF_COUNT_HW_STALLED_CYCLES_BACKEND * - PERF_COUNT_HW_REF_CPU_CYCLES */ -if (PVR_VER (mfspr (SPRN_PVR )) ==POWER10 ) { +if ((pvr ==POWER10 ) || (pvr ==POWER11 )) {event_init_opts (&event,PERF_COUNT_HW_CPU_CYCLES ,PERF_TYPE_HARDWARE ,"event" );FAIL_IF (event_open (&event));event_close (&event);
tools/testing/selftests/powerpc/pmu/event_code_tests/reserved_bits_mmcra_sample_elig_mode_test.c +2 -1
@@ -21,6 +21,7 @@static int reserved_bits_mmcra_sample_elig_mode (void ) {struct event event; +int pvr =PVR_VER (mfspr (SPRN_PVR ));/* Check for platform support for the test */ SKIP_IF (platform_check_for_tests ());
@@ -59,7 +60,7 @@ static int reserved_bits_mmcra_sample_elig_mode(void)* is reserved in power10 and 0xC is reserved in * power9. */ -if (PVR_VER (mfspr (SPRN_PVR )) ==POWER10 ) { +if ((pvr ==POWER10 ) || (pvr ==POWER11 )) {event_init (&event,0x100401e0 );FAIL_IF (!event_open (&event)); }else if (PVR_VER (mfspr (SPRN_PVR )) ==POWER9 ) {
tools/testing/selftests/powerpc/pmu/sampling_tests/bhrb_filter_map_test.c +5 -2
@@ -83,13 +83,16 @@ static int bhrb_filter_map_test(void)* using PVR will work correctly for all cases including generic * compat mode. */ -if (PVR_VER (mfspr (SPRN_PVR )) ==POWER10 ) { +switch (PVR_VER (mfspr (SPRN_PVR ))) { +case POWER11 : +case POWER10 :for (i =0 ; i <ARRAY_SIZE (bhrb_filter_map_valid_p10); i++) { event.attr.branch_sample_type = bhrb_filter_map_valid_p10[i];FAIL_IF (event_open (&event));event_close (&event); } - }else { +break ; +default :for (i =0 ; i <ARRAY_SIZE (bhrb_filter_map_valid_p10); i++) { event.attr.branch_sample_type = bhrb_filter_map_valid_p10[i];FAIL_IF (!event_open (&event));
PATCH v2 3/5 tools/testing/selftests/powerpc/pmu: Update comment description to mention ISA v3.1 for power10 and above
In reply to Athira RajeevUpdated the comments in the pmu selftests to include power11/ISA v3.1 where ever required.
---
Changelog:
v1 -> v2
No code changes. Rebased to latest upstream
.../event_code_tests/group_constraint_l2l3_sel_test.c | 2 +- .../group_constraint_radix_scope_qual_test.c | 2 +- .../group_constraint_thresh_cmp_test.c | 2 +- .../pmu/event_code_tests/invalid_event_code_test.c | 4 ++-- .../reserved_bits_mmcra_sample_elig_mode_test.c | 2 +- .../powerpc/pmu/sampling_tests/bhrb_filter_map_test.c | 10 +++++----- .../powerpc/pmu/sampling_tests/mmcra_bhrb_cond_test.c | 2 +- .../sampling_tests/mmcra_bhrb_disable_no_branch_test.c | 2 +- .../pmu/sampling_tests/mmcra_bhrb_disable_test.c | 2 +- .../pmu/sampling_tests/mmcra_bhrb_ind_call_test.c | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-)
tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_l2l3_sel_test.c +1 -1
@@ -30,7 +30,7 @@ static int group_constraint_l2l3_sel(void)/* * Check for platform support for the test. -* This test is only aplicable on power10 +* This test is only aplicable on ISA v3.1 */ SKIP_IF (platform_check_for_tests ());SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ));
tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_radix_scope_qual_test.c +1 -1
@@ -26,7 +26,7 @@ static int group_constraint_radix_scope_qual(void)/* * Check for platform support for the test. -* This test is aplicable on power10 only. +* This test is aplicable on ISA v3.1 only. */ SKIP_IF (platform_check_for_tests ());SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ));
tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_thresh_cmp_test.c +1 -1
@@ -25,7 +25,7 @@/* * Testcase for group constraint check of thresh_cmp bits which is * used to program thresh compare field in Monitor Mode Control Register A -* (MMCRA: 9-18 bits for power9 and MMCRA: 8-18 bits for power10). +* (MMCRA: 9-18 bits for power9 and MMCRA: 8-18 bits for power10/power11). * All events in the group should match thresh compare bits otherwise * event_open for the group will fail. */
tools/testing/selftests/powerpc/pmu/event_code_tests/invalid_event_code_test.c +2 -2
@@ -20,7 +20,7 @@* Some of the bits in the event code is * reserved for specific platforms. * Event code bits 52-59 are reserved in power9, -* whereas in power10, these are used for programming +* whereas in ISA v3.1, these are used for programming * Monitor Mode Control Register 3 (MMCR3). * Bit 9 in event code is reserved in power9, * whereas it is used for programming "radix_scope_qual"
@@ -39,7 +39,7 @@ static int invalid_event_code(void)/* * Events using MMCR3 bits and radix scope qual bits -* should fail in power9 and should succeed in power10. +* should fail in power9 and should succeed in power10 ( ISA v3.1 ) * Init the events and check for pass/fail in event open. */ if (have_hwcap2 (PPC_FEATURE2_ARCH_3_1 )) {
tools/testing/selftests/powerpc/pmu/event_code_tests/reserved_bits_mmcra_sample_elig_mode_test.c +1 -1
@@ -57,7 +57,7 @@ static int reserved_bits_mmcra_sample_elig_mode(void)/* * MMCRA Random Sampling Mode (SM) value 0x10 -* is reserved in power10 and 0xC is reserved in +* is reserved in power10/power11 and 0xC is reserved in * power9. */ if ((pvr ==POWER10 ) || (pvr ==POWER11 )) {
tools/testing/selftests/powerpc/pmu/sampling_tests/bhrb_filter_map_test.c +5 -5
@@ -14,7 +14,7 @@* A perf sampling test to check bhrb filter * map. All the branch filters are not supported * in powerpc. Supported filters in: -* power10: any, any_call, ind_call, cond +* power10/power11: any, any_call, ind_call, cond * power9: any, any_call * * Testcase checks event open for invalid bhrb filter
@@ -24,13 +24,13 @@*/ /* Invalid types for powerpc */ -/* Valid bhrb filters in power9/power10 */ +/* Valid bhrb filters in power9/power10/power11 */ int bhrb_filter_map_valid_common[] = {PERF_SAMPLE_BRANCH_ANY ,PERF_SAMPLE_BRANCH_ANY_CALL , }; -/* Valid bhrb filters in power10 */ +/* Valid bhrb filters in power10/power11 */ int bhrb_filter_map_valid_p10[] = {PERF_SAMPLE_BRANCH_IND_CALL ,PERF_SAMPLE_BRANCH_COND ,
@@ -69,7 +69,7 @@ static int bhrb_filter_map_test(void)FAIL_IF (!event_open (&event)); } -/* valid filter maps for power9/power10 which are expected to pass in event_open */ +/* valid filter maps for power9/power10/power11 which are expected to pass in event_open */ for (i =0 ; i <ARRAY_SIZE (bhrb_filter_map_valid_common); i++) { event.attr.branch_sample_type = bhrb_filter_map_valid_common[i];FAIL_IF (event_open (&event));
@@ -77,7 +77,7 @@ static int bhrb_filter_map_test(void) }/* -* filter maps which are valid in power10 and invalid in power9. +* filter maps which are valid in power10/power11 and invalid in power9. * PVR check is used here since PMU specific data like bhrb filter * alternative tests is handled by respective PMU driver code and * using PVR will work correctly for all cases including generic
tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_cond_test.c +1 -1
@@ -29,7 +29,7 @@ static int mmcra_bhrb_cond_test(void)/* * Check for platform support for the test. -* This test is only aplicable on power10 +* This test is only aplicable on ISA v3.1 */ SKIP_IF (check_pvr_for_sampling_tests ());SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ));
tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_disable_no_branch_test.c +1 -1
@@ -26,7 +26,7 @@ static int mmcra_bhrb_disable_no_branch_test(void)/* * Check for platform support for the test. -* This test is only aplicable on power10 +* This test is only aplicable on ISA v3.1 */ SKIP_IF (check_pvr_for_sampling_tests ());SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ));
tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_disable_test.c +1 -1
@@ -26,7 +26,7 @@ static int mmcra_bhrb_disable_test(void)/* * Check for platform support for the test. -* This test is only aplicable on power10 +* This test is only aplicable on ISA v3.1 */ SKIP_IF (check_pvr_for_sampling_tests ());SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ));
tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_ind_call_test.c +1 -1
@@ -29,7 +29,7 @@ static int mmcra_bhrb_ind_call_test(void)/* * Check for platform support for the test. -* This test is only aplicable on power10 +* This test is only aplicable on ISA v3.1 */ SKIP_IF (check_pvr_for_sampling_tests ());SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ));
Signature · 1 line
2.43.5
PATCH v2 4/5 selftests/powerpc/pmu: Add interface test for extended reg support
In reply to Athira RajeevFrom: Kajol Jain <[email protected]>
The testcase uses check_extended_regs_support and perf_get_platform_reg_mask function to check if the platform has extended reg support. This will help to check if sampling pmu selftest is enabled or not for a given platform.
---
Changelog:
v1 -> v2
No code changes. Rebased to latest upstream
.../powerpc/pmu/sampling_tests/Makefile | 3 +- .../sampling_tests/check_extended_reg_test.c | 35 +++++++++++++++++++ .../powerpc/pmu/sampling_tests/misc.c | 2 +- .../powerpc/pmu/sampling_tests/misc.h | 2 ++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/check_extended_reg_test.c
tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile +2 -1
@@ -5,7 +5,8 @@ TEST_GEN_PROGS := mmcr0_exceptionbits_test mmcr0_cc56run_test mmcr0_pmccext_test mmcr3_src_test mmcra_thresh_marked_sample_test mmcra_thresh_cmp_test \ mmcra_bhrb_ind_call_test mmcra_bhrb_any_test mmcra_bhrb_cond_test \ mmcra_bhrb_disable_test bhrb_no_crash_wo_pmu_test intr_regs_no_crash_wo_pmu_test \ - bhrb_filter_map_test mmcr1_sel_unit_cache_test mmcra_bhrb_disable_no_branch_test + bhrb_filter_map_test mmcr1_sel_unit_cache_test mmcra_bhrb_disable_no_branch_test \ + check_extended_reg_test top_srcdir = ../../../../../.. include ../../../lib.mk
tools/testing/selftests/powerpc/pmu/sampling_tests/check_extended_reg_test.c new file +35 -0
@@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Copyright 2024, Kajol Jain, IBM Corp. +*/ + +#include <stdio.h> +#include <stdlib.h> + +#include "../event.h" +#include "misc.h" +#include "utils.h" + +/* +* A perf sampling test to check extended +* reg support. +*/ +static int check_extended_reg_test (void ) +{ +/* Check for platform support for the test */ +SKIP_IF (!have_hwcap2 (PPC_FEATURE2_ARCH_3_00 )); + +/* Skip for Generic compat PMU */ +SKIP_IF (check_for_generic_compat_pmu ()); + +/* Check if platform supports extended regs */ + platform_extended_mask =perf_get_platform_reg_mask (); +FAIL_IF (check_extended_regs_support ()); + +return 0 ; +} + +int main (void ) +{ +return test_harness (check_extended_reg_test,"check_extended_reg_test" ); +}
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c +1 -1
@@ -92,7 +92,7 @@ static void init_ev_encodes(void) }/* Return the extended regs mask value */ -static u64 perf_get_platform_reg_mask (void ) +u64 perf_get_platform_reg_mask (void ) {if (have_hwcap2 (PPC_FEATURE2_ARCH_3_1 ))return PERF_POWER10_MASK ;
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h +2 -0
@@ -39,6 +39,8 @@ extern int pvr;extern u64 platform_extended_mask;extern int check_pvr_for_sampling_tests (void );extern int platform_check_for_tests (void ); +extern int check_extended_regs_support (void ); +extern u64 perf_get_platform_reg_mask (void );/* * Event code field extraction macro.
Signature · 1 line
2.43.5
PATCH v2 5/5 selftests/powerpc/pmu: Update comment with details to understand auxv_generic_compat_pmu() utility function
In reply to Athira Rajeevauxv_generic_compat_pmu() utility function is to detect whether the system is having generic compat PMU. The check is based on base platform value from /proc/self/auxv. Update the comment with details on how auxv is used to detect the platform.
---
Changelog:
v1 -> v2
New patch added in V2
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c | 7 +++++++ 1 file changed, 7 insertions(+)
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c +7 -0
@@ -497,6 +497,13 @@ int get_thresh_cmp_val(struct event event)* Utility function to check for generic compat PMU * by comparing base_platform value from auxv and real * PVR value. +* auxv_base_platform() func gives information of "base platform" +* corresponding to PVR value. Incase, if the distro doesn't +* support platform PVR (missing cputable support), base platform +* in auxv will have a default value other than the real PVR's. +* In this case, ISAv3 PMU (generic compat PMU) will be registered +* in the system. auxv_generic_compat_pmu() makes use of the base +* platform value from auxv to do this check. */ static bool auxv_generic_compat_pmu (void ) {
Signature · 1 line
2.43.5
Quoted 9 lines · Athira Rajeev
Add check for power11 pvr in the selftest utility functions. Selftests uses pvr value to check for platform support inorder to run the tests. pvr is also used to send the extended mask value to capture sampling registers.
Update some of the utility functions to use hwcap2 inorder to return platform specific bits from sampling registers.
[...]
Applied to powerpc/next.
[1/5] tools/testing/selftests/powerpc: Enable pmu selftests for power11
https://git.kernel.org/powerpc/c/fd4d2f325192a11b0bff8bf6226285a821bf38db [2/5] tools/testing/selftests/powerpc: Add check for power11 pvr for pmu selfests https://git.kernel.org/powerpc/c/520ee327c59d37c5520b177404f57c974cc098cc [3/5] tools/testing/selftests/powerpc/pmu: Update comment description to mention ISA v3.1 for power10 and above https://git.kernel.org/powerpc/c/43751c3ce276afc475fea769ae2abf690d5f4b91 [4/5] selftests/powerpc/pmu: Add interface test for extended reg support https://git.kernel.org/powerpc/c/9785def2593c7c62fa3271d740eef0e1d1874ef4 [5/5] selftests/powerpc/pmu: Update comment with details to understand auxv_generic_compat_pmu() utility function https://git.kernel.org/powerpc/c/c96b1402cc8fe818b0aaaee280221a5e7b6b2242
Thanks