amd-iommu: disable round-robin allocator for CONFIG_IOMMU_STRESS
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 22 May 2009 10:27:53 +0000 (12:27 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 28 May 2009 16:17:13 +0000 (18:17 +0200)
Disabling the round-robin allocator results in reusing the same
dma-addresses again very fast. This is a good test if the iotlb flushing
is working correctly.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/kernel/amd_iommu.c

index 31d56c36010ac59695b00d0729bd46904aac63a9..543822b39a846181f876a13cbfd4e6542b1e5d35 100644 (file)
@@ -783,6 +783,11 @@ static unsigned long dma_ops_alloc_addresses(struct device *dev,
 {
        unsigned long address;
 
+#ifdef CONFIG_IOMMU_STRESS
+       dom->next_address = 0;
+       dom->need_flush = true;
+#endif
+
        address = dma_ops_area_alloc(dev, dom, pages, align_mask,
                                     dma_mask, dom->next_address);