diff options
| author | Jiakai Xu <xujiakai2025@iscas.ac.cn> | 2026-03-16 01:45:33 +0000 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-03-27 20:02:11 +0530 |
| commit | 198c7ce9801abd63c44176c3f034577b887c0070 (patch) | |
| tree | c5f105db5ef665473b265b3e0edb6ce110b54806 /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | 99594f75b49edc7046057bca06d892c16967a9b3 (diff) | |
RISC-V: KVM: selftests: Fix firmware counter read in sbi_pmu_test
The current sbi_pmu_test attempts to read firmware counters without
configuring them first with SBI_EXT_PMU_COUNTER_CFG_MATCH.
Previously this did not fail because KVM incorrectly allowed the read
and accessed fw_event[] with an out-of-bounds index when the counter
was unconfigured. After fixing that bug, the read now correctly returns
SBI_ERR_INVALID_PARAM, causing the selftest to fail.
Update the test to configure a firmware event before reading the
counter. Also add a negative test to ensure that attempting to read an
unconfigured firmware counter fails gracefully.
Signed-off-by: Jiakai Xu <xujiakai2025@iscas.ac.cn>
Signed-off-by: Jiakai Xu <jiakaiPeanut@gmail.com>
Reviewed-by: Andrew Jones <andrew.jones@oss.qualcomm.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Link: https://lore.kernel.org/r/20260316014533.2312254-3-xujiakai2025@iscas.ac.cn
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
