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: <8bd88c21-4164-4e10-8605-d6a8483d0aeb@redhat.com>
Date: Tue, 20 May 2025 19:41:19 +0200
From: David Hildenbrand <david@...hat.com>
To: Peter Xu <peterx@...hat.com>, Alex Williamson <alex.williamson@...hat.com>
Cc: lizhe.67@...edance.com, kvm@...r.kernel.org,
 linux-kernel@...r.kernel.org, muchun.song@...ux.dev
Subject: Re: [PATCH v3] vfio/type1: optimize vfio_pin_pages_remote() for huge
 folio

On 20.05.25 18:59, Peter Xu wrote:
> Hi, Alex,
> 
> On Tue, May 20, 2025 at 08:07:19AM -0600, Alex Williamson wrote:
>> Peter, David, if you wouldn't mind double checking the folio usage
>> here, I'd appreciate it.  The underlying assumption used here is that
>> folios always have physically contiguous pages, so we can increment at
>> the remainder of the folio_nr_pages() rather than iterate each page.
> 
> Yes I think so.  E.g., there's comment above folio definition too:

It has consecutive PFNs, yes (i.e., pfn++). The "struct page" might not 
be consecutive (i.e., page++ does not work for larger folios).

> 
> /**
>   * struct folio - Represents a contiguous set of bytes.
>   * ...
>   * A folio is a physically, virtually and logically contiguous set
>   * of bytes...
>   */
> 
> For 1G, I wonder if in the future vfio can also use memfd_pin_folios()
> internally when possible, e.g. after stumbled on top of a hugetlb folio
> when filling the batch.

Yeah, or have a better GUP interface that gives us folio ranges instead 
of individual pages.

Using memfd directly is obviously better where possible.

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ