Thread (184 messages) 184 messages, 12 authors, 4h ago

Re: [PATCH v8 24/46] KVM: guest_memfd: Make in-place conversion the default\

From: Sean Christopherson <seanjc@google.com>
Date: 2026-07-01 13:53:21
Also in: kvm, linux-coco, linux-doc, linux-kselftest, linux-mm, lkml

On Wed, Jul 01, 2026, Xiaoyao Li wrote:
On 6/27/2026 3:06 AM, Sean Christopherson wrote:
quoted
On Fri, Jun 26, 2026, Yan Zhao wrote:
quoted
My first impression of gmem_in_place_conversion=true was that it enforces gmem
in-place conversion. However, it actually only enforces per-gmem private/shared
attribute.
My worry was that people might think it's a kernel bug if userspace can still
have shared memory from other sources after they configured
gmem_in_place_conversion=true.
Ah, I see where you're coming from.  FWIW, truly enforcing in-place conversion
is flat out impossible.  E.g. userspace can simply replace the memslot, at which
point the memory effectively reverts to shared.
would something like below enforce the in-place conversion?
No.
Userspace can create a memslot without gmem fd, but that memslot can only
serve as shared memory and cannot be converted. So it doesn't violate the
in-place conversion.
But userspace can delete said memslot and replace it with a memslot pointing at
a guest_memfd instance that was created without INIT_SHARED, at which point
userspace has effected a shared=>private conversion.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help