[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <diqzzf8oazh4.fsf@google.com>
Date: Fri, 14 Nov 2025 16:52:55 -0800
From: Ackerley Tng <ackerleytng@...gle.com>
To: Yan Zhao <yan.y.zhao@...el.com>
Cc: cgroups@...r.kernel.org, kvm@...r.kernel.org, linux-doc@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
linux-trace-kernel@...r.kernel.org, x86@...nel.org, akpm@...ux-foundation.org,
binbin.wu@...ux.intel.com, bp@...en8.de, brauner@...nel.org,
chao.p.peng@...el.com, chenhuacai@...nel.org, corbet@....net,
dave.hansen@...el.com, dave.hansen@...ux.intel.com, david@...hat.com,
dmatlack@...gle.com, erdemaktas@...gle.com, fan.du@...el.com, fvdl@...gle.com,
haibo1.xu@...el.com, hannes@...xchg.org, hch@...radead.org, hpa@...or.com,
hughd@...gle.com, ira.weiny@...el.com, isaku.yamahata@...el.com, jack@...e.cz,
james.morse@....com, jarkko@...nel.org, jgg@...pe.ca, jgowans@...zon.com,
jhubbard@...dia.com, jthoughton@...gle.com, jun.miao@...el.com,
kai.huang@...el.com, keirf@...gle.com, kent.overstreet@...ux.dev,
liam.merwick@...cle.com, maciej.wieczor-retman@...el.com,
mail@...iej.szmigiero.name, maobibo@...ngson.cn,
mathieu.desnoyers@...icios.com, maz@...nel.org, mhiramat@...nel.org,
mhocko@...nel.org, mic@...ikod.net, michael.roth@....com, mingo@...hat.com,
mlevitsk@...hat.com, mpe@...erman.id.au, muchun.song@...ux.dev,
nikunj@....com, nsaenz@...zon.es, oliver.upton@...ux.dev, palmer@...belt.com,
pankaj.gupta@....com, paul.walmsley@...ive.com, pbonzini@...hat.com,
peterx@...hat.com, pgonda@...gle.com, prsampat@....com, pvorel@...e.cz,
qperret@...gle.com, richard.weiyang@...il.com, rick.p.edgecombe@...el.com,
rientjes@...gle.com, rostedt@...dmis.org, roypat@...zon.co.uk,
rppt@...nel.org, seanjc@...gle.com, shakeel.butt@...ux.dev, shuah@...nel.org,
steven.price@....com, suzuki.poulose@....com, tabba@...gle.com,
tglx@...utronix.de, thomas.lendacky@....com, vannapurve@...gle.com,
vbabka@...e.cz, viro@...iv.linux.org.uk, vkuznets@...hat.com, will@...nel.org,
willy@...radead.org, wyihan@...gle.com, xiaoyao.li@...el.com,
yilun.xu@...el.com, yuzenghui@...wei.com
Subject: Re: [RFC PATCH v1 06/37] KVM: guest_memfd: Update kvm_gmem_populate()
to use gmem attributes
Yan Zhao <yan.y.zhao@...el.com> writes:
>> #ifdef CONFIG_HAVE_KVM_ARCH_GMEM_POPULATE
>> +static bool kvm_gmem_range_is_private(struct gmem_inode *gi, pgoff_t index,
>> + size_t nr_pages, struct kvm *kvm, gfn_t gfn)
>> +{
>> + pgoff_t end = index + nr_pages - 1;
>> + void *entry;
>> +
>> + if (vm_memory_attributes)
>> + return kvm_range_has_vm_memory_attributes(kvm, gfn, gfn + nr_pages,
>> + KVM_MEMORY_ATTRIBUTE_PRIVATE,
>> + KVM_MEMORY_ATTRIBUTE_PRIVATE);
> Can't compile kvm_range_has_vm_memory_attributes() if
> CONFIG_KVM_VM_MEMORY_ATTRIBUTES is not set.
Thanks! I will fix this in the next revision.
We've been discussing HugeTLB support in the guest_memfd upstream calls
and I'd like to add a quick follow up here, with code, for anyone who
might be interested. Here's a WIP tree:
https://github.com/googleprodkernel/linux-cc/tree/wip-gmem-conversions-hugetlb-restructuring
This tree was based off kvm-next (as of 2025-10-08), and includes
+ Mmap fixes from Sean
+ NUMA mempolicy support from Shivank Garg (AMD)
+ Some cleanup patches from Sean
+ Conversion series [1] with some cleanups (Thanks for the comments and
reviews on this series! Haven't had time to figure out all of it,
addressed some first)
+ st_blocks fix for guest_memfd, which was discussed at the guest_memfd
upstream call: slides [2]
+ HugeTLB support without conversion: this stage does not yet take into
account comments from the upstream call. This stage provides support
for HugeTLB to be used through guest_memfd for private memory. This
has to be used with the KVM parameter vm_memory_attributes set to
true. This stage can be used to test Yan's TDX huge page support by
setting up guest_memfd with HugeTLB just for private memory, with
shared memory being taken from elsewhere.
+ HugeTLB support with conversion and folio restructuring: this stage
also does not take into account comments from the upstream call, so it
still disables the INIT_SHARED flag, although HugeTLB can now be used
with in-place conversion for both shared and private memory. This can
be used to test Yan's TDX huge page support.
[1] https://lore.kernel.org/all/cover.1760731772.git.ackerleytng@google.com/T/
[2] https://lpc.events/event/18/contributions/1764/attachments/1409/3715/2025-10-30%20guest_memfd%20upstream%20call_%20guest_memfd%20HugeTLB%20support%20overview.pdf
Powered by blists - more mailing lists