Skip to content

KVM RISC-V Sv57x4 support and HFENCE improvements

Anup Patel kvm kvm-riscv linux-riscv lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 14 repliesIn review
  2. v16 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Rebased on Linux-5.18-rc3
- Drop gstage_tlb_pgsize_bitmap and hfence_update_order() from PATCH4 because software is not required to know to page sizes supported by TLB. In fact, it is responsibility of hardware implementation to ensure that S/HFENCE on an address X invalidates all TLB entries created for PTE covering address X.
- Added PATCH7 to cleanup stale TLB entries when VCPU is moved another host CPU

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7RISC-V: KVM: Use G-stage name for hypervisor page tablearch/riscv/include/asm/kvm_host.h arch/riscv/kvm/main.c arch/riscv/kvm/mmu.c +4 more+151 -1512 replies
2/7RISC-V: KVM: Add Sv57x4 mode support for G-stagearch/riscv/include/asm/csr.h arch/riscv/kvm/main.c arch/riscv/kvm/mmu.c+14 -12 replies
3/7RISC-V: KVM: Treat SBI HFENCE calls as NOPsarch/riscv/kvm/vcpu_sbi_replace.c+5 -12 replies
4/7RISC-V: KVM: Introduce range based local HFENCE functionsarch/riscv/include/asm/kvm_host.h arch/riscv/kvm/mmu.c arch/riscv/kvm/tlb.S +3 more+237 -832 replies
5/7RISC-V: KVM: Reduce KVM_MAX_VCPUS valuearch/riscv/include/asm/kvm_host.h+1 -22 replies
6/7RISC-V: KVM: Add remote HFENCE functions based on VCPU requestsarch/riscv/include/asm/kvm_host.h arch/riscv/kvm/mmu.c arch/riscv/kvm/tlb.c +4 more+369 -532 replies
7/7RISC-V: KVM: Cleanup stale TLB entries when host CPU changesarch/riscv/include/asm/kvm_host.h arch/riscv/kvm/tlb.c arch/riscv/kvm/vcpu.c+39 -02 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchAtish Patra
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7A-b
7/7R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/7] KVM RISC-V Sv57x4 support and HFENCE improvements

This series adds Sv57x4 support for KVM RISC-V G-stage and various HFENCE related improvements.

These patches can also be found in riscv_kvm_sv57_plus_v2 branch at:
https://github.com/avpatel/linux.git

Changes since v1:
- Rebased on Linux-5.18-rc3
- Drop gstage_tlb_pgsize_bitmap and hfence_update_order() from PATCH4 because software is not required to know to page sizes supported by TLB. In fact, it is responsibility of hardware implementation to ensure that S/HFENCE on an address X invalidates all TLB entries created for PTE covering address X.
- Added PATCH7 to cleanup stale TLB entries when VCPU is moved another host CPU

Anup Patel (7):
RISC-V: KVM: Use G-stage name for hypervisor page table
RISC-V: KVM: Add Sv57x4 mode support for G-stage
RISC-V: KVM: Treat SBI HFENCE calls as NOPs
RISC-V: KVM: Introduce range based local HFENCE functions
RISC-V: KVM: Reduce KVM_MAX_VCPUS value
RISC-V: KVM: Add remote HFENCE functions based on VCPU requests
RISC-V: KVM: Cleanup stale TLB entries when host CPU changes

 arch/riscv/include/asm/csr.h      |   1 +
 arch/riscv/include/asm/kvm_host.h | 124 ++++++--
 arch/riscv/kvm/main.c             |  11 +-
 arch/riscv/kvm/mmu.c              | 264 +++++++++--------
 arch/riscv/kvm/tlb.S              |  74 -----
 arch/riscv/kvm/tlb.c              | 461 ++++++++++++++++++++++++++++++
 arch/riscv/kvm/vcpu.c             |  45 ++-
 arch/riscv/kvm/vcpu_exit.c        |   6 +-
 arch/riscv/kvm/vcpu_sbi_replace.c |  40 ++-
 arch/riscv/kvm/vcpu_sbi_v01.c     |  35 ++-
 arch/riscv/kvm/vm.c               |   8 +-
 arch/riscv/kvm/vmid.c             |  30 +-
 12 files changed, 812 insertions(+), 287 deletions(-)
 delete mode 100644 arch/riscv/kvm/tlb.S
 create mode 100644 arch/riscv/kvm/tlb.c
Signature · 1 line
2.25.1