[PATCH v1 0/3] RISC-V: KVM: Fix PMU counter handling issues

SeungJu Cheon posted 3 patches 1 month ago
arch/riscv/kvm/vcpu_pmu.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
[PATCH v1 0/3] RISC-V: KVM: Fix PMU counter handling issues
Posted by SeungJu Cheon 1 month ago
This series fixes three issues in the KVM RISC-V PMU implementation:

- preserve firmware counter values across stop/start;
- report failures when writing snapshot data to guest memory; and
- fix perf-backed counter accounting across read and stop.

The changes were tested with the existing KVM RISC-V SBI PMU selftests
and additional tests covering the affected stop/start, snapshot failure,
and repeated read paths.

SeungJu Cheon (3):
  RISC-V: KVM: Preserve firmware counter value across stop/start
  RISC-V: KVM: Report snapshot write failure to the guest
  RISC-V: KVM: Fix perf-backed counter accounting across stop and read

 arch/riscv/kvm/vcpu_pmu.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)


base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b
-- 
2.52.0
Re: [PATCH v1 0/3] RISC-V: KVM: Fix PMU counter handling issues
Posted by Anup Patel 2 weeks ago
On Tue, Aug 25, 2026 at 2:07 PM SeungJu Cheon <suunj1331@gmail.com> wrote:
>
> This series fixes three issues in the KVM RISC-V PMU implementation:
>
> - preserve firmware counter values across stop/start;
> - report failures when writing snapshot data to guest memory; and
> - fix perf-backed counter accounting across read and stop.
>
> The changes were tested with the existing KVM RISC-V SBI PMU selftests
> and additional tests covering the affected stop/start, snapshot failure,
> and repeated read paths.
>
> SeungJu Cheon (3):
>   RISC-V: KVM: Preserve firmware counter value across stop/start
>   RISC-V: KVM: Report snapshot write failure to the guest
>   RISC-V: KVM: Fix perf-backed counter accounting across stop and read
>
>  arch/riscv/kvm/vcpu_pmu.c | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
>
>
> base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b
> --
> 2.52.0
>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Queued these patches as fixes for Linux-7.3-rcX

Thanks,
Anup