RISC-V: KVM: Fix the initial sample period value
authorAtish Patra <atishp@rivosinc.com>
Sat, 20 Apr 2024 15:17:26 +0000 (08:17 -0700)
committerAnup Patel <anup@brainfault.org>
Fri, 26 Apr 2024 07:43:42 +0000 (13:13 +0530)
commit57990ab90ce31aadac0d5a6293f5582e24ff7521
treee6fe6a9574a32f7b55d0def4f18670634c7e21be
parenta8625217a054ca058cf74742e58c2c88460eb202
RISC-V: KVM: Fix the initial sample period value

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@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20240420151741.962500-11-atishp@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu_pmu.c