mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iommu/vt-d: Remove unused code in dma_pte_free_pagetable
@ 2025-10-14 16:24 Aashish Sharma
  2025-11-18  1:56 ` Baolu Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Aashish Sharma @ 2025-10-14 16:24 UTC (permalink / raw)
  To: Vineeth Pillai, Lu Baolu, Dmytro Maluka, David Woodhouse,
	Joerg Roedel, Will Deacon
  Cc: Robin Murphy, iommu, linux-kernel, Aashish Sharma, Aashish Sharma

'dma_pte_free_pagetable' is only called by
'switch_to_super_page' and is not intended to free the
whole page table (0..DOMAIN_MAX_PFN(domain->gaw)).

Hence remove the code that checks for this and frees the page
table pointed by 'domain->pgd'.

Signed-off-by: Aashish Sharma (Google) <aashish@aashishsharma.net>
---
 drivers/iommu/intel/iommu.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index e236c7ec221f..3b3ad7b0c0ce 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -883,12 +883,6 @@ static void dma_pte_free_pagetable(struct dmar_domain *domain,
 	/* We don't need lock here; nobody else touches the iova range */
 	dma_pte_free_level(domain, agaw_to_level(domain->agaw), retain_level,
 			   domain->pgd, 0, start_pfn, last_pfn);
-
-	/* free pgd */
-	if (start_pfn == 0 && last_pfn == DOMAIN_MAX_PFN(domain->gaw)) {
-		iommu_free_pages(domain->pgd);
-		domain->pgd = NULL;
-	}
 }
 
 /* When a page at a given level is being unlinked from its parent, we don't
-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-18  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-14 16:24 [PATCH] iommu/vt-d: Remove unused code in dma_pte_free_pagetable Aashish Sharma
2025-11-18  1:56 ` Baolu Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®