|
|
Log in / Subscribe / Register

RISC-V: KVM: Add Svadu/Zicfiss/Zicfilp FWFT support

From:  Inochi Amaoto <inochiama-AT-gmail.com>
To:  Paul Walmsley <pjw-AT-kernel.org>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Albert Ou <aou-AT-eecs.berkeley.edu>, Alexandre Ghiti <alex-AT-ghiti.fr>, Anup Patel <anup-AT-brainfault.org>, Atish Patra <atish.patra-AT-linux.dev>, Paolo Bonzini <pbonzini-AT-redhat.com>, Shuah Khan <shuah-AT-kernel.org>, Thomas Huth <thuth-AT-redhat.com>, Deepak Gupta <debug-AT-rivosinc.com>, Inochi Amaoto <inochiama-AT-gmail.com>, Charlie Jenkins <charlie-AT-rivosinc.com>, Sergey Matyukevich <geomatsi-AT-gmail.com>
Subject:  [PATCH v3 0/8] RISC-V: KVM: Add Svadu/Zicfiss/Zicfilp FWFT support
Date:  Sun, 07 Jun 2026 16:10:56 +0800
Message-ID:  <20260607081105.993908-1-inochiama@gmail.com>
Cc:  linux-riscv-AT-lists.infradead.org, linux-kernel-AT-vger.kernel.org, kvm-AT-vger.kernel.org, kvm-riscv-AT-lists.infradead.org, linux-kselftest-AT-vger.kernel.org, Yixun Lan <dlan-AT-gentoo.org>, Longbin Li <looong.bin-AT-gmail.com>
Archive-link:  Article

This patchset based on the patchset "RISC-V: KVM: Add Zicfiss/Zicfilp
support".

The patch includes all the function of original patchset from Quan:
adding the Svadu/Zicfiss/Zicfilp FWFT for the RISC-V KVM. And this
patchset already passes the KVM unit test.

Follow the patchset (Which is queued for v7.2)
https://lore.kernel.org/kvm/20260601-kvm-get_reg_list-v2-...

Test with the patch applied
https://lore.kernel.org/all/20260522142358.87589-1-cuiyun...

Changed from v2:
- https://lore.kernel.org/kvm/20260601084336.2601675-1-inoc...
1. rebase with Yong-Xuan's patch set
2. Add SSP CSR context switch/set/get
3. Move the software-check exception set/unset into FWFT
4. Only delegate software-check exception when Zicfiss/Zicfilp is enabled.
5. Make KVM SBI_FWFT_PTE_AD_HW_UPDATING depends on both Svadu and Svade
   enabled.

Changed from Quan's v1:
- https://lore.kernel.org/kvm/cover.1764509485.git.zhouquan...
1. rebase to the latest master.
2. Split Svadu change as separate patch
3. Fix all build error from the original series
4. Remove the Svadu check in kvm_riscv_vcpu_config_ran_once() and in
   favor of the FWFT.
5. Remove the LPE/SSE setting bit in kvm_riscv_vcpu_config_ran_once()
   (kvm_riscv_vcpu_setup_config() in original patchset)

Inochi Amaoto (8):
  RISC-V: KVM: Add support for Svadu FWFT features
  KVM: riscv: selftests: add Svadu FWFT extension to get-reg-list test
  RISC-V: KVM: Allow Zicfiss/Zicfilp extensions for Guest/VM
  RISC-V: KVM: Add ssp context save/restore
  RISC-V: KVM: Handle software-check exits for VCPU
  RISC-V: KVM: Delegate SPELP bit to VS/VU mode if landing pad is
    enabled.
  RISC-V: KVM: Add support for control-flow integrity FWFT features
  KVM: riscv: selftests: add Zicfiss/Zicfilp extension to get-reg-list
    test

 arch/riscv/include/asm/csr.h                  |   1 +
 arch/riscv/include/asm/kvm_host.h             |   7 +
 arch/riscv/include/uapi/asm/kvm.h             |  13 ++
 arch/riscv/kvm/isa.c                          |   2 +
 arch/riscv/kvm/vcpu.c                         |   6 +
 arch/riscv/kvm/vcpu_exit.c                    |  10 +
 arch/riscv/kvm/vcpu_onereg.c                  |  66 ++++++-
 arch/riscv/kvm/vcpu_sbi_fwft.c                | 182 ++++++++++++++++++
 .../selftests/kvm/riscv/get-reg-list.c        |  88 +++++++++
 9 files changed, 373 insertions(+), 2 deletions(-)

--
2.54.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds