From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.48.19 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794899296; b=WHnRDHZAbaqhncZKUlTb8SvHSM9vEh7IF4R4eKIUusPs1nwDb/SqR6HKmOR61W5oG8wt U8wCsVreMlcJjAyEHnjzdQp16OZkbRAJGd5a1dGmdtMcbgEvewB9t2U/tB4PKgVBzmckD vx7spL25JOaQiHPGUhJjUkvIms2kfEhBMa52/sYHI4ZGshRaoNGLCNPd50P9I4qlQ5Xbp DgXPU6WJPLDjrIWx+qa/9KlQYJOxO9R94fS8jIpg32FR/F21wX34OKxq/Xlk2YIRMhvuA O3eKJbTYsI0hzTZNUCkZQ7aNCV27Q6ggNgaXpW7+osmBExrgZjlllTNHcitoJLQuhYw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794899296; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type:X-Originating-IP: X-ClientProxiedBy:X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=siTVXgzE1+h9LYwc3nTIAjnzbJICRMRvryDK0UCmN98=; b=Ii1R6bUB8LtafM+vLHi4sLif1RWauTQYQXpzrNe+nXsHPRr4J0QaPP3EwrFQkeZZRyfQ Xc2Nu6WD6acAn/g8pFEa2zxb+z1YObveFEQm+IydufRnjFA/Psasc53Gjh0DVLRdw79wv +w1CXlZEEyhV5iupbm2+wZiru9y38/rMfwEjnGYwGBmHrnXGwhJrBHX9xBy7vjoGewstt 3rMUREuDO13XG3xrrePEWUm0dhxwgJFlx7Lb/+2m+5AYd2uL4hieDSwdm8/KmeBuhL7R5 JZRDA7sun2nIwXR4AvvDBZLxQ5UM7yka2ovIt3kuj2F4aRT5joFBBzbsDeMmuyJ1G/w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=SBOlpFlY; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.48.19 Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azon11012019.outbound.protection.outlook.com [52.101.48.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3FC3606A31C for ; Tue, 17 Nov 2026 07:08:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3FC3606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=SBOlpFlY ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GDuNWvi/EgCI8wJNlkQc09sATxYcWT1dBis9n0oqRvjTfyQYp6/YDmdZRjpIUZKaolny+mUmvd9I8GI5krfwTpLp2l+G5jUVURuqLMwWO0PcvDrN4rqVBTskx645PGa/XulhnDZ/dJFLttvLzAr6I066iUytx3pHn1zOKUYpmGenrMqBAPXIVOC6NIL/VbsevUWHcpk5Qa8azxXrY4QitxkpiAeQMjg5IGP3s846/1LY28GNL7BoUXd6Gv4jRwuMAQeDsROQBWUQtURK/5KM9KWPOYvfowLGXVQwzrDEpWUvICqK0vtuTCBij4/zR7i9GX9Gyu7teoVMyC/ZmDsdbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=siTVXgzE1+h9LYwc3nTIAjnzbJICRMRvryDK0UCmN98=; b=RFn59bgZKCEpcf2vLGXn2KLwQAMmoCzMEKnIjj70J1K83nC0TMmMeYScYuuHZ6Ns9KWkTMkkhz5BqltzLCX2t+AScR5RPNot8Fey6YwZEqL7Hq+k0ky5c6yGKJq9mXb7BQyIVkxR9IkO7CFoyR4tkxkh94PQForOZTKrK4to59qzgp3VESMSWotQfWLbzJe2ewyLeNaOlAUr2Nc/6xkeb+4cX1G9DNCynYI+VZvUatEQbpGBXk0Ypk7c+p3txt2sYO5oZ6ayOOi0SMVjdxEfklwd9QISnIjO+Y8FPFdoYPJ+nJOcvI7RnMGcQIKuPNfMyWJn00Ykf9FVpj8LlVSEPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=8bytes.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=siTVXgzE1+h9LYwc3nTIAjnzbJICRMRvryDK0UCmN98=; b=SBOlpFlYEcA9e3vhcl0+a9ubFJP3/7gDCe/cwKPlFF/TN4U97dAe7YDPAqYVBeC86eAtuWfZVl/15y7wRjBXdl6x9AOG1tXP2RktNTaC4jmyXgHjHC7HBTslL4ZHX5cNrwIABNctGjaRvKyEdHSpoL7TJYo9v12Jo4amt4C32cc= Received: from CH0PR03CA0245.namprd03.prod.outlook.com (2603:10b6:610:e5::10) by DS6PR12MB801076.namprd12.prod.outlook.com (2603:10b6:8:417::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.14; Tue, 17 Nov 2026 07:08:12 +0000 Received: from CH3PEPF0002457D.namprd04.prod.outlook.com (2603:10b6:610:e5:cafe::33) by CH0PR03CA0245.outlook.office365.com (2603:10b6:610:e5::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.14 via Frontend Transport; Tue, 17 Nov 2026 07:08:12 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CH3PEPF0002457D.mail.protection.outlook.com (10.167.252.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.4 via Frontend Transport; Tue, 17 Nov 2026 07:08:12 +0000 Received: from BLR-L1-SARUNKOD.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 17 Nov 2026 01:08:07 -0600 From: Sairaj Kodilkar To: "Joerg Roedel (AMD)" , Adrian Huang , Joerg Roedel , Robin Murphy , Suravee Suthikulpanit , Vasant Hegde , "Will Deacon" , , CC: Sairaj Kodilkar , Akshay Jindal Subject: [PATCH v4 3/3] iommu/amd: Rename unity_map_entry and unit_map to ivmd_entry and ivhd_entry_list Date: Tue, 17 Nov 2026 12:36:54 +0530 Message-ID: <20261117070654.3699-4-sarunkod@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261117070654.3699-1-sarunkod@amd.com> References: <20261117070654.3699-1-sarunkod@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF0002457D:EE_|DS6PR12MB801076:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b9a2d57-b825-45fa-477a-08df44798aed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|1800799024|36860700016|82310400026|11063799006|56012099006|261026121527099003|261026140227099003|261028144727099003|10067099003|261022075727099003|261021123027099003|261022113327099003|261021121427099003|261022105027099003|261102123227099003|261009223027099003|18002099003|22082099003|6133799003; X-Microsoft-Antispam-Message-Info: Aub2r7UjkrvKRGTRaRHDZoN5NRyEG8FZUptlEuyzfiH70qwoqlTiUSlc+B2AsnjPTCyZxyKQrUVZD/PZLmansCrtz8kWxGvn1AfHhDhL0yz7kD8LuwTWkfXJzTvPpmZVMjq6bs5piY4vcJFbi74EoATg95LXym++UdLADWsxpbx2FCI17Msu63cibZ79X5WRZGMvjNwR8Okcqt55E5LmQMyJUFjcIcAc3LcNKkUaRJJuEQdUG2TQNVLhiDmS6qczc6WLHjYS4ht4ToeizrNrNZjTc/HAceiSh8EgsuZ5d+hWNyb9L7vxDPlflG8Wr0E/14h6do8Tj8rWTbHBfDMtJPMPJmbh4sBdvaDhIgoieLYIiC6LRlkhlcfB1Eh6gVVcq1RHxHPNpLBRibgrpIfJPe9bRWn7lZRdL0qjj1dge0VAcwI7JMttLBE3DMKlVM/sH+03lI3Vm6I/sB3MY9wyLG5P566zkqp5hcwsSjSuycrM+AMDnhWN7pBCZYNuhrkxYxYJ6ksW5wYAqXAavUVsHbwuKFvdUcM3KtvPq3AsGVZnwdp2Ziu/2GEcFnkX7NSRnRt6phtX4BJa+zDS5GK3nv/EO6rxfhoy7edk0xc8z6Sb9hGIk4RBdW1VG2XZeT5xIgzo23V5Tk2vzv7kPaAnnRcDyx8HIlWlNfDM8q6r5FRa8Jtq+K0AVaWN/QYNKlYtNpoGm81uvG0RyP1Cw9tvsw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(36860700016)(82310400026)(11063799006)(56012099006)(261026121527099003)(261026140227099003)(261028144727099003)(10067099003)(261022075727099003)(261021123027099003)(261022113327099003)(261021121427099003)(261022105027099003)(261102123227099003)(261009223027099003)(18002099003)(22082099003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pqvFi9bZZws/tA5x1bpRV/Xq03rbTg7MMlmSfWmZ/vStCJVWQ0x6fRIcSG1Cq3mRMMSuwRo8pZ1nlSy4HWmxvnGPy2c3hrbObyejp5+YDN/UN0pdhrI8wbvcMjsAnt380Q3uASxU4mTij3x5qSsFzhp/FfmjlA6AKD1ZA6g97U1LAyTM/LUjPYUJZHa4GtgLkYoAtwHIykti/GkBTZlOEytO3cGHByerb4AwhE1eo80M4VYJoBwBjxDz6mDhawznZGsBI+F/wvrg7QtyQYYyoe8uzTDu+oA+mPoy0xabprgFYUyVMrRu+FunAflw1Va2bNXam5pLb9ukT0foGolgieZzbKcjcZ01db5jf9aLpgA+vDFJZaDwKx3Ayh7aojSKdFh2x3BfNguqFuYuwlwRswZOb7PGfNrwfZ5Ftjh5aQFaJrzzjXTlC9WxejBc24bb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2026 07:08:12.2140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b9a2d57-b825-45fa-477a-08df44798aed X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF0002457D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS6PR12MB801076 Also, rename struct list_head unity_map to ivmd_entry_map along with renaming the unity-map helper functions and add error message when handling invalid IVMD entry. No functional change intended. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Sairaj Kodilkar Reviewed-by: Akshay Jindal --- drivers/iommu/amd/amd_iommu_types.h | 6 +++--- drivers/iommu/amd/init.c | 22 +++++++++++----------- drivers/iommu/amd/iommu.c | 7 ++++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/amd/amd_iommu_types.h b/drivers/iommu/amd/amd_iommu_types.h index 122eac81d4e3..10625fb0853e 100644 --- a/drivers/iommu/amd/amd_iommu_types.h +++ b/drivers/iommu/amd/amd_iommu_types.h @@ -609,11 +609,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; }; /* @@ -869,7 +869,7 @@ struct ivhd_dte_flags { /* * One entry for unity mappings 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) */ diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index de8e4ba2ccd0..ba4cd4c91840 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; @@ -1726,7 +1726,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)) @@ -2319,8 +2319,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 @@ -2606,17 +2606,17 @@ 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_maps(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); } @@ -2627,7 +2627,7 @@ static void __init free_unity_maps(void) static int __init init_unity_map_range(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; @@ -2685,7 +2685,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; } @@ -3185,7 +3185,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_maps(); } static void __init ivinfo_init(void *ivrs) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 7edaf99a1ecb..d0fd936776b7 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -3100,7 +3100,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; @@ -3113,7 +3113,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; @@ -3139,7 +3139,8 @@ 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"); + pr_err("%s: Out of memory allocating reserved regions for sbdf=%#x\n", + __func__, sbdf); return; } list_add_tail(®ion->list, head); -- 2.34.1