Commit 0224353
Marc Zyngier
KVM: arm64: Contextualise the handling of PMCR_EL0.P writes
Contrary to what the comment says in kvm_pmu_handle_pmcr(),
writing PMCR_EL0.P==1 has the following effects:
<quote>
The event counters affected by this field are:
* All event counters in the first range.
* If any of the following are true, all event counters in the second
range:
- EL2 is disabled or not implemented in the current Security state.
- The PE is executing at EL2 or EL3.
</quote>
where the "first range" represent the counters in the [0..HPMN-1]
range, and the "second range" the counters in the [HPMN..MAX] range.
It so appears that writing P from EL2 should nuke all counters,
and not just the "guest" view. Just do that, and nuke the misleading
comment.
Reported-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>1 parent c8823e5 commit 0224353
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | 611 | | |
616 | | - | |
617 | 612 | | |
618 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
619 | 617 | | |
620 | 618 | | |
621 | 619 | | |
| |||
0 commit comments