All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Make intel iommu disable swiotlb
@ 2025-01-26  5:09 Adrian Mardare (amardare)
  2025-01-27 16:53 ` Robin Murphy
  2025-02-05 10:35 ` Baolu Lu
  0 siblings, 2 replies; 5+ messages in thread
From: Adrian Mardare (amardare) @ 2025-01-26  5:09 UTC (permalink / raw)
  To: dwmw2@infradead.org, baolu.lu@linux.intel.com,
	iommu@lists.linux.dev

(resending as plain-text)
Hi...
I'd like to submit the below patch.
While investigating a difference in memory consumption between the kernel in 5.4.x and in 6.6.x,
I noticed there is around ~80M less reported in MemTotal in 6.6.x versus 5.4.x.
This is because  in 6.6.x  the swiotlb is still enabled and consuming about 80M of kernel memory, even though
the intel iommu has been fully initialized.
This change will cause the swiotlb to be disabled /  memory to be released ( via swiotlb_exit ).
Thanks,
Adrian


From 27e63e727f23189e9c98d81fb445141f998c0808 Mon Sep 17 00:00:00 2001
From: Adrian Mardare <amardare@cisco.com>
Date: Sat, 25 Jan 2025 23:41:31 -0500
Subject: [PATCH] Make intel iommu disable swiotlb

On boards where intel iommu has been successfully
initialized, we need to disable the swiotlb as there
is no reason for swiotlb to be active past that.

Signed-off-by: Adrian Mardare <amardare@cisco.com>
---
drivers/iommu/intel/iommu.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index cc46098f875b..971023d33a70 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3166,6 +3166,9 @@ int __init intel_iommu_init(void)
               pr_info("Intel(R) Virtualization Technology for Directed I/O\n");

                intel_iommu_enabled = 1;
+#ifdef CONFIG_SWIOTLB
+             x86_swiotlb_enable = false;
+#endif

                return 0;

-- 
2.34.1

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

end of thread, other threads:[~2025-02-05 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-26  5:09 Make intel iommu disable swiotlb Adrian Mardare (amardare)
2025-01-27 16:53 ` Robin Murphy
2025-02-05 10:35 ` Baolu Lu
2025-02-05 15:49   ` Christoph Hellwig
2025-02-05 16:31     ` Adrian Mardare (amardare)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.