All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sairaj Kodilkar <sarunkod@amd.com>
To: "Joerg Roedel (AMD)" <joro@8bytes.org>,
	Adrian Huang <ahuang12@lenovo.com>,
	Joerg Roedel <jroedel@suse.de>,
	Robin Murphy <robin.murphy@arm.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	"Will Deacon" <will@kernel.org>, <iommu@lists.linux.dev>
Cc: <Vasant.Hegde@amd.com>, <Suravee.Suthikulpanit@amd.com>,
	Sairaj Kodilkar <sarunkod@amd.com>
Subject: [PATCH v5 3/3] iommu/amd: Rename unity_map symbols to ivmd_entry
Date: Fri, 27 Nov 2026 15:34:14 +0530	[thread overview]
Message-ID: <20261127100414.6980-4-sarunkod@amd.com> (raw)
In-Reply-To: <20261127100414.6980-1-sarunkod@amd.com>

Rename unity_map_entry, unity_map, free_unity_maps, init_unity_map_range to
ivmd_entry, ivmd_entry_list, free_ivmd_entry_list, init_ivmd_entry
respectively.

No functional change intended.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
---
 drivers/iommu/amd/amd_iommu_types.h | 12 ++++++------
 drivers/iommu/amd/init.c            | 30 ++++++++++++++---------------
 drivers/iommu/amd/iommu.c           |  6 +++---
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/iommu/amd/amd_iommu_types.h b/drivers/iommu/amd/amd_iommu_types.h
index 0f4c3c65188c..f4790af97d6e 100644
--- a/drivers/iommu/amd/amd_iommu_types.h
+++ b/drivers/iommu/amd/amd_iommu_types.h
@@ -615,11 +615,11 @@ struct amd_iommu_pci_seg {
 	u16 *alias_table;
 
 	/*
-	 * A list of required unity mappings we find in ACPI. It is not locked
+	 * A list of required IVMD mappings we find in ACPI. It is not locked
 	 * because as runtime it is only read. It is created at ACPI table
 	 * parsing time.
 	 */
-	struct list_head unity_map;
+	struct list_head ivmd_entry_list;
 };
 
 /*
@@ -877,9 +877,9 @@ struct ivhd_dte_flags {
 };
 
 /*
- * One entry for unity mappings parsed out of the ACPI table.
+ * One entry for unity/exclusion ranges parsed out of the ACPI table.
  */
-struct unity_map_entry {
+struct ivmd_entry {
 	struct list_head list;
 
 	/* starting device id this entry is used for (including) */
@@ -887,9 +887,9 @@ struct unity_map_entry {
 	/* end device id this entry is used for (including) */
 	u16 devid_end;
 
-	/* start address to unity map (including) */
+	/* start address to unity/exclusion range (including) */
 	u64 address_start;
-	/* end address to unity map (including) */
+	/* end address to unity/exclusion range (including) */
 	u64 address_end;
 
 	/* IVMD flags for the entry */
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 6d92fb5c81a7..46483fdfba82 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -132,7 +132,7 @@ int amd_iommu_pprlog_size = PPRLOG_SIZE_DEF;
 
 /*
  * An AMD IOMMU memory definition structure. It defines things like exclusion
- * ranges for devices and regions that should be unity mapped.
+ * ranges, unity mapping for device and regions.
  */
 struct ivmd_header {
 	u8 type;
@@ -1796,7 +1796,7 @@ static struct amd_iommu_pci_seg *__init alloc_pci_segment(u16 id,
 
 	pci_seg->id = id;
 	init_llist_head(&pci_seg->dev_data_list);
-	INIT_LIST_HEAD(&pci_seg->unity_map);
+	INIT_LIST_HEAD(&pci_seg->ivmd_entry_list);
 	list_add_tail(&pci_seg->list, &amd_iommu_pci_seg_list);
 
 	if (alloc_dev_table(pci_seg))
@@ -2425,8 +2425,8 @@ static int __init amd_iommu_init_pci(void)
 	}
 
 	/*
-	 * Order is important here to make sure any unity map requirements are
-	 * fulfilled. The unity mappings are created and written to the device
+	 * Order is important here to make sure any ivmd map requirements are
+	 * fulfilled. The ivmd mappings are created and written to the device
 	 * table during the iommu_init_pci() call.
 	 *
 	 * After that we call init_device_table_dma() to make sure any
@@ -2712,28 +2712,28 @@ static int iommu_init_irq(struct amd_iommu *iommu)
  *
  * The next functions belong to the third pass of parsing the ACPI
  * table. In this last pass the memory mapping requirements are
- * gathered (like exclusion and unity mapping ranges).
+ * gathered (like exclusion and ivmd mapping ranges).
  *
  ****************************************************************************/
 
-static void __init free_unity_maps(void)
+static void __init free_ivmd_entry_list(void)
 {
-	struct unity_map_entry *entry, *next;
+	struct ivmd_entry *entry, *next;
 	struct amd_iommu_pci_seg *p, *pci_seg;
 
 	for_each_pci_segment_safe(pci_seg, p) {
-		list_for_each_entry_safe(entry, next, &pci_seg->unity_map, list) {
+		list_for_each_entry_safe(entry, next, &pci_seg->ivmd_entry_list, list) {
 			list_del(&entry->list);
 			kfree(entry);
 		}
 	}
 }
 
-/* called for unity map ACPI definition */
-static int __init init_unity_map_range(struct ivmd_header *m,
-				       struct acpi_table_header *ivrs_base)
+/* called for ivmd entry mapping in IVRS */
+static int __init init_ivmd_entry(struct ivmd_header *m,
+				  struct acpi_table_header *ivrs_base)
 {
-	struct unity_map_entry *e = NULL;
+	struct ivmd_entry *e = NULL;
 	struct amd_iommu_pci_seg *pci_seg;
 	char *s;
 
@@ -2796,7 +2796,7 @@ static int __init init_unity_map_range(struct ivmd_header *m,
 		    PCI_SLOT(e->devid_end), PCI_FUNC(e->devid_end),
 		    e->address_start, e->address_end, m->flags);
 
-	list_add_tail(&e->list, &pci_seg->unity_map);
+	list_add_tail(&e->list, &pci_seg->ivmd_entry_list);
 
 	return 0;
 }
@@ -2825,7 +2825,7 @@ static int __init init_memory_definitions(struct acpi_table_header *table)
 		if (!ivrs_block_type_ivmd(m->type))
 			continue;
 		if (m->flags & (IVMD_FLAG_UNITY_MAP | IVMD_FLAG_EXCL_RANGE))
-			init_unity_map_range(m, table);
+			init_ivmd_entry(m, table);
 	}
 
 	return 0;
@@ -3299,7 +3299,7 @@ static bool __init check_ioapic_information(void)
 static void __init free_dma_resources(void)
 {
 	amd_iommu_pdom_id_destroy();
-	free_unity_maps();
+	free_ivmd_entry_list();
 }
 
 static void __init ivinfo_init(void *ivrs)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index a417bfce0c89..493c66b6b794 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3131,7 +3131,7 @@ static void amd_iommu_get_resv_regions(struct device *dev,
 				       struct list_head *head)
 {
 	struct iommu_resv_region *region;
-	struct unity_map_entry *entry;
+	struct ivmd_entry *entry;
 	struct amd_iommu *iommu;
 	struct amd_iommu_pci_seg *pci_seg;
 	int devid, sbdf;
@@ -3144,7 +3144,7 @@ static void amd_iommu_get_resv_regions(struct device *dev,
 	iommu = get_amd_iommu_from_dev(dev);
 	pci_seg = iommu->pci_seg;
 
-	list_for_each_entry(entry, &pci_seg->unity_map, list) {
+	list_for_each_entry(entry, &pci_seg->ivmd_entry_list, list) {
 		int type, prot = 0;
 		size_t length;
 
@@ -3182,7 +3182,7 @@ static void amd_iommu_get_resv_regions(struct device *dev,
 						 length, prot, type,
 						 GFP_KERNEL);
 		if (!region) {
-			dev_err(dev, "Out of memory allocating dm-regions\n");
+			dev_err(dev, "Out of memory allocating reserved regions\n");
 			return;
 		}
 		list_add_tail(&region->list, head);
-- 
2.34.1


      parent reply	other threads:[~2026-11-27 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 10:04 [PATCH v5 0/3] iommu/amd: IVMD handling cleanup and ivmd= boot override Sairaj Kodilkar
2026-11-27 10:04 ` [PATCH v5 1/3] iommu/amd: Rename exclusion range base and limit macros Sairaj Kodilkar
2026-11-27 10:04 ` [PATCH v5 2/3] iommu/amd: Do not convert IVMD exclusion range to unity range Sairaj Kodilkar
2026-12-01  8:50   ` Vasant Hegde
2026-12-01 12:01     ` Sairaj Kodilkar
2026-12-01 12:33       ` Sairaj Kodilkar
2026-11-27 10:04 ` Sairaj Kodilkar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127100414.6980-4-sarunkod@amd.com \
    --to=sarunkod@amd.com \
    --cc=ahuang12@lenovo.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.