Skip to content

Risc-V Kvm Smstateen

Mayuresh Chitale kvm-riscv linux-devicetree linux-riscv 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest7 patches 0 repliesNew
  2. v47 patches 0 repliesSuperseded
  3. v37 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches0 repliesSuperseded
v16 patches0 repliesSuperseded

Changes in v5 from the cover letter

- Rebased on latest linux master

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7RISC-V: Detect Smstateen extensionarch/riscv/include/asm/hwcap.h arch/riscv/kernel/cpufeature.c+2 -00 replies
2/7dt-bindings: riscv: Add smstateen entryDocumentation/devicetree/bindings/riscv/extensions.yaml+6 -00 replies
3/7RISC-V: KVM: Add kvm_vcpu_configarch/riscv/include/asm/kvm_host.h arch/riscv/kvm/vcpu.c+21 -130 replies
4/7RISC-V: KVM: Enable Smstateen accessesarch/riscv/include/asm/csr.h arch/riscv/include/asm/kvm_host.h arch/riscv/include/uapi/asm/kvm.h +2 more+34 -00 replies
5/7RISCV: KVM: Add senvcfg context save/restorearch/riscv/include/asm/csr.h arch/riscv/include/asm/kvm_host.h arch/riscv/include/uapi/asm/kvm.h +1 more+20 -00 replies
6/7RISCV: KVM: Add sstateen0 context save/restorearch/riscv/include/asm/csr.h arch/riscv/include/asm/kvm_host.h arch/riscv/kvm/vcpu.c+21 -00 replies
7/7RISCV: KVM: Add sstateen0 to ONE_REGarch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/vcpu_onereg.c+48 -00 replies

Reviews trailers per patch

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

PatchAndrew JonesConor Dooley
1/7R-b
2/7R-b R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

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

Read the v5 thread

Cover letter [PATCH v5 0/7] Risc-V Kvm Smstateen

This series adds support to detect the Smstateen extension for both, the host and the guest vcpu. It also adds senvcfg and sstateen0 to the ONE_REG interface and the vcpu context save/restore.

The motivation behind Smstateen from the spec
(https://github.com/riscv/riscv-state-enable):
"The implementation of optional RISC-V extensions has the potential to open covert channels between separate user threads, or between separate guest OSes running under a hypervisor. The problem occurs when an extension adds processor state---usually explicit registers, but possibly other forms of state---that the main OS or hypervisor is unaware of (and hence won?t context-switch) but that can be modified/written by one user thread or guest OS and perceived/ examined/read by another."

Changes in v5:
- Rebased on latest linux master

Changes in v4:
- Update commit description for patch 1
- Rebase to kvm_riscv_queue
- Add reviewed-by tag

Changes in v3:
- Move DT bindings change to a separate patch
- Move senvcfg/sstateen0 save/restore to separate function

Changes in v2:
- Add smstaeen description in riscv/extensions.yaml
- Avoid line wrap at 80 chars

Mayuresh Chitale (7):
RISC-V: Detect Smstateen extension
dt-bindings: riscv: Add smstateen entry
RISC-V: KVM: Add kvm_vcpu_config
RISC-V: KVM: Enable Smstateen accesses
RISCV: KVM: Add senvcfg context save/restore
RISCV: KVM: Add sstateen0 context save/restore
RISCV: KVM: Add sstateen0 to ONE_REG

 .../devicetree/bindings/riscv/extensions.yaml |  6 ++
 arch/riscv/include/asm/csr.h                  | 18 +++++
 arch/riscv/include/asm/hwcap.h                |  1 +
 arch/riscv/include/asm/kvm_host.h             | 18 +++++
 arch/riscv/include/uapi/asm/kvm.h             | 10 +++
 arch/riscv/kernel/cpufeature.c                |  1 +
 arch/riscv/kvm/vcpu.c                         | 70 +++++++++++++++----
 arch/riscv/kvm/vcpu_onereg.c                  | 41 +++++++++++
 8 files changed, 152 insertions(+), 13 deletions(-)
Signature · 1 line
2.34.1