This is a note to let you know that I've just added the patch titled RISC-V: KVM: Fix the initial sample period value to the 6.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: risc-v-kvm-fix-the-initial-sample-period-value.patch and it can be found in the queue-6.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 9361ebd01bd5d9cf88c0acaf1b9cd36f4bb7c77e Author: Atish Patra <atishp@xxxxxxxxxxxx> Date: Sat Apr 20 08:17:26 2024 -0700 RISC-V: KVM: Fix the initial sample period value [ Upstream commit 57990ab90ce31aadac0d5a6293f5582e24ff7521 ] The initial sample period value when counter value is not assigned should be set to maximum value supported by the counter width. Otherwise, it may result in spurious interrupts. Reviewed-by: Andrew Jones <ajones@xxxxxxxxxxxxxxxx> Signed-off-by: Atish Patra <atishp@xxxxxxxxxxxx> Reviewed-by: Anup Patel <anup@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20240420151741.962500-11-atishp@xxxxxxxxxxxx Signed-off-by: Anup Patel <anup@xxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/arch/riscv/kvm/vcpu_pmu.c b/arch/riscv/kvm/vcpu_pmu.c index 86391a5061dda..cee1b9ca4ec48 100644 --- a/arch/riscv/kvm/vcpu_pmu.c +++ b/arch/riscv/kvm/vcpu_pmu.c @@ -39,7 +39,7 @@ static u64 kvm_pmu_get_sample_period(struct kvm_pmc *pmc) u64 sample_period; if (!pmc->counter_val) - sample_period = counter_val_mask + 1; + sample_period = counter_val_mask; else sample_period = (-pmc->counter_val) & counter_val_mask;