x86: fix broken flushing in GART nofullflush path

Impact: remove stale IOTLB entries

In the non-default nofullflush case the GART is only flushed when
next_bit wraps around. But it can happen that an unmap operation unmaps
memory which is behind the current next_bit location. If these addresses
are reused it may result in stale GART IO/TLB entries. Fix this by
setting the GART next_bit always behind an unmapped location.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Joerg Roedel and committed by
Ingo Molnar
70d7d357 7b1dedca

+2
+2
arch/x86/kernel/pci-gart_64.c
··· 123 123 124 124 spin_lock_irqsave(&iommu_bitmap_lock, flags); 125 125 iommu_area_free(iommu_gart_bitmap, offset, size); 126 + if (offset >= next_bit) 127 + next_bit = offset + size; 126 128 spin_unlock_irqrestore(&iommu_bitmap_lock, flags); 127 129 } 128 130