[PATCH v8 08/24] drivers/perf: riscv: Fix counter mask iteration for RV32