Re: [PATCH 06/24] iommu/amd: Map vIOMMU VF and VF Control MMIO BARs
From: Suthikulpanit, Suravee
Date: Wed Sep 02 2026 - 08:18:09 EST
On 8/19/2026 8:18 PM, guanghuifeng@xxxxxxxxxxxxxxxxx wrote:
This is unrelated to this series. I'll fix this separately.
在 2026/7/27 21:28, Suravee Suthikulpanit 写道:
.....
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 5ac883429ced..6e69b3dd8b1e 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -459,7 +459,7 @@ static void iommu_disable(struct amd_iommu *iommu)
* mapping and unmapping functions for the IOMMU MMIO space. Each AMD IOMMU in
* the system has one.
*/
-static u8 __iomem * __init iommu_map_mmio_space(u64 address, u64 end)
+u8 __iomem * __init iommu_map_mmio_space(u64 address, u64 end)
{
if (!request_mem_region(address, end, "amd_iommu")) {
pr_err("Can not reserve memory region %llx-%llx for mmio\n",
@@ -471,7 +471,7 @@ static u8 __iomem * __init iommu_map_mmio_space(u64 address, u64 end)
return (u8 __iomem *)ioremap(address, end);
}
iommu_map_mmio_space() calls request_mem_region() before ioremap(),
but if ioremap() fails it returns NULL without releasing the region
it just reserved. Please make iommu_map_mmio_space() release the
region on ioremap() failure
Thanks,
Suravee