Skip to contentSkip to conversation

iommu/amd-vi: make IOMMU list ro after init

PATCH In review Roger Pau Monne 2 participants 3 messages Sep 30, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd-vi: make IOMMU list ro after init

The only functions to modify the list, amd_iommu_detect_one_acpi() and amd_iommu_init_cleanup(), are already init.

---
 xen/drivers/passthrough/amd/iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/passthrough/amd/iommu_init.c +1 -1
index 6c0dc2d5cb69..302362502033 100644
@@ -32,7 +32,7 @@ unsigned int __read_mostly amd_iommu_acpi_info;
 unsigned int __read_mostly ivrs_bdf_entries;
 u8 __read_mostly ivhd_type;
 static struct radix_tree_root ivrs_maps;
-LIST_HEAD_READ_MOSTLY(amd_iommu_head);
+LIST_HEAD_RO_AFTER_INIT(amd_iommu_head);
 bool iommuv2_enabled;
 
 bool __ro_after_init amd_iommu_perdev_intremap = true;
Signature · 1 line
2.46.0
#2 lore raw
Quoted 10 lines · Jan Beulich
Quoted 4 lines · Roger Pau Monne

The only functions to modify the list, amd_iommu_detect_one_acpi() and amd_iommu_init_cleanup(), are already init.

Surely the same can be said for VT-d's acpi_*_units? And likely other globals there and here?

Possibly, I wasn't explicitly looking for stuff in IOMMU code to convert from read_mostly to ro_after_init, just came across this one while looking at something in the area.

Thanks, Roger.