Skip to content

KVM: arm64: Preamble for pKVM

Fuad Tabba kvmarm 4 versions – Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest30 patches 19 repliesApplied
  2. v331 patches 12 repliesSuperseded
  3. v247 patches 19 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v144 patches19 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/30KVM: arm64: Initialize the kvm host data's fpsimd_state pointer in pKVMarch/arm64/kvm/hyp/include/nvhe/pkvm.h arch/arm64/kvm/hyp/nvhe/pkvm.c arch/arm64/kvm/hyp/nvhe/setup.c+13 -010 replies
2/30KVM: arm64: Move guest_owns_fp_regs() to increase its scopearch/arm64/include/asm/kvm_host.h arch/arm64/kvm/hyp/include/hyp/switch.h arch/arm64/kvm/hyp/nvhe/switch.c +1 more+8 -81 reply
3/30KVM: arm64: Refactor checks for FP state ownershiparch/arm64/include/asm/kvm_emulate.h arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/fpsimd.c +3 more+13 -101 reply
4/30KVM: arm64: Do not re-initialize the KVM lockarch/arm64/kvm/pkvm.c+0 -10 replies
5/30KVM: arm64: Issue CMOs when tearing down guest s2 pagesarch/arm64/kvm/hyp/nvhe/pkvm.c+1 -00 replies
6/30KVM: arm64: Avoid BUG-ing from the host abort patharch/arm64/kvm/hyp/nvhe/mem_protect.c+7 -10 replies
7/30KVM: arm64: Check for PTE validity when checking for executable/cacheablearch/arm64/kvm/hyp/pgtable.c+3 -30 replies
8/30KVM: arm64: Avoid BBM when changing only s/w bits in Stage-2 PTEarch/arm64/kvm/hyp/pgtable.c+15 -00 replies
9/30KVM: arm64: Support TLB invalidation in guest contextarch/arm64/kvm/hyp/nvhe/tlb.c+91 -240 replies
10/30KVM: arm64: Rename __tlb_switch_to_{guest,host}() in VHEarch/arm64/kvm/hyp/vhe/tlb.c+13 -130 replies
11/30KVM: arm64: Do not map the host fpsimd state to hyp in pKVMarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/fpsimd.c arch/arm64/kvm/reset.c+4 -310 replies
12/30KVM: arm64: Prevent kmemleak from accessing .hyp.dataarch/arm64/kvm/pkvm.c+1 -00 replies
13/30KVM: arm64: Fix comment for __pkvm_vcpu_init_traps()arch/arm64/kvm/hyp/nvhe/pkvm.c+1 -10 replies
14/30KVM: arm64: Change kvm_handle_mmio_return() return polarityarch/arm64/kvm/arm.c arch/arm64/kvm/mmio.c+3 -30 replies
15/30KVM: arm64: Move setting the page as dirty out of the critical sectionarch/arm64/kvm/mmu.c+5 -30 replies
16/30KVM: arm64: Simplify vgic-v3 hypercallsarch/arm64/include/asm/kvm_asm.h arch/arm64/include/asm/kvm_hyp.h arch/arm64/kvm/arm.c +7 more+38 -760 replies
17/30KVM: arm64: Add is_pkvm_initialized() helperarch/arm64/include/asm/virt.h+8 -40 replies
18/30KVM: arm64: Introduce and use predicates that check for protected VMsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/hyp/include/nvhe/pkvm.h arch/arm64/kvm/hyp/nvhe/switch.c+11 -80 replies
19/30KVM: arm64: Move pstate reset value definitions to kvm_arm.harch/arm64/include/asm/kvm_arm.h arch/arm64/kvm/reset.c+12 -120 replies
20/30KVM: arm64: Clarify rationale for ZCR_EL1 value restored on guest exitarch/arm64/kvm/fpsimd.c+23 -10 replies
21/30KVM: arm64: Refactor calculating SVE state size to use helpersarch/arm64/include/asm/kvm_host.h+9 -73 replies
22/30KVM: arm64: Move some kvm_psci functions to a shared headerarch/arm64/kvm/psci.c include/kvm/arm_psci.h+29 -280 replies
23/30KVM: arm64: Refactor reset_mpidr() to extract its computationarch/arm64/kvm/sys_regs.c arch/arm64/kvm/sys_regs.h+20 -130 replies
24/30KVM: arm64: Refactor kvm_vcpu_enable_ptrauth() for hyp usearch/arm64/include/asm/kvm_emulate.h arch/arm64/kvm/reset.c+6 -60 replies
25/30KVM: arm64: Reformat/beautify PTP hypercall documentationDocumentation/virt/kvm/arm/ptp_kvm.rst+24 -140 replies
26/30KVM: arm64: Rename firmware pseudo-register documentation fileDocumentation/virt/kvm/arm/fw-pseudo-registers.rst Documentation/virt/kvm/arm/index.rst+4 -40 replies
27/30KVM: arm64: Document the KVM/arm64-specific calls in hypercalls.rstDocumentation/virt/kvm/arm/hypercalls.rst Documentation/virt/kvm/arm/index.rst+47 -00 replies
28/30KVM: arm64: Refactor setting the return value in kvm_vm_ioctl_enable_cap()arch/arm64/kvm/arm.c+9 -150 replies
29/30KVM: arm64: Restrict supported capabilities for protected VMsarch/arm64/kvm/arm.c+32 -00 replies
30/30KVM: arm64: Force injection of a data abort on NISV MMIO exitDocumentation/virt/kvm/api.rst arch/arm64/kvm/mmio.c+15 -00 replies

Reviews trailers per patch

5 of 30 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMark BrownMarc ZyngierOliver Upton
SeriesA-b
1/30
2/30R-b
3/30R-b
4/30
5/30
6/30
7/30
8/30
9/30
10/30
11/30R-b
12/30
13/30
14/30
15/30
16/30
17/30
18/30Co-authored-by
19/30
20/30R-b
21/30R-b
22/30
23/30
24/30
25/30
26/30
27/30
28/30
29/30
30/30

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/30] KVM: arm64: Preamble for pKVM

Changes from V3 [0]:
- Rebased on latest kvmarm/next (dcbf421a8c08)
- Dropped atomic and locking patches for now, while we rework them
- Misc fixes (Oliver)

We are getting closer to upstreaming the remaining part of pKVM [1]. To make the process easier for us and for our dear reviewers, we are sending out this patch series as a preamble to the upcoming patches.

This series is based on Linux 6.9-rc3 -- kvmarm/next (dcbf421a8c08). Most of the patches in this series are self-standing, and can be applied directly. Patches 1 to 13 are fixes.

This series is a bit of a bombay-mix of patches we've been carrying. There's no one overarching theme, but they do improve the code by fixing existing bugs in pKVM, refactoring code to make it more readable and easier to re-use for pKVM, or adding functionality to the existing pKVM code upstream.

For a technical deep dive into pKVM, please refer to Quentin Perret's KVM Forum Presentation [2, 3]. The pKVM core series, which we plan on sending for review next, the code is here [1].

Cheers,
Fuad, Quentin, Will, and Marc

[0] https://lore.kernel.org/all/[email protected]/

[1] https://android-kvm.googlesource.com/linux/+/refs/heads/for-upstream/pkvm-core

[2] Protected KVM on arm64 (slides)
https://static.sched.com/hosted_files/kvmforum2022/88/KVM%20forum%202022%20-%20pKVM%20deep%20dive.pdf

[3] Protected KVM on arm64 (video)
https://www.youtube.com/watch?v=9npebeVFbFw

Fuad Tabba (18):
KVM: arm64: Initialize the kvm host data's fpsimd_state pointer in
pKVM
KVM: arm64: Move guest_owns_fp_regs() to increase its scope
KVM: arm64: Refactor checks for FP state ownership
KVM: arm64: Do not re-initialize the KVM lock
KVM: arm64: Rename __tlb_switch_to_{guest,host}() in VHE
KVM: arm64: Do not map the host fpsimd state to hyp in pKVM
KVM: arm64: Fix comment for __pkvm_vcpu_init_traps()
KVM: arm64: Change kvm_handle_mmio_return() return polarity
KVM: arm64: Move setting the page as dirty out of the critical section
KVM: arm64: Introduce and use predicates that check for protected VMs
KVM: arm64: Move pstate reset value definitions to kvm_arm.h
KVM: arm64: Clarify rationale for ZCR_EL1 value restored on guest exit
KVM: arm64: Refactor calculating SVE state size to use helpers
KVM: arm64: Move some kvm_psci functions to a shared header
KVM: arm64: Refactor reset_mpidr() to extract its computation
KVM: arm64: Refactor kvm_vcpu_enable_ptrauth() for hyp use
KVM: arm64: Refactor setting the return value in
kvm_vm_ioctl_enable_cap()
KVM: arm64: Restrict supported capabilities for protected VMs

Marc Zyngier (3):
KVM: arm64: Check for PTE validity when checking for
executable/cacheable
KVM: arm64: Simplify vgic-v3 hypercalls
KVM: arm64: Force injection of a data abort on NISV MMIO exit

Quentin Perret (4):
KVM: arm64: Issue CMOs when tearing down guest s2 pages
KVM: arm64: Avoid BUG-ing from the host abort path
KVM: arm64: Prevent kmemleak from accessing .hyp.data
KVM: arm64: Add is_pkvm_initialized() helper

Will Deacon (5):
KVM: arm64: Avoid BBM when changing only s/w bits in Stage-2 PTE
KVM: arm64: Support TLB invalidation in guest context
KVM: arm64: Reformat/beautify PTP hypercall documentation
KVM: arm64: Rename firmware pseudo-register documentation file
KVM: arm64: Document the KVM/arm64-specific calls in hypercalls.rst

 Documentation/virt/kvm/api.rst                |   7 +
 .../virt/kvm/arm/fw-pseudo-registers.rst      | 138 ++++++++++++++
 Documentation/virt/kvm/arm/hypercalls.rst     | 180 +++++-------------
 Documentation/virt/kvm/arm/index.rst          |   1 +
 Documentation/virt/kvm/arm/ptp_kvm.rst        |  38 ++--
 arch/arm64/include/asm/kvm_arm.h              |  12 ++
 arch/arm64/include/asm/kvm_asm.h              |   8 +-
 arch/arm64/include/asm/kvm_emulate.h          |  11 +-
 arch/arm64/include/asm/kvm_host.h             |  39 ++--
 arch/arm64/include/asm/kvm_hyp.h              |   4 +-
 arch/arm64/include/asm/virt.h                 |  12 +-
 arch/arm64/kvm/arm.c                          |  63 ++++--
 arch/arm64/kvm/fpsimd.c                       |  60 +++---
 arch/arm64/kvm/hyp/include/hyp/switch.h       |   8 +-
 arch/arm64/kvm/hyp/include/nvhe/pkvm.h        |   6 +
 arch/arm64/kvm/hyp/nvhe/hyp-main.c            |  24 +--
 arch/arm64/kvm/hyp/nvhe/mem_protect.c         |   8 +-
 arch/arm64/kvm/hyp/nvhe/pkvm.c                |  14 +-
 arch/arm64/kvm/hyp/nvhe/setup.c               |   1 +
 arch/arm64/kvm/hyp/nvhe/switch.c              |  10 +-
 arch/arm64/kvm/hyp/nvhe/tlb.c                 | 115 ++++++++---
 arch/arm64/kvm/hyp/pgtable.c                  |  21 +-
 arch/arm64/kvm/hyp/vgic-v3-sr.c               |  27 ++-
 arch/arm64/kvm/hyp/vhe/switch.c               |   4 +-
 arch/arm64/kvm/hyp/vhe/tlb.c                  |  26 +--
 arch/arm64/kvm/mmio.c                         |  12 +-
 arch/arm64/kvm/mmu.c                          |   8 +-
 arch/arm64/kvm/pkvm.c                         |   2 +-
 arch/arm64/kvm/psci.c                         |  28 ---
 arch/arm64/kvm/reset.c                        |  20 +-
 arch/arm64/kvm/sys_regs.c                     |  14 +-
 arch/arm64/kvm/sys_regs.h                     |  19 ++
 arch/arm64/kvm/vgic/vgic-v2.c                 |   9 +-
 arch/arm64/kvm/vgic/vgic-v3.c                 |  23 +--
 arch/arm64/kvm/vgic/vgic.c                    |  11 --
 arch/arm64/kvm/vgic/vgic.h                    |   2 -
 include/kvm/arm_psci.h                        |  29 +++
 include/kvm/arm_vgic.h                        |   1 -
 38 files changed, 597 insertions(+), 418 deletions(-)
 create mode 100644 Documentation/virt/kvm/arm/fw-pseudo-registers.rst

base-commit: dcbf421a8c082f52f3b8cc19cff736374df123d6

Signature · 1 line
2.44.0.769.g3c40516874-goog