Skip to content

RFC iommu: Permit modular builds of io-pgtable drivers

Isaac J. Manjarres dri-devel linux-arm-kernel linux-arm-msm linux-iommu lkml oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest7 patches 12 repliesIn review
  2. v1 RFC3 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7iommu/io-pgtable: Introduce dynamic io-pgtable fmt registrationdrivers/iommu/io-pgtable-arm-v7s.c drivers/iommu/io-pgtable-arm.c drivers/iommu/io-pgtable.c +1 more+209 -605 replies
2/7iommu/io-pgtable: Add refcounting for io-pgtable format modulesdrivers/iommu/io-pgtable-arm-v7s.c drivers/iommu/io-pgtable-arm.c drivers/iommu/io-pgtable.c +1 more+18 -20 replies
3/7iommu/arm-smmu: Add dependency on io-pgtable format modulesdrivers/iommu/arm/arm-smmu/arm-smmu.c+1 -04 replies
4/7iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format moduledrivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c+1 -00 replies
5/7drm/msm: Add dependency on io-pgtable-arm format moduledrivers/gpu/drm/msm/msm_drv.c+1 -03 replies
6/7drm/panfrost: Add dependency on io-pgtable-arm format moduledrivers/gpu/drm/panfrost/panfrost_drv.c+1 -00 replies
7/7iommu/io-pgtable-arm: Allow building modular io-pgtable fmtsdrivers/iommu/Kconfig drivers/iommu/io-pgtable-arm-v7s.c drivers/iommu/io-pgtable-arm.c+6 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/7] iommu: Permit modular builds of io-pgtable drivers

The goal of the Generic Kernel Image (GKI) effort is to have a common kernel image that works across multiple Android devices. This involves generating a kernel image that has core features integrated into it, while SoC specific functionality can be added to the kernel for the device as a module.

Along with modularizing IOMMU drivers, this also means building the io-pgtable code as modules, which allows for SoC vendors to only include the io-pgtable implementations that they use. For example, GKI for arm64 must include support for both the IOMMU ARM LPAE/V7S formats at the moment. Having the code for both formats as modules allows SoC vendors to only provide the page table format that they use, along with their IOMMU driver.

Main changes since v1:

1) Retain io-pgtable.c as part of the core kernel

The patches are split into 4 parts:

1) Modularizing io-pgtable-arm[-v7s].c, while leaving the io-pgtable.c code as part of the core kernel, requires removing the references to the ARM LPAE and ARM V7S io-pgtable init functions, and using a dynamic method for formats to register their io-pgtable init functions.

The reason for defining an io_pgtable_init_fns_node structure is to not have the data structures used to store the init functions seep into the io-pgtable fmt drivers. Doing so allows for changing the internal data structure used to keep track of the init functions, without impacting the client data structures.

2) Taking references to the io-pgtable format drivers to ensure that they cannot be unloaded while in use.

3) Adding pre MODULE_SOFTDEP() dependencies to drivers in the kernel that are tristate, and invoke [alloc/free]_io_pgtable_ops(). This makes it so that the io-pgtable format drivers are loaded before the driver that needs them.

4) Changing the Kconfig options for the ARM LPAE nad ARM V7S to tristate.

Thanks in advance for the feedback,

Isaac J. Manjarres

Isaac J. Manjarres (7):
iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration iommu/io-pgtable: Add refcounting for io-pgtable format modules iommu/arm-smmu: Add dependency on io-pgtable format modules iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module drm/msm: Add dependency on io-pgtable-arm format module drm/panfrost: Add dependency on io-pgtable-arm format module iommu/io-pgtable-arm: Allow building modular io-pgtable fmts

 drivers/gpu/drm/msm/msm_drv.c               |   1 +
 drivers/gpu/drm/panfrost/panfrost_drv.c     |   1 +
 drivers/iommu/Kconfig                       |   4 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |   1 +
 drivers/iommu/arm/arm-smmu/arm-smmu.c       |   1 +
 drivers/iommu/io-pgtable-arm-v7s.c          |  37 +++++++++-
 drivers/iommu/io-pgtable-arm.c              |  97 +++++++++++++++++++-------
 drivers/iommu/io-pgtable.c                  | 104 +++++++++++++++++++++++-----
 include/linux/io-pgtable.h                  |  53 +++++++++-----
 9 files changed, 236 insertions(+), 63 deletions(-)
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu