diff options
author | Mike Waychison <mikew@google.com> | 2006-04-22 05:36:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-22 12:19:52 -0400 |
commit | 5b20192727ef2c047343a043ee4fbda67e2beef4 (patch) | |
tree | 7b0e7e5c1945685ad911add33e0baeb301b9729d /arch/x86_64 | |
parent | ddbe3eec596fc2c6a513717168217bd19c901880 (diff) |
[PATCH] x86_64: Fix a race in the free_iommu path
We do this by removing a micro-optimization that tries to avoid grabbing
the iommu_bitmap_lock spinlock and using a bus-locked operation.
This still races with other simultaneous alloc_iommu or free_iommu(size >
1) which both use bus-unlocked operations.
The end result of this race is eventually ending up with an
iommu_gart_bitmap that has bits errornously set all over, making large
contiguous iommu space allocations fail with 'PCI-DMA: Out of IOMMU space'.
Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/pci-gart.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index a6c01e121266..9d3d76c85ae7 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c | |||
@@ -112,10 +112,6 @@ static unsigned long alloc_iommu(int size) | |||
112 | static void free_iommu(unsigned long offset, int size) | 112 | static void free_iommu(unsigned long offset, int size) |
113 | { | 113 | { |
114 | unsigned long flags; | 114 | unsigned long flags; |
115 | if (size == 1) { | ||
116 | clear_bit(offset, iommu_gart_bitmap); | ||
117 | return; | ||
118 | } | ||
119 | spin_lock_irqsave(&iommu_bitmap_lock, flags); | 115 | spin_lock_irqsave(&iommu_bitmap_lock, flags); |
120 | __clear_bit_string(iommu_gart_bitmap, offset, size); | 116 | __clear_bit_string(iommu_gart_bitmap, offset, size); |
121 | spin_unlock_irqrestore(&iommu_bitmap_lock, flags); | 117 | spin_unlock_irqrestore(&iommu_bitmap_lock, flags); |