summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2015-06-05 08:35:11 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2015-06-11 07:16:47 +0200
commitb82c75bfbeb5b4c7c23ee09dd6f295c7f06aeb25 (patch)
treeb32ffe6327e627dd19c5831cd1910f32ab6c9bd3 /mm
parentvfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control (diff)
downloadlinux-b82c75bfbeb5b4c7c23ee09dd6f295c7f06aeb25.tar.xz
linux-b82c75bfbeb5b4c7c23ee09dd6f295c7f06aeb25.zip
powerpc/iommu: Fix IOMMU ownership control functions
This adds missing locks in iommu_take_ownership()/ iommu_release_ownership(). This marks all pages busy in iommu_table::it_map in order to catch errors if there is an attempt to use this table while ownership over it is taken. This only clears TCE content if there is no page marked busy in it_map. Clearing must be done outside of the table locks as iommu_clear_tce() called from iommu_clear_tces_and_put_pages() does this. In order to use bitmap_empty(), the existing code clears bit#0 which is set even in an empty table if it is bus-mapped at 0 as iommu_init_table() reserves page#0 to prevent buggy drivers from crashing when allocated page is bus-mapped at zero (which is correct). This restores the bit in the case of failure to bring the it_map to the state it was in when we called iommu_take_ownership(). Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions