projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c82d28c
)
KVM: arm64: PMU: Narrow the overflow checking when required
author
Marc Zyngier
<maz@kernel.org>
Sun, 13 Nov 2022 16:38:21 +0000
(16:38 +0000)
committer
Marc Zyngier
<maz@kernel.org>
Thu, 17 Nov 2022 15:39:51 +0000
(15:39 +0000)
For 64bit counters that overflow on a 32bit boundary, make
sure we only check the bottom 32bit to generate a CHAIN event.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Reiji Watanabe <reijiw@google.com>
Link:
https://lore.kernel.org/r/20221113163832.3154370-6-maz@kernel.org
arch/arm64/kvm/pmu-emul.c
patch
|
blob
|
history
diff --git
a/arch/arm64/kvm/pmu-emul.c
b/arch/arm64/kvm/pmu-emul.c
index d050143326b582526712307bb8a8eaa67d51dad6..9e6bc7edc4de0ab4ef91116a34270ed3e75593a2 100644
(file)
--- a/
arch/arm64/kvm/pmu-emul.c
+++ b/
arch/arm64/kvm/pmu-emul.c
@@
-417,7
+417,8
@@
static void kvm_pmu_counter_increment(struct kvm_vcpu *vcpu,
reg = lower_32_bits(reg);
__vcpu_sys_reg(vcpu, PMEVCNTR0_EL0 + i) = reg;
- if (reg) /* No overflow? move on */
+ /* No overflow? move on */
+ if (kvm_pmu_idx_has_64bit_overflow(vcpu, i) ? reg : lower_32_bits(reg))
continue;
/* Mark overflow */