On Tue, Sep 01, 2026, Fuad Tabba wrote: > Hi Sean, Ackerley, > > On Mon, 31 Aug 2026 at 01:25, Ackerley Tng via B4 Relay > <[email protected]> wrote: > ... > > + kvm.gmem_in_place_conversion= > > + [KVM] Controls whether KVM enables in-place > > conversion > > + support for guest_memfd and tracks the > > private/shared > > + state of memory per guest_memfd instead of per VM. > > + > > + If enabled, KVM enables the > > KVM_SET_MEMORY_ATTRIBUTES2 > > + ioctl on guest_memfd file descriptors and disables > > the > > + legacy VM-scoped KVM_SET_MEMORY_ATTRIBUTES ioctl for > > + private memory state tracking. Only the > > + KVM_MEMORY_ATTRIBUTE_PRIVATE attribute moves to > > + per-guest_memfd tracking; other attributes remain > > + per-VM. > > + > > + This parameter toggles KVM's in-place conversion > > + capability support. Whether a VMM uses separate > > backends > > + or out-of-place memory management is determined by > > + userspace VMM design. > > + > > + Note, this parameter is only available when > > + CONFIG_KVM_VM_MEMORY_ATTRIBUTES=y. When > > + CONFIG_KVM_VM_MEMORY_ATTRIBUTES is not set, in-place > > + conversion is unconditionally enabled. > > + > > + Default is Y (on). > > The parameter is only settable when CONFIG_KVM_VM_MEMORY_ATTRIBUTES=y, and > in that config gmem_in_place_conversion initialises to > !IS_ENABLED(CONFIG_KVM_VM_MEMORY_ATTRIBUTES), i.e. N, not Y. Is the doc line > wrong, or is N-by-default not what was intended here?
The doc is wrong. The intent is to maintain backwards compatibility with existing deployments if KVM_VM_MEMORY_ATTRIBUTES=y. > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index 05c518c9b8078..929fd3e1a01e6 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -103,7 +103,10 @@ static bool __ro_after_init allow_unsafe_mappings; > > module_param(allow_unsafe_mappings, bool, 0444); > > > > #ifdef kvm_arch_has_private_mem > > -bool __ro_after_init gmem_in_place_conversion = false; > > +bool __ro_after_init gmem_in_place_conversion = > > !IS_ENABLED(CONFIG_KVM_VM_MEMORY_ATTRIBUTES); > > +#ifdef CONFIG_KVM_VM_MEMORY_ATTRIBUTES > > +module_param(gmem_in_place_conversion, bool, 0444); > > +#endif > > EXPORT_SYMBOL_FOR_KVM_INTERNAL(gmem_in_place_conversion); > > #endif
