<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-02-11T06:03:51Z</updated>
<entry>
<title>selftests/powerpc/pmu: Add interface test for extended reg support</title>
<updated>2025-02-11T06:03:51Z</updated>
<author>
<name>Kajol Jain</name>
</author>
<published>2025-01-13T07:58:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9785def2593c7c62fa3271d740eef0e1d1874ef4'/>
<id>urn:sha1:9785def2593c7c62fa3271d740eef0e1d1874ef4</id>
<content type='text'>
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.

Signed-off-by: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Madhavan Srinivasan &lt;maddy@linux.ibm.com&gt;
Link: https://patch.msgid.link/20250113075858.45137-4-atrajeev@linux.vnet.ibm.com

</content>
</entry>
<entry>
<title>tools/testing/selftests/powerpc: Enable pmu selftests for power11</title>
<updated>2025-02-11T06:03:51Z</updated>
<author>
<name>Athira Rajeev</name>
</author>
<published>2025-01-13T07:58:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd4d2f325192a11b0bff8bf6226285a821bf38db'/>
<id>urn:sha1:fd4d2f325192a11b0bff8bf6226285a821bf38db</id>
<content type='text'>
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.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Madhavan Srinivasan &lt;maddy@linux.ibm.com&gt;
Link: https://patch.msgid.link/20250113075858.45137-1-atrajeev@linux.vnet.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc: Add more utility macros</title>
<updated>2023-06-19T07:36:27Z</updated>
<author>
<name>Benjamin Gray</name>
</author>
<published>2023-06-19T07:36:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b9125c9aa043a7556626e1aafb3190c61c1e2b2b'/>
<id>urn:sha1:b9125c9aa043a7556626e1aafb3190c61c1e2b2b</id>
<content type='text'>
Adds _MSG assertion variants to provide more context behind why a
failure occurred. Also include unistd.h for _exit() and stdio.h for
fprintf(), and move ARRAY_SIZE macro to utils.h.

The _MSG variants and ARRAY_SIZE will be used by the following
DEXCR selftests.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Reviewed-by: Russell Currey &lt;ruscur@russell.cc&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230616034846.311705-10-bgray@linux.ibm.com
</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Refactor the platform check and add macros to find array size/PVR</title>
<updated>2022-06-28T22:57:39Z</updated>
<author>
<name>Athira Rajeev</name>
</author>
<published>2022-06-10T13:40:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cfd110a36649f9452120a648f15f32d1c82b99d'/>
<id>urn:sha1:9cfd110a36649f9452120a648f15f32d1c82b99d</id>
<content type='text'>
The platform check for selftest support "check_pvr_for_sampling_tests"
is specific to sampling tests which includes PVR check, presence of
PMU and extended regs support. Extended regs support is needed for
sampling tests which tests whether PMU registers are programmed
correctly. There could be other sampling tests which may not need
extended regs, example, bhrb filter tests which only needs validity
check via event open.

Hence refactor the platform check to have a common function
"platform_check_for_tests" that checks only for PVR check
and presence of PMU. The existing function
"check_pvr_for_sampling_tests" will invoke the common function
and also will include checks for extended regs specific for
sampling. The common function can also be used by tests other
than sampling like event code tests.

Add macro to find array size ("ARRAY_SIZE") to sampling
tests "misc.h" file. This can be used in next tests to
find event array size. Also update "include/reg.h" to
add macros to find minor and major version from PVR which
will be used in testcases.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220610134113.62991-10-atrajeev@linux.vnet.ibm.com
</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add interface test for bhrb disable field</title>
<updated>2022-06-28T13:57:56Z</updated>
<author>
<name>Kajol Jain</name>
</author>
<published>2022-06-10T13:40:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84cc4e66d90f6624f821df381073813dd502f657'/>
<id>urn:sha1:84cc4e66d90f6624f821df381073813dd502f657</id>
<content type='text'>
The testcase uses "instructions" event to generate the
samples and fetch Monitor Mode Control Register A (MMCRA)
when overflow. Branch History Rolling Buffer(bhrb) disable bit
is part of MMCRA which need to be verified by perf interface.
Testcase checks if the bhrb disable bit of MMCRA register is
programmed correctly via perf interface for ISA v3.1 platform
Also make get_mmcra_ifm return type as u64.

Signed-off-by: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220610134113.62991-9-atrajeev@linux.vnet.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc: Add support to fetch "platform" and "base platform" from auxv to detect platform.</title>
<updated>2022-06-28T13:56:46Z</updated>
<author>
<name>Athira Rajeev</name>
</author>
<published>2022-06-10T13:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a069b5f980e3b65b64b6322b71d5819f90dbb42b'/>
<id>urn:sha1:a069b5f980e3b65b64b6322b71d5819f90dbb42b</id>
<content type='text'>
The /proc/self/auxv contains information about "platform" on any system.
Also "base platform" which is an indication about platform string
corresponding to the real PVR. When systems are booted in compat mode,
say, power10 booted in power9 mode, "platform" will point to power9
whereas base platform will point to power10. Incase, if the distro
doesn't support platform indicated by real PVR, base platform will have
a default value.

The mismatch of platform/base platform is an indication of system booted
in compat mode. In such cases, distro will have a Generic Compat
registered which supports basic features for performance monitoring.

Some of the selftest needs to be handled differently ( ex: generic
events, alternative events, bhrb filter map) in Generic Compat PMU.
Hence selftest framework needs utility functions to identify such cases.
One way is make sure of auxv information. Below condition can be used to
detect if Generic Compat PMU is registered. ie:

  if ((AT_PLATFORM != AT_BASE_PLATFORM) &amp;&amp; (AT_BASE_PLATFORM != PVR))

this indicates Generic Compat PMU.

Add utility function in "include/utils.h" to return:
AT_PLATFORM and AT_BASE_PLATFORM from auxv. Also update misc.c in
"sampling_tests" folder to add function to use above check to determine
presence of generic compat pmu.

In other architecture ( like x86 ), pmu_name is exposed via
"/sys/bus/event_source/devices/cpu/caps". The same could be used in
powerpc in future. Since currently we don't have the "caps" support in
powerpc, patch uses auxv information to detect platform type and compat
mode. But as placeholder utility function is added considering
possiblity of getting "caps" information via sysfs. If that doesn't
exist, fallback to using auxv information.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220610134113.62991-3-atrajeev@linux.vnet.ibm.com
</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add mask/shift bits for extracting threshold compare field</title>
<updated>2022-06-28T13:56:37Z</updated>
<author>
<name>Kajol Jain</name>
</author>
<published>2022-06-10T13:40:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42e0576eec75479fa7709c41e5c3b9ec556b8f4d'/>
<id>urn:sha1:42e0576eec75479fa7709c41e5c3b9ec556b8f4d</id>
<content type='text'>
In power10, threshold compare field is not part of the raw event code
and provided via event attribute config1. Hence add the mask and shift
bits based on event attribute config1, to extract the threshold compare
value for power10

Also add a new function called get_thresh_cmp_val to compute and return
the threshold compare field for a given platform, since incase of
power10, threshold compare value provided is decimal.

Signed-off-by: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220610134113.62991-2-atrajeev@linux.vnet.ibm.com
</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add macro to extract mmcr3 and mmcra fields</title>
<updated>2022-03-01T12:38:13Z</updated>
<author>
<name>Kajol Jain</name>
</author>
<published>2022-01-27T07:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13307f9584ea9408d9959302074dc4e8308b6cab'/>
<id>urn:sha1:13307f9584ea9408d9959302074dc4e8308b6cab</id>
<content type='text'>
Add macro and utility functions to fetch individual fields from Monitor
Mode Control Register 3(MMCR3)and Monitor Mode Control Register A(MMCRA)
PMU registers

Signed-off-by: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220127072012.662451-9-kjain@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add macro to extract mmcr0/mmcr1 fields</title>
<updated>2022-03-01T12:38:13Z</updated>
<author>
<name>Athira Rajeev</name>
</author>
<published>2022-01-27T07:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b49e641063e7569493371ef433b9c4ce8c8dd8b'/>
<id>urn:sha1:2b49e641063e7569493371ef433b9c4ce8c8dd8b</id>
<content type='text'>
Add macro and utility functions to fetch individual fields from Monitor
Mode Control Register 0(MMCR0) and Monitor Mode Control Register
1(MMCR1) PMU register.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220127072012.662451-8-kjain@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add macros to extract mmcr fields</title>
<updated>2022-03-01T12:38:13Z</updated>
<author>
<name>Madhavan Srinivasan</name>
</author>
<published>2022-01-27T07:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79c4e6aba8dfc9206acc68884498080f451121f7'/>
<id>urn:sha1:79c4e6aba8dfc9206acc68884498080f451121f7</id>
<content type='text'>
Along with it, Add macros and utility functions to fetch individual
fields from Monitor Mode Control Register 2(MMCR2) register.

Signed-off-by: Madhavan Srinivasan &lt;maddy@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220127072012.662451-7-kjain@linux.ibm.com

</content>
</entry>
</feed>
