aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-09-18 09:23:43 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-19 06:59:06 -0400
commit2842e5bf3115193f05dc9dac20f940e7abf44c1a (patch)
tree31461a4fb45db1868f4bfb9f99251db7a5ce6d33
parent270cab2426cdc6307725e4f1f46ecf8ab8e69193 (diff)
x86: move GART TLB flushing options to generic code
The GART currently implements the iommu=[no]fullflush command line parameters which influence its IO/TLB flushing strategy. This patch makes these parameters generic so that they can be used by the AMD IOMMU too. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--Documentation/kernel-parameters.txt4
-rw-r--r--Documentation/x86/x86_64/boot-options.txt2
-rw-r--r--arch/x86/kernel/pci-dma.c13
-rw-r--r--arch/x86/kernel/pci-gart_64.c13
-rw-r--r--include/asm-x86/iommu.h1
5 files changed, 18 insertions, 15 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 1150444a21ab..40066ceb48fe 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -893,6 +893,10 @@ and is between 256 and 4096 characters. It is defined in the file
893 nomerge 893 nomerge
894 forcesac 894 forcesac
895 soft 895 soft
896 fullflush
897 Flush IO/TLB at every deallocation
898 nofullflush
899 Flush IO/TLB only when addresses are reused (default)
896 900
897 901
898 intel_iommu= [DMAR] Intel IOMMU driver (DMAR) option 902 intel_iommu= [DMAR] Intel IOMMU driver (DMAR) option
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index b0c7b6c4abda..c83c8e4bc8e5 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -233,8 +233,6 @@ IOMMU (input/output memory management unit)
233 iommu options only relevant to the AMD GART hardware IOMMU: 233 iommu options only relevant to the AMD GART hardware IOMMU:
234 <size> Set the size of the remapping area in bytes. 234 <size> Set the size of the remapping area in bytes.
235 allowed Overwrite iommu off workarounds for specific chipsets. 235 allowed Overwrite iommu off workarounds for specific chipsets.
236 fullflush Flush IOMMU on each allocation (default).
237 nofullflush Don't use IOMMU fullflush.
238 leak Turn on simple iommu leak tracing (only when 236 leak Turn on simple iommu leak tracing (only when
239 CONFIG_IOMMU_LEAK is on). Default number of leak pages 237 CONFIG_IOMMU_LEAK is on). Default number of leak pages
240 is 20. 238 is 20.
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 0a1408abcc62..d2f2c0158dc1 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -16,6 +16,15 @@ EXPORT_SYMBOL(dma_ops);
16 16
17static int iommu_sac_force __read_mostly; 17static int iommu_sac_force __read_mostly;
18 18
19/*
20 * If this is disabled the IOMMU will use an optimized flushing strategy
21 * of only flushing when an mapping is reused. With it true the GART is
22 * flushed for every mapping. Problem is that doing the lazy flush seems
23 * to trigger bugs with some popular PCI cards, in particular 3ware (but
24 * has been also also seen with Qlogic at least).
25 */
26int iommu_fullflush;
27
19#ifdef CONFIG_IOMMU_DEBUG 28#ifdef CONFIG_IOMMU_DEBUG
20int panic_on_overflow __read_mostly = 1; 29int panic_on_overflow __read_mostly = 1;
21int force_iommu __read_mostly = 1; 30int force_iommu __read_mostly = 1;
@@ -171,6 +180,10 @@ static __init int iommu_setup(char *p)
171 } 180 }
172 if (!strncmp(p, "nomerge", 7)) 181 if (!strncmp(p, "nomerge", 7))
173 iommu_merge = 0; 182 iommu_merge = 0;
183 if (!strncmp(p, "fullflush", 8))
184 iommu_fullflush = 1;
185 if (!strncmp(p, "nofullflush", 11))
186 iommu_fullflush = 0;
174 if (!strncmp(p, "forcesac", 8)) 187 if (!strncmp(p, "forcesac", 8))
175 iommu_sac_force = 1; 188 iommu_sac_force = 1;
176 if (!strncmp(p, "allowdac", 8)) 189 if (!strncmp(p, "allowdac", 8))
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index 9739d5682093..508ef470b27f 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -45,15 +45,6 @@ static unsigned long iommu_pages; /* .. and in pages */
45 45
46static u32 *iommu_gatt_base; /* Remapping table */ 46static u32 *iommu_gatt_base; /* Remapping table */
47 47
48/*
49 * If this is disabled the IOMMU will use an optimized flushing strategy
50 * of only flushing when an mapping is reused. With it true the GART is
51 * flushed for every mapping. Problem is that doing the lazy flush seems
52 * to trigger bugs with some popular PCI cards, in particular 3ware (but
53 * has been also also seen with Qlogic at least).
54 */
55int iommu_fullflush = 1;
56
57/* Allocation bitmap for the remapping area: */ 48/* Allocation bitmap for the remapping area: */
58static DEFINE_SPINLOCK(iommu_bitmap_lock); 49static DEFINE_SPINLOCK(iommu_bitmap_lock);
59/* Guarded by iommu_bitmap_lock: */ 50/* Guarded by iommu_bitmap_lock: */
@@ -901,10 +892,6 @@ void __init gart_parse_options(char *p)
901#endif 892#endif
902 if (isdigit(*p) && get_option(&p, &arg)) 893 if (isdigit(*p) && get_option(&p, &arg))
903 iommu_size = arg; 894 iommu_size = arg;
904 if (!strncmp(p, "fullflush", 8))
905 iommu_fullflush = 1;
906 if (!strncmp(p, "nofullflush", 11))
907 iommu_fullflush = 0;
908 if (!strncmp(p, "noagp", 5)) 895 if (!strncmp(p, "noagp", 5))
909 no_agp = 1; 896 no_agp = 1;
910 if (!strncmp(p, "noaperture", 10)) 897 if (!strncmp(p, "noaperture", 10))
diff --git a/include/asm-x86/iommu.h b/include/asm-x86/iommu.h
index 621a1af94c4c..67b2fd56c6da 100644
--- a/include/asm-x86/iommu.h
+++ b/include/asm-x86/iommu.h
@@ -7,6 +7,7 @@ extern struct dma_mapping_ops nommu_dma_ops;
7extern int force_iommu, no_iommu; 7extern int force_iommu, no_iommu;
8extern int iommu_detected; 8extern int iommu_detected;
9extern int dmar_disabled; 9extern int dmar_disabled;
10extern int iommu_fullflush;
10 11
11extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len); 12extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);
12 13