x86/amd-iommu: Fix rounding-bug in __unmap_single
commitf686b1e07177ac4370ff25fe2f980c6961476c22
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 23 Sep 2010 14:12:48 +0000 (23 16:12 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 29 Oct 2010 04:51:15 +0000 (28 21:51 -0700)
treea09df70e595ef40de3c79df5e329a42f3a7d60ea
parentb7dfcb6f10570ebf207207ff7d346078faaacf8e
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: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/amd_iommu.c