[RAMEN9610-12171] android: ion: cacheflush on entire proteted area
authorCho KyongHo <pullip.cho@samsung.com>
Tue, 15 Jan 2019 12:28:21 +0000 (21:28 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:17 +0000 (20:23 +0300)
commited9a32dec52daa831b39a48644ad68c15fac3ef4
tree6e159f959373c9191fede69793a879f0ee9f7cfd
parent6d1bc3dcfcfcef6eb74d4f2482ba1e9a880943da
[RAMEN9610-12171] android: ion: cacheflush on entire proteted area

Pages from the CMA heap tends to be cached in the CPU caches with dirty
state since they are served as anon and page cache pages for the
userspace.
Flushing caches on buffer allocation is intended for prenventing
corruption from writing back to DRAM from the dirth cache lines while
updating the buffer from DMA. However, cache flush should be performed
on the entire allocated area if the buffer is to be protected from
non-secure access to prevent the dirty write-back to the protected area.
It is also applied to the carveout heap because allocation from a
carveout heap by an anonymous user is not prohibited.

Change-Id: Ieb1ae2efacefe1d23f03a4cc72615d45b4309eb7
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/staging/android/ion/ion_carveout_heap.c
drivers/staging/android/ion/ion_cma_heap.c