[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLly++6PDqzNF6YH@yzhao56-desk.sh.intel.com>
Date: Thu, 4 Sep 2025 19:07:39 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>, <pbonzini@...hat.com>,
<seanjc@...gle.com>, <linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>,
<x86@...nel.org>, <rick.p.edgecombe@...el.com>, <dave.hansen@...el.com>,
<kas@...nel.org>, <tabba@...gle.com>, <ackerleytng@...gle.com>,
<michael.roth@....com>, <david@...hat.com>, <vannapurve@...gle.com>,
<vbabka@...e.cz>, <thomas.lendacky@....com>, <pgonda@...gle.com>,
<fan.du@...el.com>, <jun.miao@...el.com>, <ira.weiny@...el.com>,
<isaku.yamahata@...el.com>, <xiaoyao.li@...el.com>, <chao.p.peng@...el.com>
Subject: Re: [RFC PATCH v2 17/23] KVM: guest_memfd: Split for punch hole and
private-to-shared conversion
On Thu, Sep 04, 2025 at 05:48:42PM +0800, Yan Zhao wrote:
> On Thu, Sep 04, 2025 at 03:58:54PM +0800, Binbin Wu wrote:
> > > @@ -1906,8 +1926,14 @@ static int kvm_gmem_error_folio(struct address_space *mapping, struct folio *fol
> > > start = folio->index;
> > > end = start + folio_nr_pages(folio);
> > > - list_for_each_entry(gmem, gmem_list, entry)
> > > - kvm_gmem_invalidate_begin_and_zap(gmem, start, end);
> > > + /* The size of the SEPT will not exceed the size of the folio */
> > To me, the comment alone without the context doesn't give a direct expression that
> > split is not needed. If it's not too wordy, could you make it more informative?
> What about:
> The zap is limited to the range covered by a single folio.
> As a S-EPT leaf entry can't cover a range larger than its backend folio size,
> the zap can't cross two S-EPT leaf entries. So, no split is required.
Sorry, my brain just froze.
Should just be:
As a leaf SPTE can't cover a range larger than its backend folio size,
no splitting is required before the zap.
> > > + list_for_each_entry(gmem, gmem_list, entry) {
> > > + enum kvm_gfn_range_filter filter;
> > > +
> > > + kvm_gmem_invalidate_begin(gmem, start, end);
> > > + filter = KVM_FILTER_PRIVATE | KVM_FILTER_SHARED;
> > > + kvm_gmem_zap(gmem, start, end, filter);
> > > + }
> > > /*
> > > * Do not truncate the range, what action is taken in response to the
> >
Powered by blists - more mailing lists