summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Diver <diverj@google.com>2024-02-26 12:25:44 +0000
committerJack Diver <diverj@google.com>2024-03-05 13:09:30 +0000
commit9166445b9d7d382d5041b49ef9287bdb3cfca448 (patch)
tree4ae99379f4e7c8f98b805c3eda2578baafa16997
parent0ff2be2a2bb33093a47fcc173fa92c97dad3fe38 (diff)
downloadgpu-9166445b9d7d382d5041b49ef9287bdb3cfca448.tar.gz
mali_kbase: Prevent page migration for shrinkable regionsandroid-14.0.0_r0.77android-gs-shusky-5.15-android14-qpr2
Bug: 324565943 Change-Id: I706bef805b96113ad4dc1b44d3ea1a8f12652965 Signed-off-by: Jack Diver <diverj@google.com>
-rw-r--r--mali_kbase/platform/pixel/pixel_gpu_slc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mali_kbase/platform/pixel/pixel_gpu_slc.c b/mali_kbase/platform/pixel/pixel_gpu_slc.c
index 645a19d..bab758b 100644
--- a/mali_kbase/platform/pixel/pixel_gpu_slc.c
+++ b/mali_kbase/platform/pixel/pixel_gpu_slc.c
@@ -49,7 +49,7 @@ struct gpu_slc_liveness_update_info {
static void gpu_slc_lock_as(struct kbase_context *kctx)
{
down_write(kbase_mem_get_process_mmap_lock());
- kbase_gpu_vm_lock(kctx);
+ kbase_gpu_vm_lock_with_pmode_sync(kctx);
}
/**
@@ -59,7 +59,7 @@ static void gpu_slc_lock_as(struct kbase_context *kctx)
*/
static void gpu_slc_unlock_as(struct kbase_context *kctx)
{
- kbase_gpu_vm_unlock(kctx);
+ kbase_gpu_vm_unlock_with_pmode_sync(kctx);
up_write(kbase_mem_get_process_mmap_lock());
}
@@ -97,6 +97,12 @@ static struct kbase_va_region* gpu_slc_get_region(struct kbase_context *kctx, u6
/* Validate the region */
if (kbase_is_region_invalid_or_free(reg))
goto invalid;
+ /* Might be shrunk */
+ if (kbase_is_region_shrinkable(reg))
+ goto invalid;
+ /* Driver internal alloc */
+ if (kbase_va_region_is_no_user_free(reg))
+ goto invalid;
return reg;