Skip to content

KVM: Kconfig fixes for the VM-wide private memory attribute

Paolo Bonzini kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: split CONFIG_KVM_PRIVATE_MEMATTR_VM out of KVM_VM_MEMORY_ATTRIBUTESDocumentation/admin-guide/kernel-parameters.txt arch/x86/kvm/Kconfig include/linux/kvm_host.h +2 more+13 -72 replies
2/3KVM: x86: leave the legacy private attribute in for TDX and SEVarch/x86/kvm/Kconfig+2 -12 replies
3/3KVM: always make in-place conversion a compile-time constant when possibleinclude/linux/kvm_host.h virt/kvm/kvm_main.c+12 -143 replies

Reviews trailers per patch

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

PatchXiaoyao LiAckerley Tng
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v1 thread

Cover letter [PATCH 0/3] KVM: Kconfig fixes for the VM-wide private memory attribute

A late review of the guest_memfd attributes changes...

With Linux 7.4 the "private" memory attribute was moved from the VM to the individual guest_memfd file descriptor. The old semantics are available for backwards compatibility via CONFIG_KVM_VM_MEMORY_ATTRIBUTES, and disabled by default.

This change has two problems: first, it ties support for VM memory attributes entirely to a backwards compatibility symbol for distros. Second, it is incompatible with all released versions of QEMU (and perhaps most other VMMs?), thus the default is arguably not the right one.

Fix the first problem, by making CONFIG_KVM_VM_MEMORY_ATTRIBUTES an internal configuration symbol that is the equivalent of the old CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES, and use a more descriptive name for the private memory attribute. Fix the second by changing the default to y if either SEV or TDX are enabled; leaving it n for CONFIG_KVM_SW_PROTECTED_VM as it is only useful for selftests.

The last patch is a simple code cleanup to remove the static call and module parameter overhead when the VM-level attribute is absent.

Thanks,

Paolo

Paolo Bonzini (3):
KVM: split CONFIG_KVM_PRIVATE_MEMATTR_VM out of
KVM_VM_MEMORY_ATTRIBUTES
KVM: x86: leave the legacy private attribute in for TDX and SEV
KVM: compile out all !gmem_in_place_conversion code unless
CONFIG_KVM_PRIVATE_MEMATTR_VM

 Documentation/admin-guide/kernel-parameters.txt |  4 ++--
 arch/x86/kvm/Kconfig                            |  6 ++++--
 include/linux/kvm_host.h                        | 13 ++++++-------
 virt/kvm/Kconfig                                |  3 +++
 virt/kvm/kvm_main.c                             | 15 ++++++++-------
 5 files changed, 23 insertions(+), 18 deletions(-)
Signature · 1 line
2.52.0