Re: [PATCH v1 2/2] perf: RISC-V: store available counter mask as bitmap
From: Paul Walmsley
Date: Fri Aug 07 2026 - 20:32:43 EST
Hi,
On Fri, 7 Aug 2026, Xixin Liu wrote:
> The available-counter mask was a single unsigned long, but iteration
> uses RISCV_MAX_COUNTERS (64). On RV32 that reads past the object. Filling
> with BIT(i) is also wrong for i >= 32.
>
> Use DECLARE_BITMAP, set_bit/bitmap helpers, and stop counters one word
> at a time.
>
> Signed-off-by: Xixin Liu <liuxixin@xxxxxxxxxx>
This patch contains several array indexes to element 0 of the cmask
bitmap, but that element is going to be XLEN bits wide. Does that
actually work on RV32 systems?
- Paul