x86/amd-iommu: Fix rounding-bug in __unmap_single
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 23 Sep 2010 14:12:48 +0000 (16:12 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 6 Jan 2011 23:08:08 +0000 (18:08 -0500)
commit6038fae202d6c2127ca16864bf40f6739ef2e1ec
tree0a839da6cb28f53b1a5bb96e268b92b9bc94eca9
parentc9ce393e4a4cde0e5431d7441015ec6a5fa9f947
x86/amd-iommu: Fix rounding-bug in __unmap_single

commit 04e0463e088b41060c08c255eb0d3278a504f094 upstream.

In the __unmap_single function the dma_addr is rounded down
to a page boundary before the dma pages are unmapped. The
address is later also used to flush the TLB entries for that
mapping. But without the offset into the dma page the amount
of pages to flush might be miscalculated in the TLB flushing
path. This patch fixes this bug by using the original
address to flush the TLB.

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