PR sync from: Junhao He hejunhao3@huawei.com
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/X22NWL7OKQ2OHRRYCASHNRQRWEUHAEKV/
counting of PMU events depending on how much the event increments on
a single cycle. Two new config fields for perf_event_open have been
added, and a PMU cap file for reading the max_threshold. See the second
commit message and the docs in the last commit for more details.

The feature is not currently supported on KVM guests, and PMMIR is set
to read as zero, so it's not advertised as available. But it can be
added at a later time. Writes to PMEVTYPER.TC and TH from guests are
already RES0.

Zero values, works as expected (as before).

$ perf stat -e dtlb_walk/threshold=0,threshold_compare=0/ -- true

5962      dtlb_walk/threshold=0,threshold_compare=0/

Threshold >= 255 causes count to be 0 because dtlb_walk doesn't

increase by more than 1 per cycle.

$ perf stat -e dtlb_walk/threshold=255,threshold_compare=2/ -- true

0      dtlb_walk/threshold=255,threshold_compare=2/

Keeping comparison as >= but lowering the threshold to 1 makes the

count return.

$ perf stat -e dtlb_walk/threshold=1,threshold_compare=2/ -- true

6329      dtlb_walk/threshold=1,threshold_compare=2/

Anshuman Khandual (3):
drivers: perf: arm_pmuv3: Read PMMIR_EL1 unconditionally
drivers: perf: arm_pmuv3: Drop some unused arguments from
armv8_pmu_init()
drivers: perf: arm_pmuv3: Add new macro PMUV3_INIT_MAP_EVENT()

James Clark (11):
arm: perf: Remove inlines from arm_pmuv3.c
arm: perf/kvm: Use GENMASK for ARMV8_PMU_PMCR_N
arm: perf: Use GENMASK for PMMIR fields
arm: perf: Convert remaining fields to use GENMASK
arm64: perf: Include threshold control fields in PMEVTYPER mask
arm: pmu: Share user ABI format mechanism with SPE
perf/arm_dmc620: Remove duplicate format attribute #defines
arm: pmu: Move error message and -EOPNOTSUPP to individual PMUs
arm64: perf: Add support for event counting threshold
Documentation: arm64: Document the PMU event counting threshold
feature
arm: perf: Fix ARCH=arm build with GCC

Oliver Upton (2):
KVM: arm64: Make PMEVTYPER_EL0.NSH RES0 if EL2 isn't advertised
KVM: arm64: Add PMU event filter bits required if EL3 is implemented

Reiji Watanabe (1):
KVM: arm64: PMU: Add a helper to read a vCPU's PMCR_EL0

Will Deacon (1):
Revert "perf/arm_dmc620: Remove duplicate format attribute #defines"

--
2.33.0

#I9Q7QP:arm64: perf: Add support for event counting threshold