From: Michael Roth <michael.roth@amd.com>
To: <kvm@vger.kernel.org>
Cc: <linux-coco@lists.linux.dev>, Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Isaku Yamahata <isaku.yamahata@linux.intel.com>,
Xu Yilun <yilun.xu@linux.intel.com>,
Binbin Wu <binbin.wu@linux.intel.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Matthew Wilcox <willy@infradead.org>
Subject: [PATCH gmem 0/6] gmem fix-ups and interfaces for populating gmem pages
Date: Fri, 29 Mar 2024 16:24:38 -0500 [thread overview]
Message-ID: <20240329212444.395559-1-michael.roth@amd.com> (raw)
These patches are based on top of:
https://git.kernel.org/pub/scm/virt/kvm/kvm.git/log/?h=kvm-coco-queue
and are also available from:
https://github.com/AMDESE/linux/commits/kvm-gmem-common-v1/
Overview
--------
This is a small collection of patches that addresses some review comments
from Paolo's series:
[PATCH 00/21] TDX/SNP part 1 of n, for 6.9
https://lore.kernel.org/lkml/20240227232100.478238-1-pbonzini@redhat.com/
and also introduces some flags and interfaces that might also be relevant to
the scope of that series.
I'm posting these together initially as they comprise what may be the last
batch of SNP dependencies that are potentially relevant to TDX and a common
CoCo tree, but can split out or move back into SNP series, whatever is
deemed preferable.
Patch Layout
------------
1-3: These are smaller fix-ups to address various review comments pertaining
to the gmem hooks that were originally part of the SNP hypervisor
postings. In each case they can be potentially squashed into the
corresponding patches in kvm-coco-queue if that's preferable.
4-5: This introduces an AS_INACCESSIBLE flag that prevents unexpected
accesses to hole-punched gmem pages before invalidation hooks have had
a chance to make them safely accessible to the host again.
6: This implements an interface that was proposed by Sean during this[1]
discussion regarding SNP_LAUNCH_UPDATE and discussed in more detail
during the PUCK session "Finalizing internal guest_memfd APIs for
SNP/TDX". It is not verbatim what was discussed, but is hopefully a
reasonable starting point to handle use-cases like SNP_LAUNCH_UPDATE.
It may also avoid the need to export kvm_gmem_get_uninit_pfn() as an
external interface if SNP_LAUNCH_UPDATE is still the only
known/planned user.
Thanks!
[1] https://lore.kernel.org/lkml/Zb1yv67h6gkYqqv9@google.com/
----------------------------------------------------------------
Michael Roth (6):
KVM: guest_memfd: Fix stub for kvm_gmem_get_uninit_pfn()
KVM: guest_memfd: Only call kvm_arch_gmem_prepare hook if necessary
KVM: x86: Pass private/shared fault indicator to gmem_validate_fault
mm: Introduce AS_INACCESSIBLE for encrypted/confidential memory
KVM: guest_memfd: Use AS_INACCESSIBLE when creating guest_memfd inode
KVM: guest_memfd: Add interface for populating gmem pages with user data
arch/x86/include/asm/kvm_host.h | 3 ++-
arch/x86/kvm/mmu/mmu.c | 3 ++-
include/linux/kvm_host.h | 45 +++++++++++++++++++++++++++++++++++-
include/linux/pagemap.h | 1 +
mm/truncate.c | 3 ++-
virt/kvm/guest_memfd.c | 51 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 102 insertions(+), 4 deletions(-)
next reply other threads:[~2024-03-29 21:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-29 21:24 Michael Roth [this message]
2024-03-29 21:24 ` [PATCH gmem 1/6] KVM: guest_memfd: Fix stub for kvm_gmem_get_uninit_pfn() Michael Roth
2024-03-29 21:24 ` [PATCH gmem 2/6] KVM: guest_memfd: Only call kvm_arch_gmem_prepare hook if necessary Michael Roth
2024-04-01 5:06 ` Binbin Wu
2024-04-02 21:50 ` Isaku Yamahata
2024-03-29 21:24 ` [PATCH gmem 3/6] KVM: x86: Pass private/shared fault indicator to gmem_validate_fault Michael Roth
2024-03-29 21:24 ` [PATCH gmem 4/6] mm: Introduce AS_INACCESSIBLE for encrypted/confidential memory Michael Roth
2024-04-15 13:19 ` Vlastimil Babka
2024-03-29 21:24 ` [PATCH gmem 5/6] KVM: guest_memfd: Use AS_INACCESSIBLE when creating guest_memfd inode Michael Roth
2024-04-15 13:21 ` Vlastimil Babka
2024-03-29 21:24 ` [PATCH gmem 6/6] KVM: guest_memfd: Add interface for populating gmem pages with user data Michael Roth
2024-04-15 13:36 ` Vlastimil Babka
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=20240329212444.395559-1-michael.roth@amd.com \
--to=michael.roth@amd.com \
--cc=binbin.wu@linux.intel.com \
--cc=isaku.yamahata@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=willy@infradead.org \
--cc=xiaoyao.li@intel.com \
--cc=yilun.xu@linux.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).