iommu/io-pgtable: Introduce unmap_pages() as a page table op
authorIsaac J. Manjarres <isaacm@codeaurora.org>
Wed, 16 Jun 2021 13:38:42 +0000 (06:38 -0700)
committerJoerg Roedel <jroedel@suse.de>
Mon, 26 Jul 2021 10:37:06 +0000 (12:37 +0200)
commit374c15594c4ee0dfcceb38852bd43be09070f402
tree738df23763c60285c0fa6b37200f9d39d3ee872c
parentff1176468d368232b684f75e82563369208bc371
iommu/io-pgtable: Introduce unmap_pages() as a page table op

The io-pgtable code expects to operate on a single block or
granule of memory that is supported by the IOMMU hardware when
unmapping memory.

This means that when a large buffer that consists of multiple
such blocks is unmapped, the io-pgtable code will walk the page
tables to the correct level to unmap each block, even for blocks
that are virtually contiguous and at the same level, which can
incur an overhead in performance.

Introduce the unmap_pages() page table op to express to the
io-pgtable code that it should unmap a number of blocks of
the same size, instead of a single block. Doing so allows
multiple blocks to be unmapped in one call to the io-pgtable
code, reducing the number of page table walks, and indirect
calls.

Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
Link: https://lore.kernel.org/r/1623850736-389584-2-git-send-email-quic_c_gdjako@quicinc.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
include/linux/io-pgtable.h