Skip to content

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

Sairaj Kodilkar linux-iommu lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 3 repliesIn review
  2. v33 patches 8 repliesSuperseded

Changes in v4 from the cover letter

https://lore.kernel.org/all/[email protected]/

* Patch 2: rectify the flag checks and move it under init_unity_map_range(). [Akshay]

* Patch 3: Rename ivmd_entry_map to ivmd_entry_to. [Akshay]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iommu/amd: Drop unused global exclusion range fields and initdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c+5 -51 reply
2/3iommu/amd: Do not convert IVMD exclusion range to unity rangedrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+32 -231 reply
3/3iommu/amd: Rename unity_map_entry and unit_map to ivmd_entry and ivhd_entry_listdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+18 -171 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAkshay JindalAdrian Huang
1/3R-b
2/3R-b
3/3R-b

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

Read the v4 thread

Cover letter [PATCH v4 0/3] 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.

Changes from v3:
https://lore.kernel.org/all/[email protected]/

* Patch 2: rectify the flag checks and move it under init_unity_map_range(). [Akshay]

* Patch 3: Rename ivmd_entry_map to ivmd_entry_to. [Akshay]

Changes from v2:
https://lore.kernel.org/all/[email protected]/#t

*Patch 2: Report an IVMD exclusion range as IOMMU_RESV_RESERVED in this
patch, instead of leaving that for patch 3. This patch stops forcing the exclusion to read/write unity, the range has no read or write permission. iommu_map() rejects that, so a tree checked out at patch 2 does not boot. Reserving the range in the same patch keeps the series bisectable.

* Patch 4: Drop this patch, ivmd= command line does not have any real use and complicates driver.

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.

Sairaj Kodilkar (1):
iommu/amd: Rename unity_map_entry and unit_map to ivmd_entry and
ivhd_entry_list

Suravee Suthikulpanit (2):
iommu/amd: Drop unused global exclusion range fields and init iommu/amd: Do not convert IVMD exclusion range to unity range

 drivers/iommu/amd/amd_iommu_types.h | 22 ++++++-----
 drivers/iommu/amd/init.c            | 59 ++++++++++++++---------------
 drivers/iommu/amd/iommu.c           | 19 +++++++---
 3 files changed, 55 insertions(+), 45 deletions(-)

base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4

Signature · 1 line
2.34.1