diff options
| author | Alex Williamson <[email protected]> | 2025-02-18 22:22:06 +0000 |
|---|---|---|
| committer | Alex Williamson <[email protected]> | 2025-02-27 18:55:54 +0000 |
| commit | 0fd06844de5d063cb384384e06a11ec7141a35d5 (patch) | |
| tree | 8d52e8eb85fb1fca1f89b296ff53816d17792981 /lib/crypto/mpi/mpi-add.c | |
| parent | mm: Provide address mask in struct follow_pfnmap_args (diff) | |
| download | kernel-0fd06844de5d063cb384384e06a11ec7141a35d5.tar.gz kernel-0fd06844de5d063cb384384e06a11ec7141a35d5.zip | |
vfio/type1: Use mapping page mask for pfnmaps
vfio-pci supports huge_fault for PCI MMIO BARs and will insert pud and
pmd mappings for well aligned mappings. follow_pfnmap_start() walks the
page table and therefore knows the page mask of the level where the
address is found and returns this through follow_pfnmap_args.addr_mask.
Subsequent pfns from this address until the end of the mapping page are
necessarily consecutive. Use this information to retrieve a range of
pfnmap pfns in a single pass.
With optimal mappings and alignment on systems with 1GB pud and 4KB
page size, this reduces iterations for DMA mapping PCI BARs by a
factor of 256K. In real world testing, the overhead of iterating
pfns for a VM DMA mapping a 32GB PCI BAR is reduced from ~1s to
sub-millisecond overhead.
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Mitchell Augustin <[email protected]>
Tested-by: Mitchell Augustin <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-add.c')
0 files changed, 0 insertions, 0 deletions
