From: Vishal Annapurve <vannapurve@google.com>
To: Michael Roth <michael.roth@amd.com>
Cc: kvm@vger.kernel.org, linux-coco@lists.linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
jroedel@suse.de, thomas.lendacky@amd.com, pbonzini@redhat.com,
seanjc@google.com, vbabka@suse.cz, amit.shah@amd.com,
pratikrajesh.sampat@amd.com, ashish.kalra@amd.com,
liam.merwick@oracle.com, david@redhat.com,
ackerleytng@google.com, quic_eberman@quicinc.com
Subject: Re: [PATCH RFC v1 0/5] KVM: gmem: 2MB THP support and preparedness tracking changes
Date: Mon, 10 Feb 2025 17:16:33 -0800 [thread overview]
Message-ID: <CAGtprH9ehiz+yKfQqj6JeObaPv0DPUsoAH+YVdSeuzL9zhw9tA@mail.gmail.com> (raw)
In-Reply-To: <20241212063635.712877-1-michael.roth@amd.com>
On Wed, Dec 11, 2024 at 10:37 PM Michael Roth <michael.roth@amd.com> wrote:
>
> This patchset is also available at:
>
> https://github.com/amdese/linux/commits/snp-prepare-thp-rfc1
>
> and is based on top of Paolo's kvm-coco-queue-2024-11 tag which includes
> a snapshot of his patches[1] to provide tracking of whether or not
> sub-pages of a huge folio need to have kvm_arch_gmem_prepare() hooks issued
> before guest access:
>
> d55475f23cea KVM: gmem: track preparedness a page at a time
> 64b46ca6cd6d KVM: gmem: limit hole-punching to ranges within the file
> 17df70a5ea65 KVM: gmem: add a complete set of functions to query page preparedness
> e3449f6841ef KVM: gmem: allocate private data for the gmem inode
>
> [1] https://lore.kernel.org/lkml/20241108155056.332412-1-pbonzini@redhat.com/
>
> This series addresses some of the pending review comments for those patches
> (feel free to squash/rework as-needed), and implements a first real user in
> the form of a reworked version of Sean's original 2MB THP support for gmem.
>
Looking at the work targeted by Fuad to add in-place memory conversion
support via [1] and Ackerley in future to address hugetlb page
support, can the state tracking for preparedness be simplified as?
i) prepare guest memfd ranges when "first time an offset with
mappability = GUEST is allocated or first time an allocated offset has
mappability = GUEST". Some scenarios that would lead to guest memfd
range preparation:
- Create file with default mappability to host, fallocate, convert
- Create file with default mappability to Guest, guest faults on
private memory
ii) Unprepare guest memfd ranges when "first time an offset with
mappability = GUEST is deallocated or first time an allocated offset
has lost mappability = GUEST attribute", some scenarios that would
lead to guest memfd range unprepare:
- Truncation
- Conversion
iii) To handle scenarios with hugepages, page splitting/merging in
guest memfd can also signal change in page granularities.
[1] https://lore.kernel.org/kvm/20250117163001.2326672-1-tabba@google.com/
next prev parent reply other threads:[~2025-02-11 1:16 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 6:36 Michael Roth
2024-12-12 6:36 ` [PATCH 1/5] KVM: gmem: Don't rely on __kvm_gmem_get_pfn() for preparedness Michael Roth
2025-01-22 14:39 ` Tom Lendacky
2025-02-20 1:12 ` Michael Roth
2024-12-12 6:36 ` [PATCH 2/5] KVM: gmem: Don't clear pages that have already been prepared Michael Roth
2024-12-12 6:36 ` [PATCH 3/5] KVM: gmem: Hold filemap invalidate lock while allocating/preparing folios Michael Roth
2025-03-14 9:20 ` Yan Zhao
2025-04-07 8:25 ` Yan Zhao
2025-04-23 20:30 ` Ackerley Tng
2025-05-19 17:04 ` Ackerley Tng
2025-05-21 6:46 ` Yan Zhao
2025-06-03 1:05 ` Vishal Annapurve
2025-06-03 1:31 ` Yan Zhao
2025-06-04 6:28 ` Vishal Annapurve
2025-06-12 12:40 ` Yan Zhao
2025-06-12 14:43 ` Vishal Annapurve
2025-07-03 6:29 ` Yan Zhao
2025-06-13 15:19 ` Michael Roth
2025-06-13 18:04 ` Michael Roth
2025-07-03 6:33 ` Yan Zhao
2024-12-12 6:36 ` [PATCH 4/5] KVM: SEV: Improve handling of large ranges in gmem prepare callback Michael Roth
2024-12-12 6:36 ` [PATCH 5/5] KVM: Add hugepage support for dedicated guest memory Michael Roth
2025-03-14 9:50 ` Yan Zhao
2024-12-20 11:31 ` [PATCH RFC v1 0/5] KVM: gmem: 2MB THP support and preparedness tracking changes David Hildenbrand
2025-01-07 12:11 ` Shah, Amit
2025-01-22 14:25 ` David Hildenbrand
2025-03-14 9:09 ` Yan Zhao
2025-03-14 9:33 ` David Hildenbrand
2025-03-14 11:19 ` Yan Zhao
2025-03-18 2:24 ` Yan Zhao
2025-03-18 19:13 ` David Hildenbrand
2025-03-19 7:39 ` Yan Zhao
2025-02-11 1:16 ` Vishal Annapurve [this message]
2025-02-20 1:09 ` Michael Roth
2025-03-14 9:16 ` Yan Zhao
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=CAGtprH9ehiz+yKfQqj6JeObaPv0DPUsoAH+YVdSeuzL9zhw9tA@mail.gmail.com \
--to=vannapurve@google.com \
--cc=ackerleytng@google.com \
--cc=amit.shah@amd.com \
--cc=ashish.kalra@amd.com \
--cc=david@redhat.com \
--cc=jroedel@suse.de \
--cc=kvm@vger.kernel.org \
--cc=liam.merwick@oracle.com \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=pratikrajesh.sampat@amd.com \
--cc=quic_eberman@quicinc.com \
--cc=seanjc@google.com \
--cc=thomas.lendacky@amd.com \
--cc=vbabka@suse.cz \
/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