Commit b994cdf
drivers/perf: riscv: Fix counter mask iteration for RV32
For RV32, used_hw_ctrs can have more than 1 word if the firmware chooses
to interleave firmware/hardware counters indicies. Even though it's a
unlikely scenario, handle that case by iterating over all the words
instead of just using the first word.
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20240420151741.962500-9-atishp@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>1 parent b737fc2 commit b994cdf
1 file changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| 655 | + | |
655 | 656 | | |
656 | | - | |
657 | | - | |
658 | | - | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
659 | 661 | | |
660 | 662 | | |
661 | 663 | | |
| |||
667 | 669 | | |
668 | 670 | | |
669 | 671 | | |
670 | | - | |
| 672 | + | |
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
| |||
676 | 678 | | |
677 | 679 | | |
678 | 680 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
684 | 687 | | |
685 | 688 | | |
686 | 689 | | |
| |||
0 commit comments