KVM: arm64: Add support for protected guest memory with pKVM
Status from this message: Applied to next, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest38 patches 4 repliesApplied
- v438 patches 1 replySuperseded
- v336 patches 26 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 35 patches | 18 replies | Superseded | |
| v1 | 30 patches | 37 replies | Applied |
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/38 | KVM: arm64: Remove unused PKVM_ID_FFA definitionarch/ | +0 | 0 replies | |
| 2/38 | KVM: arm64: Don't leak stage-2 page-table if VM fails to init under pKVMarch/ | +3 | 0 replies | |
| 3/38 | KVM: arm64: Move handle check into pkvm_pgtable_stage2_destroy_range()arch/ | +6 | 0 replies | |
| 4/38 | KVM: arm64: Rename __pkvm_pgtable_stage2_unmap()arch/ | +4 | 0 replies | |
| 5/38 | KVM: arm64: Don't advertise unsupported features for protected guestsarch/ | +0 | 0 replies | |
| 6/38 | KVM: arm64: Expose self-hosted debug regs as RAZ/WI for protected guestsarch/ | +8 | 0 replies | |
| 7/38 | KVM: arm64: Remove is_protected_kvm_enabled() checks from hypercallsarch/ arch/ | +34 | 0 replies | |
| 8/38 | KVM: arm64: Ignore MMU notifier callbacks for protected VMsarch/ arch/ | +24 | 0 replies | |
| 9/38 | KVM: arm64: Prevent unsupported memslot operations on protected VMsarch/ arch/ | +19 | 0 replies | |
| 10/38 | KVM: arm64: Ignore -EAGAIN when mapping in pages for the pKVM hostarch/ | +16 | 0 replies | |
| 11/38 | KVM: arm64: Split teardown hypercall into two phasesarch/ arch/ arch/ +3 more | +67 | 3 replies | |
| 12/38 | KVM: arm64: Introduce __pkvm_host_donate_guest()arch/ arch/ arch/ +2 more | +55 | 0 replies | |
| 13/38 | KVM: arm64: Hook up donation hypercall to pkvm_pgtable_stage2_map()arch/ | +41 | 0 replies | |
| 14/38 | KVM: arm64: Handle aborts from protected VMsarch/ | +81 | 0 replies | |
| 15/38 | KVM: arm64: Introduce __pkvm_reclaim_dying_guest_page()arch/ arch/ arch/ +3 more | +105 | 0 replies | |
| 16/38 | KVM: arm64: Hook up reclaim hypercall to pkvm_pgtable_stage2_destroy()arch/ | +30 | 0 replies | |
| 17/38 | KVM: arm64: Factor out pKVM host exception injection logicarch/ | +23 | 0 replies | |
| 18/38 | KVM: arm64: Support translation faults in inject_host_exception()arch/ arch/ | +17 | 0 replies | |
| 19/38 | KVM: arm64: Inject SIGSEGV on illegal accessesarch/ arch/ | +59 | 0 replies | |
| 20/38 | KVM: arm64: Avoid pointless annotation when mapping host-owned pagesarch/ | +16 | 0 replies | |
| 21/38 | KVM: arm64: Generalise kvm_pgtable_stage2_set_owner()arch/ arch/ arch/ | +62 | 0 replies | |
| 22/38 | KVM: arm64: Introduce host_stage2_set_owner_metadata_locked()arch/ arch/ | +32 | 0 replies | |
| 23/38 | KVM: arm64: Change 'pkvm_handle_t' to u16arch/ arch/ | +2 | 0 replies | |
| 24/38 | KVM: arm64: Annotate guest donations with handle and gfn in host stage-2arch/ | +18 | 0 replies | |
| 25/38 | KVM: arm64: Introduce hypercall to force reclaim of a protected pagearch/ arch/ arch/ +5 more | +154 | 0 replies | |
| 26/38 | KVM: arm64: Reclaim faulting page from pKVM in spurious fault handlerarch/ arch/ arch/ | +32 | 0 replies | |
| 27/38 | KVM: arm64: Return -EFAULT from VCPU_RUN on access to a poisoned ptearch/ arch/ arch/ +2 more | +61 | 0 replies | |
| 28/38 | KVM: arm64: Add hvc handler at EL2 for hypercalls from protected VMsarch/ arch/ arch/ | +39 | 0 replies | |
| 29/38 | KVM: arm64: Implement the MEM_SHARE hypercall for protected VMsarch/ arch/ arch/ | +94 | 0 replies | |
| 30/38 | KVM: arm64: Implement the MEM_UNSHARE hypercall for protected VMsarch/ arch/ arch/ | +57 | 0 replies | |
| 31/38 | KVM: arm64: Allow userspace to create protected VMs when pKVM is enabledarch/ arch/ arch/ +2 more | +20 | 0 replies | |
| 32/38 | KVM: arm64: Add some initial documentation for pKVMDocumentation/ Documentation/ Documentation/ | +109 | 0 replies | |
| 33/38 | KVM: arm64: Extend pKVM page ownership selftests to cover guest donationarch/ | +22 | 0 replies | |
| 34/38 | KVM: arm64: Register 'selftest_vm' in the VM tablearch/ arch/ arch/ | +61 | 0 replies | |
| 35/38 | KVM: arm64: Extend pKVM page ownership selftests to cover forced reclaimarch/ | +14 | 0 replies | |
| 36/38 | KVM: arm64: Extend pKVM page ownership selftests to cover guest hvcsarch/ | +30 | 0 replies | |
| 37/38 | KVM: arm64: Rename PKVM_PAGE_STATE_MASKarch/ | +3 | 0 replies | |
| 38/38 | drivers/virt: pkvm: Add Kconfig dependency on DMA_RESTRICTED_POOLdrivers/ | +1 | 0 replies |
Reviews trailers per patch
21 of 38 patches have a Reviewed-by or Acked-by.
| Patch | Fuad Tabba | Mostafa Saleh | Quentin Perret | Vincent Donnefort |
|---|---|---|---|---|
| 1/38 | ||||
| 2/38 | R-b T-b | T-b | ||
| 3/38 | R-b T-b | T-b | ||
| 4/38 | R-b T-b | T-b | ||
| 5/38 | R-b T-b | T-b | ||
| 6/38 | T-b | |||
| 7/38 | R-b T-b | T-b | R-b | |
| 8/38 | R-b T-b | T-b | ||
| 9/38 | R-b T-b | T-b | ||
| 10/38 | R-b T-b | T-b | ||
| 11/38 | R-b T-b | T-b | ||
| 12/38 | T-b | T-b | ||
| 13/38 | T-b | T-b | ||
| 14/38 | R-b T-b | T-b | ||
| 15/38 | T-b | T-b | R-b | |
| 16/38 | T-b | T-b | ||
| 17/38 | R-b T-b | T-b | ||
| 18/38 | R-b T-b | T-b | ||
| 19/38 | R-b T-b | T-b | ||
| 20/38 | T-b | T-b | ||
| 21/38 | T-b | T-b | ||
| 22/38 | T-b | T-b | ||
| 23/38 | R-b T-b | T-b | ||
| 24/38 | R-b T-b | T-b | ||
| 25/38 | T-b | T-b | ||
| 26/38 | T-b | T-b | ||
| 27/38 | T-b | T-b | ||
| 28/38 | T-b | T-b | R-b | |
| 29/38 | T-b | T-b | R-b | |
| 30/38 | T-b | T-b | R-b | |
| 31/38 | T-b | T-b | ||
| 32/38 | R-b T-b | T-b | ||
| 33/38 | T-b | T-b | ||
| 34/38 | T-b | T-b | ||
| 35/38 | T-b | T-b | ||
| 36/38 | T-b | T-b | ||
| 37/38 | R-b T-b | T-b | ||
| 38/38 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v5 00/38] KVM: arm64: Add support for protected guest memory with pKVM
Hi everyone,
As promised on Friday, here's v5 of the pKVM protected memory patches previously posted here:
v1: https://lore.kernel.org/kvmarm/[email protected]/
v2: https://lore.kernel.org/kvmarm/[email protected]/
v3: https://lore.kernel.org/r/[email protected]
v4: https://lore.kernel.org/r/[email protected]
This version primarily addresses the comments from Sashiko that I think are valid:
* Mask out page offset from physical address passed to "force reclaim" hypercall.
* Check for 'is_dying' in get_pkvm_hyp_vm() to prevent taking a reference on a VM in the process of being destroyed.
* Take the 'slots_lock' while creating the hyp vm to avoid racing with check in kvm_arch_prepare_memory_region().
* Keep trying to reclaim pages from a dying guest if we fail part-way through.
* Fix return value from pkvm_pgtable_stage2_test_clear_young() if it's unexpectedly called for a pVM.
As before, I've pushed an updated branch with this series:
https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=kvm/protected-memory
and the kvmtool patches are available at:
https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/log/?h=pkvm
Cheers,
Will
--->8
Fuad Tabba (1):
KVM: arm64: Expose self-hosted debug regs as RAZ/WI for protected
guests
Quentin Perret (1):
KVM: arm64: Inject SIGSEGV on illegal accesses
Will Deacon (36):
KVM: arm64: Remove unused PKVM_ID_FFA definition
KVM: arm64: Don't leak stage-2 page-table if VM fails to init under
pKVM
KVM: arm64: Move handle check into pkvm_pgtable_stage2_destroy_range()
KVM: arm64: Rename __pkvm_pgtable_stage2_unmap()
KVM: arm64: Don't advertise unsupported features for protected guests
KVM: arm64: Remove is_protected_kvm_enabled() checks from hypercalls
KVM: arm64: Ignore MMU notifier callbacks for protected VMs
KVM: arm64: Prevent unsupported memslot operations on protected VMs
KVM: arm64: Ignore -EAGAIN when mapping in pages for the pKVM host
KVM: arm64: Split teardown hypercall into two phases
KVM: arm64: Introduce __pkvm_host_donate_guest()
KVM: arm64: Hook up donation hypercall to pkvm_pgtable_stage2_map()
KVM: arm64: Handle aborts from protected VMs
KVM: arm64: Introduce __pkvm_reclaim_dying_guest_page()
KVM: arm64: Hook up reclaim hypercall to pkvm_pgtable_stage2_destroy()
KVM: arm64: Factor out pKVM host exception injection logic
KVM: arm64: Support translation faults in inject_host_exception()
KVM: arm64: Avoid pointless annotation when mapping host-owned pages
KVM: arm64: Generalise kvm_pgtable_stage2_set_owner()
KVM: arm64: Introduce host_stage2_set_owner_metadata_locked()
KVM: arm64: Change 'pkvm_handle_t' to u16
KVM: arm64: Annotate guest donations with handle and gfn in host
stage-2
KVM: arm64: Introduce hypercall to force reclaim of a protected page
KVM: arm64: Reclaim faulting page from pKVM in spurious fault handler
KVM: arm64: Return -EFAULT from VCPU_RUN on access to a poisoned pte
KVM: arm64: Add hvc handler at EL2 for hypercalls from protected VMs
KVM: arm64: Implement the MEM_SHARE hypercall for protected VMs
KVM: arm64: Implement the MEM_UNSHARE hypercall for protected VMs
KVM: arm64: Allow userspace to create protected VMs when pKVM is
enabled
KVM: arm64: Add some initial documentation for pKVM
KVM: arm64: Extend pKVM page ownership selftests to cover guest
donation
KVM: arm64: Register 'selftest_vm' in the VM table
KVM: arm64: Extend pKVM page ownership selftests to cover forced
reclaim
KVM: arm64: Extend pKVM page ownership selftests to cover guest hvcs
KVM: arm64: Rename PKVM_PAGE_STATE_MASK
drivers/virt: pkvm: Add Kconfig dependency on DMA_RESTRICTED_POOL
.../admin-guide/kernel-parameters.txt | 4 +- Documentation/virt/kvm/arm/index.rst | 1 + Documentation/virt/kvm/arm/pkvm.rst | 106 ++++ arch/arm64/include/asm/kvm_asm.h | 31 +- arch/arm64/include/asm/kvm_host.h | 9 +- arch/arm64/include/asm/kvm_pgtable.h | 45 +- arch/arm64/include/asm/kvm_pkvm.h | 4 +- arch/arm64/include/asm/virt.h | 9 + arch/arm64/kvm/arm.c | 12 +- arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 10 +- arch/arm64/kvm/hyp/include/nvhe/memory.h | 12 +- arch/arm64/kvm/hyp/include/nvhe/pkvm.h | 7 +- .../arm64/kvm/hyp/include/nvhe/trap_handler.h | 2 + arch/arm64/kvm/hyp/nvhe/hyp-main.c | 184 +++--- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 587 ++++++++++++++++-- arch/arm64/kvm/hyp/nvhe/pkvm.c | 232 ++++++- arch/arm64/kvm/hyp/nvhe/switch.c | 1 + arch/arm64/kvm/hyp/nvhe/sys_regs.c | 8 + arch/arm64/kvm/hyp/pgtable.c | 33 +- arch/arm64/kvm/mmu.c | 114 +++- arch/arm64/kvm/pkvm.c | 157 ++++- arch/arm64/mm/fault.c | 33 +- drivers/virt/coco/pkvm-guest/Kconfig | 2 +- include/uapi/linux/kvm.h | 5 + 24 files changed, 1380 insertions(+), 228 deletions(-) create mode 100644 Documentation/virt/kvm/arm/pkvm.rst
Signature · 1 line
2.53.0.1018.g2bb0e51243-goog