Skip to content

Generic IOMMU page table framework

Will Deacon linux-arm-kernel linux-iommu 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iommu: introduce generic page table allocation frameworkdrivers/iommu/Kconfig drivers/iommu/Makefile drivers/iommu/io-pgtable.c +1 more+145 -02 replies
1/4iommu: introduce generic page table allocation framework+0 -01 reply
1/4iommu: introduce generic page table allocation framework+0 -00 replies
1/4iommu: introduce generic page table allocation framework+0 -00 replies
2/4iommu: add ARM LPAE page table allocatorMAINTAINERS drivers/iommu/Kconfig drivers/iommu/Makefile +3 more+765 -03 replies
2/4iommu: add ARM LPAE page table allocator+0 -01 reply
2/4iommu: add ARM LPAE page table allocator+0 -01 reply
2/4iommu: add ARM LPAE page table allocator+0 -00 replies
2/4iommu: add ARM LPAE page table allocator+0 -01 reply
2/4iommu: add ARM LPAE page table allocator+0 -00 replies
2/4iommu: add ARM LPAE page table allocator+0 -01 reply
2/4iommu: add ARM LPAE page table allocator+0 -01 reply
2/4iommu: add ARM LPAE page table allocator+0 -00 replies
2/4iommu: add ARM LPAE page table allocator+0 -00 replies
3/4iommu: add self-consistency tests to ARM LPAE IO page table allocatordrivers/iommu/Kconfig drivers/iommu/io-pgtable-arm.c+199 -00 replies
4/4iommu/arm-smmu: make use of generic LPAE allocatorarch/arm64/Kconfig drivers/iommu/Kconfig drivers/iommu/arm-smmu.c+252 -6270 replies

Reviews trailers per patch

None of the 16 patches has a Reviewed-by or Acked-by.

PatchLaurent Pinchart
SeriesT-b
1/4
1/4
1/4
1/4
2/4
2/4
2/4
2/4
2/4
2/4
2/4
2/4
2/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] Generic IOMMU page table framework

Hi all,

This series introduces a generic IOMMU page table allocation framework, implements support for ARM long-descriptors and then ports the arm-smmu driver over to the new code.

There are a few reasons for doing this:

- Page table code is hard, and I don't enjoy shopping

- A number of IOMMUs actually use the same table format, but currently duplicate the code

- It provides a CPU (and architecture) independent allocator, which may be useful for some systems where the CPU is using a different table format for its own mappings

As illustrated in the final patch, an IOMMU driver interacts with the allocator by passing in a configuration structure describing the input and output address ranges, the supported pages sizes and a set of ops for performing various TLB invalidation and PTE flushing routines.

The LPAE code implements support for 4k/2M/1G, 16k/32M and 64k/512M mappings, but I decided not to implement the contiguous bit in the interest of trying to keep the code semi-readable. This could always be added later, if needed.

I also included some self-tests for the LPAE implementation. Ideally we'd merge these, but I'm also happy to drop them if there are objections.

Tested with the self-tests, but also VFIO + MMU-500 at stage-1 and stage-2. Patches taken against my iommu/devel branch (queued by Joerg for 3.19).

All feedback welcome.

Will

--->8

Will Deacon (4):
iommu: introduce generic page table allocation framework
iommu: add ARM LPAE page table allocator
iommu: add self-consistency tests to ARM LPAE IO page table allocator iommu/arm-smmu: make use of generic LPAE allocator

 MAINTAINERS                    |   1 +
 arch/arm64/Kconfig             |   1 -
 drivers/iommu/Kconfig          |  32 +-
 drivers/iommu/Makefile         |   2 +
 drivers/iommu/arm-smmu.c       | 872 +++++++++++---------------------------
 drivers/iommu/io-pgtable-arm.c | 925 +++++++++++++++++++++++++++++++++++++++++
 drivers/iommu/io-pgtable.c     |  78 ++++
 drivers/iommu/io-pgtable.h     |  77 ++++
 8 files changed, 1361 insertions(+), 627 deletions(-)
 create mode 100644 drivers/iommu/io-pgtable-arm.c
 create mode 100644 drivers/iommu/io-pgtable.c
 create mode 100644 drivers/iommu/io-pgtable.h
Signature · 1 line
2.1.1