MIDCET-4324/GPUCORE-35180 Clear GPU caches before terminating region tracker

Move the code to disable the MMU for a kctx (which also will flush the
GPU caches for that kctx's Address Space) from the end of kctx
termination to JM/CSF kctx-scheduler termination time.

This ensures the GPU cached writes for that kctx are clear before we
free the kctx's GPU memory pages in the region tracker, and before the
MMU tables are freed.

This in turn ensures the GPU cached writes do not land in freed memory
(which would be a security issue).

Change-Id: I2730a5762cb106ca2179cf9a2f789b8764f21901
(cherry picked from commit 09e14ccf27007dcb2cc0d4d64f5087ccc620a0b5)
Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/4810
Bug: 260123838
7 files changed
tree: 0508d24a04d09627402ac38a8a57ae64bbf1fa06
  1. common/
  2. mali_kbase/
  3. mali_pixel/