isolate - enable device isolation (each device, as far
                                  as possible, will get its own protection
                                  domain)
+                       fullflush - enable flushing of IO/TLB entries when
+                                   they are unmapped. Otherwise they are
+                                   flushed before they will be reused, which
+                                   is a lot of faster
+
        amd_iommu_size= [HW,X86-64]
                        Define the size of the aperture for the AMD IOMMU
                        driver. Possible values are:
                nomerge
                forcesac
                soft
-               fullflush
-                       Flush IO/TLB at every deallocation
-               nofullflush
-                       Flush IO/TLB only when addresses are reused (default)
 
 
        intel_iommu=    [DMAR] Intel IOMMU driver (DMAR) option
 
   iommu options only relevant to the AMD GART hardware IOMMU:
     <size>             Set the size of the remapping area in bytes.
     allowed            Overwrite iommu off workarounds for specific chipsets.
+    fullflush          Flush IOMMU on each allocation (default).
+    nofullflush        Don't use IOMMU fullflush.
     leak               Turn on simple iommu leak tracing (only when
                        CONFIG_IOMMU_LEAK is on). Default number of leak pages
                        is 20.
 
        }
        address += offset;
 
-       if (unlikely(dma_dom->need_flush && !iommu_fullflush)) {
+       if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) {
                iommu_flush_tlb(iommu, dma_dom->domain.id);
                dma_dom->need_flush = false;
        } else if (unlikely(iommu_has_npcache(iommu)))
 
        dma_ops_free_addresses(dma_dom, dma_addr, pages);
 
-       if (iommu_fullflush)
+       if (amd_iommu_unmap_flush)
                iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size);
 }
 
 
                                           we find in ACPI */
 unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */
 int amd_iommu_isolate;                 /* if 1, device isolation is enabled */
+bool amd_iommu_unmap_flush;            /* if true, flush on every unmap */
 
 LIST_HEAD(amd_iommu_list);             /* list of all AMD IOMMUs in the
                                           system */
        else
                printk("disabled\n");
 
-       if (iommu_fullflush)
+       if (amd_iommu_unmap_flush)
                printk(KERN_INFO "AMD IOMMU: IO/TLB flush on unmap enabled\n");
        else
                printk(KERN_INFO "AMD IOMMU: Lazy IO/TLB flushing enabled\n");
        for (; *str; ++str) {
                if (strncmp(str, "isolate", 7) == 0)
                        amd_iommu_isolate = 1;
+               if (strncmp(str, "fullflush", 11) == 0)
+                       amd_iommu_unmap_flush = true;
        }
 
        return 1;
 
 
 static int iommu_sac_force __read_mostly;
 
-/*
- * If this is disabled the IOMMU will use an optimized flushing strategy
- * of only flushing when an mapping is reused. With it true the GART is
- * flushed for every mapping. Problem is that doing the lazy flush seems
- * to trigger bugs with some popular PCI cards, in particular 3ware (but
- * has been also also seen with Qlogic at least).
- */
-int iommu_fullflush;
-
 #ifdef CONFIG_IOMMU_DEBUG
 int panic_on_overflow __read_mostly = 1;
 int force_iommu __read_mostly = 1;
                }
                if (!strncmp(p, "nomerge", 7))
                        iommu_merge = 0;
-               if (!strncmp(p, "fullflush", 8))
-                       iommu_fullflush = 1;
-               if (!strncmp(p, "nofullflush", 11))
-                       iommu_fullflush = 0;
                if (!strncmp(p, "forcesac", 8))
                        iommu_sac_force = 1;
                if (!strncmp(p, "allowdac", 8))
 
 
 static u32 *iommu_gatt_base;           /* Remapping table */
 
+/*
+ * If this is disabled the IOMMU will use an optimized flushing strategy
+ * of only flushing when an mapping is reused. With it true the GART is
+ * flushed for every mapping. Problem is that doing the lazy flush seems
+ * to trigger bugs with some popular PCI cards, in particular 3ware (but
+ * has been also also seen with Qlogic at least).
+ */
+int iommu_fullflush = 1;
+
 /* Allocation bitmap for the remapping area: */
 static DEFINE_SPINLOCK(iommu_bitmap_lock);
 /* Guarded by iommu_bitmap_lock: */
 #endif
        if (isdigit(*p) && get_option(&p, &arg))
                iommu_size = arg;
+       if (!strncmp(p, "fullflush", 8))
+               iommu_fullflush = 1;
+       if (!strncmp(p, "nofullflush", 11))
+               iommu_fullflush = 0;
        if (!strncmp(p, "noagp", 5))
                no_agp = 1;
        if (!strncmp(p, "noaperture", 10))
 
 /* will be 1 if device isolation is enabled */
 extern int amd_iommu_isolate;
 
+/*
+ * If true, the addresses will be flushed on unmap time, not when
+ * they are reused
+ */
+extern bool amd_iommu_unmap_flush;
+
 /* takes a PCI device id and prints it out in a readable form */
 static inline void print_devid(u16 devid, int nl)
 {
 
 extern int force_iommu, no_iommu;
 extern int iommu_detected;
 extern int dmar_disabled;
-extern int iommu_fullflush;
 
 extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);