OSDN Git Service

iommu/io-pgtable-fast: Prove correctness of TLB maintenance
authorMitchel Humpherys <mitchelh@codeaurora.org>
Mon, 21 Dec 2015 23:06:34 +0000 (15:06 -0800)
committerJeevan Shriram <jshriram@codeaurora.org>
Sat, 21 May 2016 02:24:04 +0000 (19:24 -0700)
commit94c107c426ffc5d0db9230664ca6028dda2e521e
tree3f9beb86a1618d9f330debe2c7afb1e3b7be1726
parent0a70cf0fac2960a23bb1a21578a7e27411d34810
iommu/io-pgtable-fast: Prove correctness of TLB maintenance

A common software error when it comes to page table code is missing TLB
maintenance.  Add some checks to the io-pgtable-fast code to detect when
an address that might be stale in the TLB is being re-used.  This can be
accomplished by writing a "stale TLB" flag value to the reserved bits of
the PTE during unmap and then removing the flag value when the TLBs are
invalidated (by sweeping the entire page table).  That way, whenever we
map we can know that there might be a stale TLB in the location being
mapped into if it contains the "stale TLB" flag value.

CRs-Fixed: 997751
Change-Id: Icf9c1e41977cb71e8b137190adb3b4a201c339da
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
drivers/iommu/Kconfig
drivers/iommu/dma-mapping-fast.c
drivers/iommu/io-pgtable-fast.c
include/linux/dma-mapping-fast.h
include/linux/io-pgtable-fast.h