Skip to content

Commit 33aef97

Browse files
ssuthiku-amdjoergroedel
authored andcommitted
iommu/amd: Rename variables to be consistent with struct io_pgtable_ops
There is no functional change. Signed-off-by: Suravee Suthikulpanit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 6eedb59 commit 33aef97

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

drivers/iommu/amd/io_pgtable.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ static struct page *free_clear_pte(u64 *pte, u64 pteval, struct page *freelist)
387387
* and full 64 bit address spaces.
388388
*/
389389
int iommu_map_page(struct protection_domain *dom,
390-
unsigned long bus_addr,
391-
unsigned long phys_addr,
392-
unsigned long page_size,
390+
unsigned long iova,
391+
unsigned long paddr,
392+
unsigned long size,
393393
int prot,
394394
gfp_t gfp)
395395
{
@@ -398,15 +398,15 @@ int iommu_map_page(struct protection_domain *dom,
398398
u64 __pte, *pte;
399399
int ret, i, count;
400400

401-
BUG_ON(!IS_ALIGNED(bus_addr, page_size));
402-
BUG_ON(!IS_ALIGNED(phys_addr, page_size));
401+
BUG_ON(!IS_ALIGNED(iova, size));
402+
BUG_ON(!IS_ALIGNED(paddr, size));
403403

404404
ret = -EINVAL;
405405
if (!(prot & IOMMU_PROT_MASK))
406406
goto out;
407407

408-
count = PAGE_SIZE_PTE_COUNT(page_size);
409-
pte = alloc_pte(dom, bus_addr, page_size, NULL, gfp, &updated);
408+
count = PAGE_SIZE_PTE_COUNT(size);
409+
pte = alloc_pte(dom, iova, size, NULL, gfp, &updated);
410410

411411
ret = -ENOMEM;
412412
if (!pte)
@@ -419,10 +419,10 @@ int iommu_map_page(struct protection_domain *dom,
419419
updated = true;
420420

421421
if (count > 1) {
422-
__pte = PAGE_SIZE_PTE(__sme_set(phys_addr), page_size);
422+
__pte = PAGE_SIZE_PTE(__sme_set(paddr), size);
423423
__pte |= PM_LEVEL_ENC(7) | IOMMU_PTE_PR | IOMMU_PTE_FC;
424424
} else
425-
__pte = __sme_set(phys_addr) | IOMMU_PTE_PR | IOMMU_PTE_FC;
425+
__pte = __sme_set(paddr) | IOMMU_PTE_PR | IOMMU_PTE_FC;
426426

427427
if (prot & IOMMU_PROT_IR)
428428
__pte |= IOMMU_PTE_IR;
@@ -456,20 +456,19 @@ int iommu_map_page(struct protection_domain *dom,
456456
}
457457

458458
unsigned long iommu_unmap_page(struct protection_domain *dom,
459-
unsigned long bus_addr,
460-
unsigned long page_size)
459+
unsigned long iova,
460+
unsigned long size)
461461
{
462462
unsigned long long unmapped;
463463
unsigned long unmap_size;
464464
u64 *pte;
465465

466-
BUG_ON(!is_power_of_2(page_size));
466+
BUG_ON(!is_power_of_2(size));
467467

468468
unmapped = 0;
469469

470-
while (unmapped < page_size) {
471-
472-
pte = fetch_pte(dom, bus_addr, &unmap_size);
470+
while (unmapped < size) {
471+
pte = fetch_pte(dom, iova, &unmap_size);
473472

474473
if (pte) {
475474
int i, count;
@@ -479,7 +478,7 @@ unsigned long iommu_unmap_page(struct protection_domain *dom,
479478
pte[i] = 0ULL;
480479
}
481480

482-
bus_addr = (bus_addr & ~(unmap_size - 1)) + unmap_size;
481+
iova = (iova & ~(unmap_size - 1)) + unmap_size;
483482
unmapped += unmap_size;
484483
}
485484

0 commit comments

Comments
 (0)