linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Nikita Kalyazin <kalyazin@amazon.com>
Cc: James Houghton <jthoughton@google.com>,
	akpm@linux-foundation.org, pbonzini@redhat.com, shuah@kernel.org,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	lorenzo.stoakes@oracle.com, david@redhat.com,
	ryan.roberts@arm.com, quic_eberman@quicinc.com, graf@amazon.de,
	jgowans@amazon.com, roypat@amazon.co.uk, derekmn@amazon.com,
	nsaenz@amazon.es, xmarcalx@amazon.com
Subject: Re: [RFC PATCH 0/5] KVM: guest_memfd: support for uffd missing
Date: Wed, 12 Mar 2025 15:32:30 -0400	[thread overview]
Message-ID: <Z9HhTjEWtM58Zfxf@x1.local> (raw)
In-Reply-To: <7c304c72-1f9c-4a5a-910b-02d0f1514b01@amazon.com>

On Wed, Mar 12, 2025 at 05:07:25PM +0000, Nikita Kalyazin wrote:
> However if MISSING is not registered, the kernel will auto-populate with a
> clear page, ie there is no way to inject custom content from userspace.  To
> explain my use case a bit more, the population thread will be trying to copy
> all guest memory proactively, but there will inevitably be cases where a
> page is accessed through pgtables _before_ it gets populated.  It is not
> desirable for such access to result in a clear page provided by the kernel.

IMHO populating with a zero page in the page cache is fine. It needs to
make sure all accesses will go via the pgtable, as discussed below in my
previous email [1], then nobody will be able to see the zero page, not
until someone updates the content then follow up with a CONTINUE to install
the pgtable entry.

If there is any way that the page can be accessed without the pgtable
installation, minor faults won't work indeed.

> 
> > as long as the content can only be accessed from the pgtable (either via
> > mmap() or GUP on top of it), then afaiu it could work similarly like
> > MISSING faults, because anything trying to access it will be trapped.

[1]

-- 
Peter Xu



  reply	other threads:[~2025-03-12 19:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 13:30 Nikita Kalyazin
2025-03-03 13:30 ` [RFC PATCH 1/5] KVM: guest_memfd: add kvm_gmem_vma_is_gmem Nikita Kalyazin
2025-03-03 13:30 ` [RFC PATCH 2/5] KVM: guest_memfd: add support for uffd missing Nikita Kalyazin
2025-03-03 13:30 ` [RFC PATCH 3/5] mm: userfaultfd: allow to register userfaultfd for guest_memfd Nikita Kalyazin
2025-03-03 13:30 ` [RFC PATCH 4/5] mm: userfaultfd: support continue " Nikita Kalyazin
2025-03-03 13:30 ` [RFC PATCH 5/5] KVM: selftests: add uffd missing test " Nikita Kalyazin
2025-03-03 21:29 ` [RFC PATCH 0/5] KVM: guest_memfd: support for uffd missing Peter Xu
2025-03-05 19:35   ` James Houghton
2025-03-05 20:29     ` Peter Xu
2025-03-10 18:12       ` Nikita Kalyazin
2025-03-10 19:57         ` Peter Xu
2025-03-11 16:56           ` Nikita Kalyazin
2025-03-12 15:45             ` Peter Xu
2025-03-12 17:07               ` Nikita Kalyazin
2025-03-12 19:32                 ` Peter Xu [this message]
2025-03-13 15:25                   ` Nikita Kalyazin
2025-03-13 19:12                     ` Peter Xu
2025-03-13 22:13                       ` Nikita Kalyazin
2025-03-13 22:38                         ` Peter Xu
2025-03-14 17:12                           ` Nikita Kalyazin
2025-03-14 18:32                             ` Peter Xu
2025-03-14 20:04                             ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z9HhTjEWtM58Zfxf@x1.local \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=derekmn@amazon.com \
    --cc=graf@amazon.de \
    --cc=jgowans@amazon.com \
    --cc=jthoughton@google.com \
    --cc=kalyazin@amazon.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=nsaenz@amazon.es \
    --cc=pbonzini@redhat.com \
    --cc=quic_eberman@quicinc.com \
    --cc=roypat@amazon.co.uk \
    --cc=ryan.roberts@arm.com \
    --cc=shuah@kernel.org \
    --cc=xmarcalx@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox