Skip to content

Commit 2265c08

Browse files
benhor01Marc Zyngier
authored andcommitted
KVM: arm64: Fix enforcement of upper bound on MDCR_EL2.HPMN
Previously, u64_replace_bits() was used to no effect as the return value was ignored. Convert to u64p_replace_bits() so the value is updated in place. Reviewed-by: Zenghui Yu <[email protected]> Signed-off-by: Ben Horgan <[email protected]> Fixes: efff9dd ("KVM: arm64: Handle out-of-bound write to MDCR_EL2.HPMN") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 42ce432 commit 2265c08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ static bool access_mdcr(struct kvm_vcpu *vcpu,
26242624
*/
26252625
if (hpmn > vcpu->kvm->arch.nr_pmu_counters) {
26262626
hpmn = vcpu->kvm->arch.nr_pmu_counters;
2627-
u64_replace_bits(val, hpmn, MDCR_EL2_HPMN);
2627+
u64p_replace_bits(&val, hpmn, MDCR_EL2_HPMN);
26282628
}
26292629

26302630
__vcpu_assign_sys_reg(vcpu, MDCR_EL2, val);

0 commit comments

Comments
 (0)