mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
soc: qcom: mem-buf: Avoid clearing transferred memory twice
Memory that goes through mem-buf is always transferred back to the owner when the owner invokes hyp_assign() to regain access to the memory. This means that if the owner did not have access to the memory throughout the time the memory was lent to another VMID, hyp_assign() will clear the memory before returning it to the owner. Memory that is hyp_assigned through mem-buf creates a memparcel in the resource manager(RM), when the memory is lent to another VMID, and destroys the memparcel when the memory is reclaimed by the owner. However, during the reclaim step, hyp_assign() is used, which clears the memory, but the RM is unaware of the hyp_assign() policies, so it will only clear the memory if the VM that released the memory asked for it to be cleared, which is what mem-buf does. This results in clearing a memory region twice, which is sub-optimal, so remove the explicit request to sanitize the memory when the mem-buf driver releases a memparcel. Change-Id: I637f2305bf34d839db4f15f152b0bfcbb7b7052e Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
parent
eb749ee5d9
commit
c4028fcf86
1 changed files with 1 additions and 1 deletions
|
|
@ -973,7 +973,7 @@ static int mem_buf_unmap_mem_s2(hh_memparcel_handle_t memparcel_hdl)
|
|||
int ret;
|
||||
|
||||
pr_debug("%s: removing CPU MMU stage 2 mappings\n", __func__);
|
||||
ret = hh_rm_mem_release(memparcel_hdl, HH_RM_MEM_RELEASE_CLEAR);
|
||||
ret = hh_rm_mem_release(memparcel_hdl, 0);
|
||||
|
||||
if (ret < 0)
|
||||
pr_err("%s: Failed to release memparcel hdl: 0x%lx rc: %d\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue