Re: [RFC PATCH v2 17/23] KVM: guest_memfd: Split for punch hole and private-to-shared conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> > 




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux