[PATCH v2 0/3] KVM: riscv: add check_supported_reg() into get-reg-list test

Yong-Xuan Wang posted 3 patches 1 week, 5 days ago
There is a newer version of this series
arch/riscv/include/asm/kvm_vcpu_sbi_fwft.h       |   1 -
arch/riscv/kvm/vcpu_sbi_fwft.c                   |  17 ++-
tools/testing/selftests/kvm/riscv/get-reg-list.c | 172 +++++++++++++++--------
3 files changed, 119 insertions(+), 71 deletions(-)
[PATCH v2 0/3] KVM: riscv: add check_supported_reg() into get-reg-list test
Posted by Yong-Xuan Wang 1 week, 5 days ago
This series addresses a bug in the SBI FWFT (Firmware Features) extension
where features could remain exposed to guests after their dependent ISA
extensions are disabled at runtime, and improves the related selftest
infrastructure.

The bug (patch 1) occurred because FWFT feature support was cached at vCPU
initialization time. When userspace subsequently disabled ISA extensions
via KVM ONE_REG, the cached support status was not updated, leading to
stale feature exposure.

The selftest improvements (patches 2-3) enhance the get-reg-list test by
refactoring the extension sublist infrastructure and splitting FWFT
feature testing into separate, properly-gated sublists.

---
Changes in v2:
- Fix FWFT stale feature exposure by removing static 'supported' field
- Refactor get-reg-list test to use unified extension sublist macros
- Split FWFT testing into per-feature sublists with runtime checks
(Andrew)

To: Anup Patel <anup@brainfault.org>
To: Atish Patra <atish.patra@linux.dev>
To: Paul Walmsley <pjw@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
To: Albert Ou <aou@eecs.berkeley.edu>
To: Alexandre Ghiti <alex@ghiti.fr>
To: Clément Léger <cleger@rivosinc.com>
To: Andrew Jones <ajones@ventanamicro.com>
To: Paolo Bonzini <pbonzini@redhat.com>
To: Shuah Khan <shuah@kernel.org>
Cc: greentime.hu@sifive.com
Cc: vincent.chen@sifive.com
Cc: zong.li@sifive.com
Cc: kvm@vger.kernel.org
Cc: kvm-riscv@lists.infradead.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org

---
Yong-Xuan Wang (3):
      KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes
      KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros
      KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists

 arch/riscv/include/asm/kvm_vcpu_sbi_fwft.h       |   1 -
 arch/riscv/kvm/vcpu_sbi_fwft.c                   |  17 ++-
 tools/testing/selftests/kvm/riscv/get-reg-list.c | 172 +++++++++++++++--------
 3 files changed, 119 insertions(+), 71 deletions(-)
---
base-commit: c7832534a8160276cccb9a8cc8cafb5614c579d0
change-id: 20260526-kvm-get_reg_list-v2-f9f36961ac6c