iommu: msm_iommu_sec: fix some overeager cache maintenance
In general, we must do some cache maintenance when sharing buffers with
TZ since our caches are not shared with TZ. Specifically:
(1) If we put some data into a buffer then share it with TZ for
reading, the buffer must be flushed before sending it to TZ.
(2) If TZ puts some data in a buffer for us to read, the buffer must
be invalidated after receiving it from TZ.
In msm_iommu_sec_ptbl_map we are currently doing some cache maintenance
incorrectly. We are invalidating a buffer that we shared with TZ even
though we're not reading from the buffer. We're also flushing way more
than we need to. We're only sharing a single buffer of size
sizeof(phys_addr_t) with TZ but we're flushing the size of the IOMMU
mapping (which could be anything up to 2^sizeof(size_t)).
Remove the unnecessary invalidate and only flush the size of the buffer
being shared, nothing more.
Change-Id: I46d2d95319364d197ae530001851ab819a6eb6fa
Signed-off-by:
Mitchel Humpherys <mitchelh@codeaurora.org>
Loading
Please register or sign in to comment