[PW_SID:1101400] KVM: riscv: add check_supported_reg() into get-reg-list test#2022
[PW_SID:1101400] KVM: riscv: add check_supported_reg() into get-reg-list test#2022linux-riscv-bot wants to merge 3 commits into
Conversation
…sion changes Fix a bug where FWFT features could be incorrectly exposed to guests after userspace disables their dependent ISA extensions at runtime. The 'supported' field in kvm_sbi_fwft_config was set once during vCPU initialization based on the initial hardware/extension availability. However, when userspace subsequently disables ISA extensions via the KVM ONE_REG interface, the 'supported' field was not updated. This caused the following issues: 1. FWFT features would remain visible and accessible to guests even after their prerequisite ISA extensions were disabled 2. Guests could configure FWFT features that depend on disabled extensions, leading to undefined behavior 3. The static 'supported' flag and the dynamic supported() callback could disagree about feature availability Remove the redundant static 'supported' field from kvm_sbi_fwft_config and replace all conf->supported checks with feature->supported(vcpu) calls that check the current vCPU ISA extension state. This can ensure the feature availability is always determined at runtime based on the current configuration, not initialization-time snapshots. Fixes: 6b72fd1 ("RISC-V: KVM: add support for FWFT SBI extension") Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Refactor the get-reg-list test to use unified sublist macros for ISA and SBI extensions, eliminating code duplication and improving maintainability. Previously, each extension had its own hand-coded sublist definition (e.g., SUBLIST_ZICBOM, SUBLIST_AIA, etc.) and the config structures repeated the same pattern. This made the code verbose and error-prone. Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…sublists Divide the monolithic SBI FWFT (Firmware Features) register list into separate sublists, each testing a specific FWFT feature independently with proper dependency checking. Previously, all FWFT features were tested together in a single sublist. This caused issues because: 1. Not all FWFT features are available on all platforms 2. Some features depend on specific ISA extensions (e.g., pointer_masking requires Smnpm) 3. Tests would fail if any single feature was unavailable Add the feature-specific SBI FWFT sublists with the following improvements: - Add check_supported_reg() function to validate register availability based on required ISA extensions - Add check_fwft_feature() helper to verify FWFT feature availability at runtime - Update filter_reg() to handle per-feature FWFT register filtering Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 1: "[v2,1/3] KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 2: "[v2,2/3] KVM: riscv: selftests: Refactor ISA and SBI extension sublist macros" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
|
Patch 3: "[v2,3/3] KVM: riscv: selftests: Split SBI FWFT into separate feature-specific sublists" |
PR for series 1101400 applied to workflow__riscv__fixes
Name: KVM: riscv: add check_supported_reg() into get-reg-list test
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1101400
Version: 2