lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGtprH8O535VFYSTp+zqXF0cptDwOn5gwmJa=BLy1zoCdLa=iQ@mail.gmail.com>
Date: Mon, 14 Jul 2025 17:41:17 -0700
From: Vishal Annapurve <vannapurve@...gle.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Sean Christopherson <seanjc@...gle.com>, Michael Roth <michael.roth@....com>, 
	Yan Zhao <yan.y.zhao@...el.com>, pbonzini@...hat.com, kvm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, rick.p.edgecombe@...el.com, kai.huang@...el.com, 
	adrian.hunter@...el.com, reinette.chatre@...el.com, xiaoyao.li@...el.com, 
	tony.lindgren@...el.com, binbin.wu@...ux.intel.com, dmatlack@...gle.com, 
	isaku.yamahata@...el.com, david@...hat.com, ackerleytng@...gle.com, 
	tabba@...gle.com, chao.p.peng@...el.com
Subject: Re: [RFC PATCH] KVM: TDX: Decouple TDX init mem region from kvm_gmem_populate()

On Mon, Jul 14, 2025 at 4:10 PM Ira Weiny <ira.weiny@...el.com> wrote:
>
> Vishal Annapurve wrote:
> > On Fri, Jul 11, 2025 at 3:56 PM Sean Christopherson <seanjc@...gle.com> wrote:
> > >
> > > On Fri, Jul 11, 2025, Ira Weiny wrote:
> > > > Michael Roth wrote:
> > > > > For in-place conversion: the idea is that userspace will convert
> > > > > private->shared to update in-place, then immediately convert back
> > > > > shared->private;
> > > >
> > > > Why convert from private to shared and back to private?  Userspace which
> > > > knows about mmap and supports it should create shared pages, mmap, write
> > > > data, then convert to private.
> > >
> > > Dunno if there's a strong usecase for converting to shared *and* populating the
> > > data, but I also don't know that it's worth going out of our way to prevent such
> > > behavior, at least not without a strong reason to do so.  E.g. if it allowed for
> > > a cleaner implementation or better semantics, then by all means.  But I don't
> > > think that's true here?  Though I haven't thought hard about this, so don't
> > > quote me on that. :-)
> >
> > If this is a huge page backing, starting as shared will split all the
> > pages to 4K granularity upon allocation.
>
> Why?  What is the reason it needs to be split?

I think you and Sean have similar questions.

This init private-> shared-> fill -> private scheme is for userspace
for the initial guest payload population. Another choice userspace has
is to begin the whole file as shared -> fill -> only needed ranges to
private.

Regarding shared memory ranges for CC VMs, guest_memfd huge page
support [1] simply works by splitting hugepages in 4K chunks for
shared regions to allow core-mm to manage the pages without affecting
rest of the private ranges within a hugepage. The need for splitting
has been discussed in MM alignment calls and LPC 2024[2].

[1] https://lore.kernel.org/lkml/cover.1747264138.git.ackerleytng@google.com/
[2] https://lpc.events/event/18/contributions/1764/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ