]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: KVM: Fix to allow hpmcounter31 from the guest
authorAtish Patra <atishp@rivosinc.com>
Fri, 16 Aug 2024 07:08:09 +0000 (00:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:28:51 +0000 (16:28 +0200)
commit032ca566f58971dab57f4e4d4d9663bb5393323f
tree273536191c7898249b1557472b6e4e6389a368cb
parent3c39f253e2c989e4d4aee58d0e33d6f79317bf33
RISC-V: KVM: Fix to allow hpmcounter31 from the guest

[ Upstream commit 5aa09297a3dcc798d038bd7436f8c90f664045a6 ]

The csr_fun defines a count parameter which defines the total number
CSRs emulated in KVM starting from the base. This value should be
equal to total number of counters possible for trap/emulation (32).

Fixes: a9ac6c37521f ("RISC-V: KVM: Implement trap & emulate for hpmcounters")
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20240816-kvm_pmu_fixes-v1-2-cdfce386dd93@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/include/asm/kvm_vcpu_pmu.h