Re: [PATCH v8 18/22] RISC-V: perf: Add Qemu virt machine events

From: Charlie Jenkins

Date: Mon Jul 20 2026 - 03:27:00 EST


On Wed, 01 Jul 2026 01:47:06 -0700, Atish Patra <atish.patra@xxxxxxxxx> wrote:
> Qemu virt machine supports a very minimal set of legacy perf events.
> Add them to the vendor table so that users can use them when
> counter delegation is enabled.
>
> Qemu is identified by its marchid. Older Qemu reports all-zero
> mvendorid/marchid/mimpid, while newer Qemu reports the marchid 0x2a (42)
> allocated to it in the RISC-V ISA manual [1]. Register the events for
> both ids so they are available across Qemu versions.
>
> [1] https://github.com/riscv/riscv-isa-manual/blob/main/marchid.md

Thanks for doing this.

Reviewed-by: Charlie Jenkins <thecharlesjenkins@xxxxxxxxx>
Tested-by: Charlie Jenkins <thecharlesjenkins@xxxxxxxxx>

--
- Charlie