Skip to content

iommu/amd: IVMD handling cleanup and ivmd= boot override

Suravee Suthikulpanit linux-iommu lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 4 repliesIn review
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

(https://lore.kernel.org/linux-iommu/[email protected]/)

* Rebase on top of patch "[PATCH] iommu/amd: Remove dead code for exclusion ranges in IVMD" that was submitted by Yu Zhang <[email protected]>.
(https://lore.kernel.org/all/[email protected]/)

* Patch 1: Modified to only rename the marco.

* Patch 3: Reintroduce logic to parse IVMD exclusion flag to allow reserve region of type IOMMU_RESV_RESERVED.

* Patch 4:
- Update the sscan function to scan start, length, flags in hex format only.
- Fix apply_ivmd_cmdline_entries() to not free the cmd, which points to

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iommu/amd: Drop unused global exclusion range fields and initdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c+5 -50 replies
2/4iommu/amd: Do not convert IVMD exclusion range to unity rangedrivers/iommu/amd/init.c+0 -101 reply
3/4iommu/amd: Clean up and simplify IVMD entry handlingdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+49 -350 replies
4/4iommu/amd: Introduce boot option ivmd=seg:bus:dev.fun,start,size,flagsDocumentation/admin-guide/kernel-parameters.txt drivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c+133 -10 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchAdrian HuangAdam Pelka
SeriesT-b
1/4
2/4R-b
3/4
4/4

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

Read the v2 thread

Cover letter [PATCH v2 0/4] iommu/amd: IVMD handling cleanup and ivmd= boot override

This series refreshes how the AMD IOMMU driver models IVRS IVMD entries after the hardware exclusion range registers were repurposed.

The first patch renames the associated MMIO offsets to reflect completion-wait store base/limit.

The second patch drops the workaround that forced IVMD exclusion ranges to r/w unity mappings; the driver no longer programs exclusion range registers, so that the workaround is obsolete.

The third patch centralizes IVMD flag definitions, renames the unity-map structures to ivmd_entry, stores the raw IVMD flags byte from ACPI, and derives IOMMU reserved regions (including exclusion as IOMMU_RESV_RESERVED) from those flags.

The fourth patch adds an ivmd= kernel parameter so up to four per-device IVMD-style ranges can be supplied from the command line when the IVRS table is wrong or incomplete, documented in kernel-parameters.txt.

Change from v1:
(https://lore.kernel.org/linux-iommu/[email protected]/)

* Rebase on top of patch "[PATCH] iommu/amd: Remove dead code for exclusion ranges in IVMD" that was submitted by Yu Zhang <[email protected]>.
(https://lore.kernel.org/all/[email protected]/)

* Patch 1: Modified to only rename the marco.

* Patch 3: Reintroduce logic to parse IVMD exclusion flag to allow reserve region of type IOMMU_RESV_RESERVED.

* Patch 4:
- Update the sscan function to scan start, length, flags in hex format only.
- Fix apply_ivmd_cmdline_entries() to not free the cmd, which points to

    the early_ivmd_cmdline_map[]  on failure path.

Thanks,
Suravee

Suravee Suthikulpanit (4):
iommu/amd: Drop unused global exclusion range fields and init iommu/amd: Do not convert IVMD exclusion range to unity range iommu/amd: Clean up and simplify IVMD entry handling iommu/amd: Introduce boot option ivmd=seg:bus:dev.fun,start,size,flags

 .../admin-guide/kernel-parameters.txt         |  16 ++
 drivers/iommu/amd/amd_iommu_types.h           |  36 ++--
 drivers/iommu/amd/init.c                      | 159 ++++++++++++++----
 drivers/iommu/amd/iommu.c                     |  27 ++-
 4 files changed, 187 insertions(+), 51 deletions(-)
Signature · 1 line
2.34.1