[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)
committerhskang <hs1218.kang@samsung.com>
Thu, 14 Feb 2019 16:20:47 +0000 (01:20 +0900)
commitf55cc116172fca6fc84dfc7a54c2c4e722b891e3
tree271cc381f382a66135996e163daeebb420a3631b
parenta4a185ad2f4abc106cacffe4faa974f64c0e9b0e
[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