From: Peter Xu <peterx@redhat.com>
To: James Houghton <jthoughton@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Jonathan Corbet <corbet@lwn.net>, Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
Yan Zhao <yan.y.zhao@intel.com>,
Nikita Kalyazin <kalyazin@amazon.com>,
Anish Moorthy <amoorthy@google.com>,
Peter Gonda <pgonda@google.com>,
David Matlack <dmatlack@google.com>, Wei W <wei.w.wang@intel.com>,
kvm@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH v1 00/13] KVM: Introduce KVM Userfault
Date: Thu, 16 Jan 2025 15:32:06 -0500 [thread overview]
Message-ID: <Z4lsxgFSdiqpNtdG@x1n> (raw)
In-Reply-To: <Z4lp5QzdOX0oYGOk@x1n>
On Thu, Jan 16, 2025 at 03:19:49PM -0500, Peter Xu wrote:
> James,
>
> Sorry for a late reply.
>
> I still do have one or two pure questions, but nothing directly relevant to
> your series.
>
> On Thu, Jan 02, 2025 at 12:53:11PM -0500, James Houghton wrote:
> > So I'm not pushing for KVM Userfault to replace userfaultfd; it's not
> > worth the extra/duplicated complexity. And at LPC, Paolo and Sean
> > indicated that this direction was indeed wrong. I have another way to
> > make this work in mind. :)
>
> Do you still want to share it, more or less? :)
>
> >
> > For the gmem case, userfaultfd cannot be used, so KVM Userfault isn't
> > replacing it. And as of right now anyway, KVM Userfault *does* provide
> > a complete post-copy system for gmem.
> >
> > When gmem pages can be mapped into userspace, for post-copy to remain
> > functional, userspace-mapped gmem will need userfaultfd integration.
> > Keep in mind that even after this integration happens, userfaultfd
> > alone will *not* be a complete post-copy solution, as vCPU faults
> > won't be resolved via the userspace page tables.
>
> Do you know in context of CoCo, whether a private page can be accessed at
> all outside of KVM?
>
> I think I'm pretty sure now a private page can never be mapped to
> userspace. However, can another module like vhost-kernel access it during
> postcopy? My impression of that is still a yes, but then how about
> vhost-user?
>
> Here, the "vhost-kernel" part represents a question on whether private
> pages can be accessed at all outside KVM. While "vhost-user" part
> represents a question on whether, if the previous vhost-kernel question
> answers as "yes it can", such access attempt can happen in another
> process/task (hence, not only does it lack KVM context, but also not
> sharing the same task context).
Right after I sent it, I just recalled whenever a device needs to access
the page, it needs to be converted to shared pages first..
So I suppose the questions were not valid at all! It is not about the
context but that the pages will be shared always whenever a device in
whatever form will access it..
Fundamentally I'm thinking about whether userfaultfd must support (fd,
offset) tuple. Now I suppose it's not, because vCPUs accessing
private/shared will all exit to userspace, while all non-vCPU / devices can
access shared pages only.
In that case, looks like userfaultfd can support CoCo on device emulations
by sticking with virtual-address traps like before, at least from that
specific POV.
--
Peter Xu
next prev parent reply other threads:[~2025-01-16 20:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 19:13 [PATCH v1 00/13] KVM: Introduce KVM Userfault James Houghton
2024-12-04 19:13 ` [PATCH v1 01/13] KVM: Add KVM_MEM_USERFAULT memslot flag and bitmap James Houghton
2024-12-05 11:52 ` kernel test robot
2024-12-05 14:22 ` kernel test robot
2024-12-06 22:46 ` James Houghton
2024-12-04 19:13 ` [PATCH v1 02/13] KVM: Add KVM_MEMORY_EXIT_FLAG_USERFAULT James Houghton
2024-12-04 19:13 ` [PATCH v1 03/13] KVM: Allow late setting of KVM_MEM_USERFAULT on guest_memfd memslot James Houghton
2024-12-04 19:13 ` [PATCH v1 04/13] KVM: Advertise KVM_CAP_USERFAULT in KVM_CHECK_EXTENSION James Houghton
2024-12-04 19:13 ` [PATCH v1 05/13] KVM: x86/mmu: Add support for KVM_MEM_USERFAULT James Houghton
2024-12-04 19:13 ` [PATCH v1 06/13] KVM: arm64: " James Houghton
2024-12-04 23:07 ` Oliver Upton
2024-12-05 23:31 ` James Houghton
2024-12-06 0:45 ` Oliver Upton
2024-12-04 19:13 ` [PATCH v1 07/13] KVM: selftests: Fix vm_mem_region_set_flags docstring James Houghton
2024-12-04 19:13 ` [PATCH v1 08/13] KVM: selftests: Fix prefault_mem logic James Houghton
2024-12-04 19:13 ` [PATCH v1 09/13] KVM: selftests: Add va_start/end into uffd_desc James Houghton
2024-12-04 19:13 ` [PATCH v1 10/13] KVM: selftests: Add KVM Userfault mode to demand_paging_test James Houghton
2024-12-14 22:46 ` kernel test robot
2024-12-04 19:13 ` [PATCH v1 11/13] KVM: selftests: Inform set_memory_region_test of KVM_MEM_USERFAULT James Houghton
2024-12-04 19:13 ` [PATCH v1 12/13] KVM: selftests: Add KVM_MEM_USERFAULT + guest_memfd toggle tests James Houghton
2024-12-04 19:13 ` [PATCH v1 13/13] KVM: Documentation: Add KVM_CAP_USERFAULT and KVM_MEM_USERFAULT details James Houghton
2024-12-07 1:38 ` Bagas Sanjaya
2024-12-24 21:07 ` [PATCH v1 00/13] KVM: Introduce KVM Userfault Peter Xu
2025-01-02 17:53 ` James Houghton
2025-01-16 20:19 ` Peter Xu
2025-01-16 20:32 ` Peter Xu [this message]
2025-01-16 22:16 ` Sean Christopherson
2025-01-16 23:04 ` James Houghton
2025-01-16 23:17 ` Peter Xu
2025-01-16 23:46 ` Sean Christopherson
2025-01-16 22:51 ` James Houghton
2025-01-16 23:31 ` 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=Z4lsxgFSdiqpNtdG@x1n \
--to=peterx@redhat.com \
--cc=amoorthy@google.com \
--cc=corbet@lwn.net \
--cc=dmatlack@google.com \
--cc=jthoughton@google.com \
--cc=kalyazin@amazon.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=seanjc@google.com \
--cc=wei.w.wang@intel.com \
--cc=yan.y.zhao@intel.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;
as well as URLs for NNTP newsgroup(s).