summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMostafa Saleh <smostafa@google.com>2026-05-13 21:52:03 +0000
committerJoerg Roedel <joerg.roedel@amd.com>2026-05-19 11:03:45 +0200
commitadb77e757680dcfa79ccc554ec51d42cf56ef69a (patch)
tree0e8266aefc6403266c8cd2e50ff9a9698b6374f9 /drivers
parentd996116cde972756e8415d6e070b960f6f6a8f6c (diff)
iommu/io-pgtable-arm: Use address conversion consistently
Use consistent address conversions in the driver: - virt_to_phys(): For all virtual to physical address conversion, convert __pa users as we don’t need to rely on it type casting. - phys_to_virt(): For all physical to virtual address conversion, similarly, convert __va users. That changes nothing at all. However, it will be useful when compiling this file for the KVM hypervisor as it can cleanly replace virt_to_phys/phys_to_virt Signed-off-by: Mostafa Saleh <smostafa@google.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/io-pgtable-arm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 86b23aa04324..476c0e25631a 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -143,7 +143,7 @@
#define ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC 0x8DULL
/* IOPTE accessors */
-#define iopte_deref(pte,d) __va(iopte_to_paddr(pte, d))
+#define iopte_deref(pte, d) phys_to_virt(iopte_to_paddr(pte, d))
#define iopte_type(pte) \
(((pte) >> ARM_LPAE_PTE_TYPE_SHIFT) & ARM_LPAE_PTE_TYPE_MASK)
@@ -429,7 +429,7 @@ static arm_lpae_iopte arm_lpae_install_table(arm_lpae_iopte *table,
arm_lpae_iopte old, new;
struct io_pgtable_cfg *cfg = &data->iop.cfg;
- new = paddr_to_iopte(__pa(table), data) | ARM_LPAE_PTE_TYPE_TABLE;
+ new = paddr_to_iopte(virt_to_phys(table), data) | ARM_LPAE_PTE_TYPE_TABLE;
if (cfg->quirks & IO_PGTABLE_QUIRK_ARM_NS)
new |= ARM_LPAE_PTE_NSTABLE;