On 8/8/2026 5:52 AM, Ackerley Tng via B4 Relay wrote: > From: Sean Christopherson <[email protected]> > > Start plumbing in guest_memfd support for in-place private<=>shared > conversions by tracking attributes via a maple tree. KVM currently tracks > private vs. shared attributes on a per-VM basis, which made sense when a > guest_memfd _only_ supported private memory, but tracking per-VM simply > can't work for in-place conversions as the shared/private status of a given > page needs to be per-gmem_inode, not per-VM. > > Use the filemap invalidation lock to protect the maple tree, as taking the > lock for read when faulting in memory (for userspace or the guest) isn't > expected to result in meaningful contention, and using a separate lock > would add significant complexity (avoiding deadlock is quite difficult). > > Co-developed-by: Vishal Annapurve <[email protected]> > Signed-off-by: Vishal Annapurve <[email protected]> > Co-developed-by: Fuad Tabba <[email protected]> > Signed-off-by: Fuad Tabba <[email protected]> > Signed-off-by: Sean Christopherson <[email protected]> > Tested-by: Shivank Garg <[email protected]> > Reviewed-by: Xiaoyao Li <[email protected]> > Co-developed-by: Ackerley Tng <[email protected]> > Signed-off-by: Ackerley Tng <[email protected]>
With Sean's fixup in https://lore.kernel.org/kvm/[email protected]/ Reviewed-by: Binbin Wu <[email protected]>
