Thread (145 messages) flat view 145 messages, 11 authors, 7d ago

Re: [PATCH v10 02/41] KVM: guest_memfd: Introduce per-gmem attributes, use to guard user mappings

From: Binbin Wu <hidden>
Date: 2026-08-12 03:27:52
Also in: kvm, linux-coco, linux-doc, linux-kselftest, linux-mm, lkml

On 8/8/2026 5:52 AM, Ackerley Tng via B4 Relay wrote:
From: Sean Christopherson <seanjc@google.com>

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 <redacted>
Signed-off-by: Vishal Annapurve <redacted>
Co-developed-by: Fuad Tabba <redacted>
Signed-off-by: Fuad Tabba <redacted>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Shivank Garg <redacted>
Reviewed-by: Xiaoyao Li <redacted>
Co-developed-by: Ackerley Tng <redacted>
Signed-off-by: Ackerley Tng <redacted>
With Sean's fixup in https://lore.kernel.org/kvm/annqex-kBOc0UJvp@google.com/ (local) 

Reviewed-by: Binbin Wu <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help