From: Nikita Kalyazin <kalyazin@amazon.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: <akpm@linux-foundation.org>, <pbonzini@redhat.com>,
<shuah@kernel.org>, <viro@zeniv.linux.org.uk>,
<brauner@kernel.org>, <muchun.song@linux.dev>, <hughd@google.com>,
<kvm@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<linux-fsdevel@vger.kernel.org>, <jack@suse.cz>,
<Liam.Howlett@oracle.com>, <jannh@google.com>,
<ryan.roberts@arm.com>, <david@redhat.com>,
<jthoughton@google.com>, <peterx@redhat.com>, <graf@amazon.de>,
<jgowans@amazon.com>, <roypat@amazon.co.uk>, <derekmn@amazon.com>,
<nsaenz@amazon.es>, <xmarcalx@amazon.com>
Subject: Re: [PATCH v3 0/6] KVM: guest_memfd: support for uffd minor
Date: Fri, 4 Apr 2025 17:56:58 +0100 [thread overview]
Message-ID: <7b8d9aa6-99ff-4986-bd16-664de63ecb58@amazon.com> (raw)
In-Reply-To: <dc4c72a2-41c1-4548-a6ee-5a17895e4940@lucifer.local>
On 04/04/2025 17:33, Lorenzo Stoakes wrote:
> On Fri, Apr 04, 2025 at 03:43:46PM +0000, Nikita Kalyazin wrote:
>> This series is built on top of the Fuad's v7 "mapping guest_memfd backed
>> memory at the host" [1].
>
> Hm if this is based on an unmerged series this seems quite speculative and
> should maybe be an RFC? I mean that series at least still seems quite under
> discussion/experiencing issues?
>
> Maybe worth RFC'ing until that one settles down first to avoid complexity
> in review/application to tree?
Hi,
I dropped the RFC tag because I saw similar examples before, but I'm
happy to bring it back next time if the dependency is not merged until then.
>
> Thanks!
Thanks!
>
>>
>> With James's KVM userfault [2], it is possible to handle stage-2 faults
>> in guest_memfd in userspace. However, KVM itself also triggers faults
>> in guest_memfd in some cases, for example: PV interfaces like kvmclock,
>> PV EOI and page table walking code when fetching the MMIO instruction on
>> x86. It was agreed in the guest_memfd upstream call on 23 Jan 2025 [3]
>> that KVM would be accessing those pages via userspace page tables. In
>> order for such faults to be handled in userspace, guest_memfd needs to
>> support userfaultfd.
>>
>> Changes since v2 [4]:
>> - James: Fix sgp type when calling shmem_get_folio_gfp
>> - James: Improved vm_ops->fault() error handling
>> - James: Add and make use of the can_userfault() VMA operation
>> - James: Add UFFD_FEATURE_MINOR_GUEST_MEMFD feature flag
>> - James: Fix typos and add more checks in the test
>>
>> Nikita
>>
>> [1] https://lore.kernel.org/kvm/20250318161823.4005529-1-tabba@google.com/T/
>> [2] https://lore.kernel.org/kvm/20250109204929.1106563-1-jthoughton@google.com/T/
>> [3] https://docs.google.com/document/d/1M6766BzdY1Lhk7LiR5IqVR8B8mG3cr-cxTxOrAosPOk/edit?tab=t.0#heading=h.w1126rgli5e3
>> [4] https://lore.kernel.org/kvm/20250402160721.97596-1-kalyazin@amazon.com/T/
>>
>> Nikita Kalyazin (6):
>> mm: userfaultfd: generic continue for non hugetlbfs
>> mm: provide can_userfault vma operation
>> mm: userfaultfd: use can_userfault vma operation
>> KVM: guest_memfd: add support for userfaultfd minor
>> mm: userfaultfd: add UFFD_FEATURE_MINOR_GUEST_MEMFD
>> KVM: selftests: test userfaultfd minor for guest_memfd
>>
>> fs/userfaultfd.c | 3 +-
>> include/linux/mm.h | 5 +
>> include/linux/mm_types.h | 4 +
>> include/linux/userfaultfd_k.h | 10 +-
>> include/uapi/linux/userfaultfd.h | 8 +-
>> mm/hugetlb.c | 9 +-
>> mm/shmem.c | 17 +++-
>> mm/userfaultfd.c | 47 ++++++---
>> .../testing/selftests/kvm/guest_memfd_test.c | 99 +++++++++++++++++++
>> virt/kvm/guest_memfd.c | 10 ++
>> 10 files changed, 188 insertions(+), 24 deletions(-)
>>
>>
>> base-commit: 3cc51efc17a2c41a480eed36b31c1773936717e0
>> --
>> 2.47.1
>>
next prev parent reply other threads:[~2025-04-04 16:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 15:43 Nikita Kalyazin
2025-04-04 15:43 ` [PATCH v3 1/6] mm: userfaultfd: generic continue for non hugetlbfs Nikita Kalyazin
2025-06-10 22:22 ` Peter Xu
2025-06-11 12:09 ` Nikita Kalyazin
2025-06-11 12:56 ` Peter Xu
2025-06-20 12:00 ` Nikita Kalyazin
2025-06-20 15:21 ` Peter Xu
2025-06-20 16:51 ` Nikita Kalyazin
2025-04-04 15:43 ` [PATCH v3 2/6] mm: provide can_userfault vma operation Nikita Kalyazin
2025-04-04 15:43 ` [PATCH v3 3/6] mm: userfaultfd: use " Nikita Kalyazin
2025-04-04 15:43 ` [PATCH v3 4/6] KVM: guest_memfd: add support for userfaultfd minor Nikita Kalyazin
2025-06-10 22:25 ` Peter Xu
2025-06-11 12:09 ` Nikita Kalyazin
2025-04-04 15:43 ` [PATCH v3 5/6] mm: userfaultfd: add UFFD_FEATURE_MINOR_GUEST_MEMFD Nikita Kalyazin
2025-04-04 15:43 ` [PATCH v3 6/6] KVM: selftests: test userfaultfd minor for guest_memfd Nikita Kalyazin
2025-04-04 16:33 ` [PATCH v3 0/6] KVM: guest_memfd: support for uffd minor Lorenzo Stoakes
2025-04-04 16:56 ` Nikita Kalyazin [this message]
2025-04-04 16:59 ` Lorenzo Stoakes
2025-04-04 17:12 ` Liam R. Howlett
2025-04-07 11:04 ` Nikita Kalyazin
2025-04-07 13:40 ` Liam R. Howlett
2025-04-07 14:04 ` Nikita Kalyazin
2025-04-07 14:24 ` Liam R. Howlett
2025-04-07 14:46 ` David Hildenbrand
2025-04-07 15:14 ` Lorenzo Stoakes
2025-04-07 15:26 ` David Hildenbrand
2025-04-08 8:20 ` Christian Brauner
2025-04-08 13:15 ` Ackerley Tng
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=7b8d9aa6-99ff-4986-bd16-664de63ecb58@amazon.com \
--to=kalyazin@amazon.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=david@redhat.com \
--cc=derekmn@amazon.com \
--cc=graf@amazon.de \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=jgowans@amazon.com \
--cc=jthoughton@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-fsdevel@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=muchun.song@linux.dev \
--cc=nsaenz@amazon.es \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=roypat@amazon.co.uk \
--cc=ryan.roberts@arm.com \
--cc=shuah@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--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
all inboxes | Powered by JetHome®