aboutsummaryrefslogtreecommitdiff
path: root/scripts/Kconfiglib/kconfiglib.py
diff options
context:
space:
mode:
authorSergey Matyukevich <geomatsi@gmail.com>2022-06-24 14:03:30 +0300
committerAnup Patel <anup@brainfault.org>2022-06-25 08:44:20 +0530
commit3f66465fb6bf0aea99f7dbe5801996dec9605d3c (patch)
treeaa3137ecc8adabcf1c051003a99dfe47f40ebe8c /scripts/Kconfiglib/kconfiglib.py
parentc6fdbcf83fc350d8b1f12ada228e677df931291c (diff)
downloadopensbi-3f66465fb6bf0aea99f7dbe5801996dec9605d3c.zip
opensbi-3f66465fb6bf0aea99f7dbe5801996dec9605d3c.tar.gz
opensbi-3f66465fb6bf0aea99f7dbe5801996dec9605d3c.tar.bz2
lib: pmu: allow to use the highest available counter
OpenSBI explicitly assumes that there is no pmu hardware counter with index 1: hardware uses that bit for TM control. So OpenSBI filters out that index in sanity checks. However OpenSBI also excludes that counter when reports total amount of hardware counters to Linux. As a result, Linux uses incomplete counters mask excluding the highest available counter. Return accurate number of counters, update the firmware counter starting index, fix range checks that include num_hw_ctrs. The simple test is to make sure that there is no counter multiplexing in the following command: $ perf stat -e \ r8000000000000000,r8000000000000001,r8000000000000002,r8000000000000003, \ r8000000000000004,r8000000000000005,r8000000000000006,r8000000000000007, \ r8000000000000008,r8000000000000009,r800000000000000a,r800000000000000b, \ r800000000000000c,r800000000000000d,r800000000000000e,r800000000000000f \ ls Note that 16 firmware events with 16 counters won't require multiplexing. Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com> Signed-off-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'scripts/Kconfiglib/kconfiglib.py')
0 files changed, 0 insertions, 0 deletions