[PATCH] [9/12] GBPAGES: Switch pci-gart over to using cpa instead of clear_kernel_mapping

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Friday, February 1, 2008 - 2:53 am

pci-gart needs to unmap the IOMMU aperture to prevent cache corruptions.

Switch this over to using cpa instead of clear_kernel_mapping()

Drawback right now is that cpa will split everything down to 4k
pages, and this costs 4K for each 2MB of aperture; 128KB for a typical
64MB aperture.

Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86/kernel/pci-gart_64.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux/arch/x86/kernel/pci-gart_64.c
===================================================================
--- linux.orig/arch/x86/kernel/pci-gart_64.c
+++ linux/arch/x86/kernel/pci-gart_64.c
@@ -731,7 +731,8 @@ void __init gart_iommu_init(void)
 	 * the backing memory. The GART address is only used by PCI
 	 * devices.
 	 */
-	clear_kernel_mapping((unsigned long)__va(iommu_bus_base), iommu_size);
+	set_memory_np((unsigned long)__va(iommu_bus_base),
+				iommu_size >> PAGE_SHIFT);
 
 	/*
 	 * Try to workaround a bug (thanks to BenH)
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/12] GBPAGES patchkit for 2.6.25 v3, Andi Kleen, (Fri Feb 1, 2:53 am)
[PATCH] [3/12] GBPAGES: Add PUD_PAGE_SIZE, Andi Kleen, (Fri Feb 1, 2:53 am)
[PATCH] [9/12] GBPAGES: Switch pci-gart over to using cpa ..., Andi Kleen, (Fri Feb 1, 2:53 am)
Re: [PATCH] [0/12] GBPAGES patchkit for 2.6.25 v3, Thomas Gleixner, (Fri Feb 1, 5:25 am)
Re: [PATCH] [12/12] GBPAGES: Switch direct mapping setup o ..., Jeremy Fitzhardinge, (Fri Feb 1, 10:37 am)
Re: [PATCH] [12/12] GBPAGES: Switch direct mapping setup o ..., Jeremy Fitzhardinge, (Fri Feb 1, 12:16 pm)