Skip to content

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

Inochi Amaoto kvm kvm-riscv linux-kselftest linux-riscv lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest8 patches 8 repliesIn review
  2. v58 patches 3 repliesSuperseded
  3. v48 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v38 patches0 repliesSuperseded
v27 patches3 repliesSuperseded

Changes in v6 from the cover letter

- https://lore.kernel.org/kvm/[email protected]/
patch 1, 5:
1. Switch to csr_read()/csr_write() to update csr
patch 8:
1. Fix the macro name.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8RISC-V: KVM: Add support for Svadu FWFT featuresarch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/vcpu_sbi_fwft.c+77 -01 reply
2/8KVM: riscv: selftests: add Svadu FWFT extension to get-reg-list testtools/testing/selftests/kvm/riscv/get-reg-list.c+21 -01 reply
3/8RISC-V: KVM: Allow Zicfiss/Zicfilp extensions for Guest/VMarch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/isa.c+4 -01 reply
4/8RISC-V: KVM: Add ssp context save/restorearch/riscv/include/asm/kvm_host.h arch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/vcpu.c +1 more+88 -21 reply
5/8RISC-V: KVM: Handle software-check exits for VCPUarch/riscv/include/asm/csr.h arch/riscv/kvm/vcpu_exit.c+5 -01 reply
6/8RISC-V: KVM: Delegate SPELP bit to VS/VU mode if landing pad is enabled.arch/riscv/kvm/vcpu_exit.c+7 -00 replies
7/8RISC-V: KVM: Add support for control-flow integrity FWFT featuresarch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/vcpu_sbi_fwft.c+109 -01 reply
8/8KVM: riscv: selftests: add Zicfiss/Zicfilp extension to get-reg-list testtools/testing/selftests/kvm/riscv/get-reg-list.c+69 -01 reply

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchAnup Patel
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8
6/8
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/8] RISC-V: KVM: Add Svadu/Zicfiss/Zicfilp FWFT support

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.

Test with the patch applied
https://lore.kernel.org/all/[email protected]/

Changed from v5:
- https://lore.kernel.org/kvm/[email protected]/
patch 1, 5:
1. Switch to csr_read()/csr_write() to update csr
patch 8:
1. Fix the macro name.

Changed from v4:
- https://lore.kernel.org/kvm/[email protected]/
patch 1:
1. Use NACL for csr update
2. Check ISA mapping before cleaning the ADUE bit
patch 4:
1. Clear the zicfiss csr during a VCPU reset
2. Add zicfiss csr to num_csr_regs()
patch 6:
1. Cleanup SPELP after redirecting the trap
patch 7:
1. Use interrupt bit instead of number for masking/unmasking patch 8:
1. Add missing entry for the test
2. Fix the wrong comment.

Changed from v3:
- https://lore.kernel.org/kvm/[email protected]/
1. rebase to the v7.2-rc1
2. Tested with the updated Svadu patch
3. Remove the dependency as it is already merged.

Changed from v2:
- https://lore.kernel.org/kvm/[email protected]/
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/[email protected]/
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                         |   7 +
 arch/riscv/kvm/vcpu_exit.c                    |  11 ++
 arch/riscv/kvm/vcpu_onereg.c                  |  68 ++++++-
 arch/riscv/kvm/vcpu_sbi_fwft.c                | 183 ++++++++++++++++++
 .../selftests/kvm/riscv/get-reg-list.c        |  90 +++++++++
 9 files changed, 380 insertions(+), 2 deletions(-)

--
2.55.0