arm: pmu-overflow-interrupt: Fix failures on Amberwing
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 4 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | arm: pmu: Declare pmu_stats as volatilearm/ | +1 | 2 replies | |
| 2/2 | arm: pmu-overflow-interrupt: Increase count valuesarm/ | +6 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Shaoqin Huang | Alexandru Elisei |
|---|---|---|
| 1/2 | R-b | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [kvm-unit-tests PATCH v2 0/2] arm: pmu-overflow-interrupt: Fix failures on Amberwing
On Qualcomm Amberwing, some pmu-overflow-interrupt failures can be observed. Although the even counter overflows, the interrupt is not seen as expected on guest side. This happens in the subtest after "promote to 64-b" comment.
After analysis, the PMU overflow interrupt actually hits, ie. kvm_pmu_perf_overflow() gets called and KVM_REQ_IRQ_PENDING is set, as expected. However the PMCR.E is reset by the handle_exit path, at kvm_pmu_handle_pmcr() before the next guest entry and kvm_pmu_flush_hwstate/kvm_pmu_update_state subsequent call. There, since the enable bit has been reset, kvm_pmu_update_state() does not inject the interrupt into the guest.
This does not seem to be a KVM bug but rather an unfortunate scenario where the test disables the PMCR.E too closely to the advent of the overflow interrupt.
Since it looks like a benign and inlikely case, let's resize the number of iterations to prevent the PMCR enable bit from being resetted immediately at the same time as the actual overflow event.
Also make pmu_stats volatile to prevent any optimizations.
Eric Auger (2):
arm: pmu: Declare pmu_stats as volatile
arm: pmu-overflow-interrupt: Increase count values
arm/pmu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
2.41.0