Skip to content

Commit 4226920

Browse files
committed
KVM: x86: Update KVM_SW_PROTECTED_VM docs to make it clear they're a WIP
Rewrite the help message for KVM_SW_PROTECTED_VM to make it clear that software-protected VMs are a development and testing vehicle for guest_memfd(), and that attempting to use KVM_SW_PROTECTED_VM for anything remotely resembling a "real" VM will fail. E.g. any memory accesses from KVM will incorrectly access shared memory, nested TDP is wildly broken, and so on and so forth. Update KVM's API documentation with similar warnings to discourage anyone from attempting to run anything but selftests with KVM_X86_SW_PROTECTED_VM. Fixes: 89ea60c ("KVM: x86: Add support for "protected VMs" that can utilize private memory") Link: https://lore.kernel.org/r/20240222190612.2942589-3-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent e563592 commit 4226920

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8791,6 +8791,11 @@ means the VM type with value @n is supported. Possible values of @n are::
87918791
#define KVM_X86_DEFAULT_VM 0
87928792
#define KVM_X86_SW_PROTECTED_VM 1
87938793

8794+
Note, KVM_X86_SW_PROTECTED_VM is currently only for development and testing.
8795+
Do not use KVM_X86_SW_PROTECTED_VM for "real" VMs, and especially not in
8796+
production. The behavior and effective ABI for software-protected VMs is
8797+
unstable.
8798+
87948799
9. Known KVM API problems
87958800
=========================
87968801

arch/x86/kvm/Kconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ config KVM_SW_PROTECTED_VM
8080
depends on KVM && X86_64
8181
select KVM_GENERIC_PRIVATE_MEM
8282
help
83-
Enable support for KVM software-protected VMs. Currently "protected"
84-
means the VM can be backed with memory provided by
85-
KVM_CREATE_GUEST_MEMFD.
83+
Enable support for KVM software-protected VMs. Currently, software-
84+
protected VMs are purely a development and testing vehicle for
85+
KVM_CREATE_GUEST_MEMFD. Attempting to run a "real" VM workload as a
86+
software-protected VM will fail miserably.
8687

8788
If unsure, say "N".
8889

0 commit comments

Comments
 (0)