[RFC PATCH v4 00/10] KVM: guest_memfd(), X86: Common base for SNP and TDX (was KVM: guest memory: Misc enhancement)

From: isaku . yamahata
Date: Thu Jul 20 2023 - 19:33:16 EST


From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>

Hello. I've updated KVM: guest memory: Misc enhancement patch series based
on "[RFC PATCH v11 00/29] KVM: guest_memfd() and per-page attributes" [1].
I changed the subject to represent the patch series better.

The purpose is to get agreement on the common base patches both for SNP [2] and
TDX [3]. (And hopefully for other technology to protect guest memory.) Then, SNP
and TDX can make progress without stepping on each other.

The main change from the previous version is
- The rebased to v11 KVM guest_memfd()
- Introduce KVM_X86_SNP_VM and KVM_x86_TDX_VM
- Make KVM_MEM_ENC_OP uABI common for SNP and TDX

[1] https://lore.kernel.org/all/20230718234512.1690985-1-seanjc@xxxxxxxxxx/

[2] https://lore.kernel.org/lkml/20230612042559.375660-1-michael.roth@xxxxxxx/
Add AMD Secure Nested Paging (SEV-SNP) Hypervisor Support

[3] https://lore.kernel.org/all/cover.1685333727.git.isaku.yamahata@xxxxxxxxx/
KVM TDX basic feature support

Changes:
v4:
- The rebased to v11 KVM guest_memfd()
- Introduce KVM_X86_SNP_VM and KVM_x86_TDX_VM
- Newly include a patch to make KVM_MEM_ENC_OP uABI common for SNP and TDX
- include a patch to address IMPLICIT_ACCESS

v3:
https://lore.kernel.org/all/cover.1687991811.git.isaku.yamahata@xxxxxxxxx/

v2:
https://lore.kernel.org/all/cover.1687474039.git.isaku.yamahata@xxxxxxxxx/

v1:
https://lore.kernel.org/all/cover.1686858861.git.isaku.yamahata@xxxxxxxxx/

Brijesh Singh (1):
KVM: x86: Export the kvm_zap_gfn_range() for the SNP use

Isaku Yamahata (6):
KVM: x86: Add is_vm_type_supported callback
KVM: x86/mmu: Pass around full 64-bit error code for the KVM page
fault
KVM: x86: Introduce PFERR_GUEST_ENC_MASK to indicate fault is private
KVM: Add new members to struct kvm_gfn_range to operate on
KVM: x86: Make struct sev_cmd common for KVM_MEM_ENC_OP
KVM: X86: KVM_MEM_ENC_OP check if unused field (flags, error) is zero

Michael Roth (2):
KVM: x86: Add gmem hook for initializing private memory
KVM: x86: Add gmem hook for invalidating private memory

Sean Christopherson (1):
KVM: x86/mmu: Guard against collision with KVM-defined
PFERR_IMPLICIT_ACCESS

arch/x86/include/asm/kvm-x86-ops.h | 3 ++
arch/x86/include/asm/kvm_host.h | 10 ++++-
arch/x86/include/uapi/asm/kvm.h | 35 +++++++++++++++
arch/x86/kvm/mmu.h | 2 -
arch/x86/kvm/mmu/mmu.c | 37 +++++++++++++---
arch/x86/kvm/mmu/mmu_internal.h | 18 ++++++--
arch/x86/kvm/mmu/mmutrace.h | 2 +-
arch/x86/kvm/mmu/paging_tmpl.h | 2 +-
arch/x86/kvm/svm/sev.c | 68 ++++++++++++++++--------------
arch/x86/kvm/svm/svm.c | 7 +++
arch/x86/kvm/svm/svm.h | 2 +-
arch/x86/kvm/vmx/vmx.c | 7 +++
arch/x86/kvm/x86.c | 50 +++++++++++++++++++++-
arch/x86/kvm/x86.h | 2 +
include/linux/kvm_host.h | 5 +++
virt/kvm/guest_mem.c | 44 +++++++++++++++++++
virt/kvm/kvm_main.c | 4 ++
17 files changed, 249 insertions(+), 49 deletions(-)


base-commit: bfa3037d828050896ae52f6467b6ca2489ae6fb1
prerequisite-patch-id: 3bd3037b3803e2d84f0ef98bb6c678be44eddd08
prerequisite-patch-id: b474cbf4f0ea21cf945036271f5286017e0efc84
prerequisite-patch-id: bd96a89fafe51956a55fdfc08a3ea2a37a2e55e4
prerequisite-patch-id: f15d178f9000430e0089c546756ab1d8d29341a7
prerequisite-patch-id: 5b34829d7433fa81ed574d724ee476b9cc2e6a50
prerequisite-patch-id: bf75388851ee37a83b37bfa7cb0084f27301f6bc
prerequisite-patch-id: 9d77fb0e8ce8c8c21e22ff3f26bd168eb5446df0
prerequisite-patch-id: 7152514149d4b4525a0057e3460ff78861e162f5
prerequisite-patch-id: a1d688257a210564ebeb23b1eef4b9ad1f5d7be3
prerequisite-patch-id: 0b1e771c370a03e1588ed97ee77cb0493d9304f4
prerequisite-patch-id: 313219882d617e4d4cb226760d1f071f52b3f882
prerequisite-patch-id: a8ebe373e3913fd0e0a55c57f55690f432975ec0
prerequisite-patch-id: 8b06f2333214e355b145113e33c65ade85d7eac4
prerequisite-patch-id: e739dd58995d35b0f888d02a6bf4ea144476f264
prerequisite-patch-id: 0e93d19cb59f3a052a377a56ff0a4399046818aa
prerequisite-patch-id: 4e0839abbfb8885154e278b4b0071a760199ad46
prerequisite-patch-id: be193bb3393ad8a16ea376a530df20a145145259
prerequisite-patch-id: 301dbdf8448175ea609664c890a3694750ecf740
prerequisite-patch-id: ba8e6068bcef7865bb5523065e19edd49fbc02de
prerequisite-patch-id: 81b25d13169b3617c12992dce85613a2730b0e1b
prerequisite-patch-id: b4526dee5b5a95da0a13116ae0c73d4e69efa3c6
prerequisite-patch-id: 8c62bacc52a75d4a9038a3f597fe436c50e07de3
prerequisite-patch-id: 5618d2414a1ef641b4c247b5e28076f67a765b24
prerequisite-patch-id: 022b4620f6ff729eca842192259e986d126e7fa6
prerequisite-patch-id: 73ebc581a3ce9a51167785d273fe69406ccccaed
prerequisite-patch-id: 1225df90aeae430a74354bc5ad0ddf508d0707db
prerequisite-patch-id: 1e38df398ee370ad7e457f4890d6e4457e8a83fa
prerequisite-patch-id: b8812b613f5674351565ea28354e91a756efd56e
prerequisite-patch-id: e231eff2baba07c2de984dd6cf83ad1a31b792b8
--
2.25.1