summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_debug_mem_view.c
diff options
context:
space:
mode:
authorSidath Senanayake <sidaths@google.com>2021-01-29 15:03:53 +0000
committerSidath Senanayake <sidaths@google.com>2021-01-29 15:03:53 +0000
commit9748305a584b9f1f7705303ce6e33a5e8b923e60 (patch)
treea73788e1d912a3202db3a99018002e0858e9a948 /mali_kbase/mali_kbase_debug_mem_view.c
parent201c8bfb4637601363b6e9283f3bdc510711a226 (diff)
downloadgpu-9748305a584b9f1f7705303ce6e33a5e8b923e60.tar.gz
Mali Valhall DDK r29p0 KMD
Provenance: afaca8da1 (collaborate/EAC/v_r29p0) VX504X08X-BU-00000-r29p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r29p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r29p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r29p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: Ie0904c9223b7ec9311b848a52d3159ac2b07530e
Diffstat (limited to 'mali_kbase/mali_kbase_debug_mem_view.c')
-rw-r--r--mali_kbase/mali_kbase_debug_mem_view.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/mali_kbase/mali_kbase_debug_mem_view.c b/mali_kbase/mali_kbase_debug_mem_view.c
index 4788137..305007c 100644
--- a/mali_kbase/mali_kbase_debug_mem_view.c
+++ b/mali_kbase/mali_kbase_debug_mem_view.c
@@ -1,6 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
/*
*
- * (C) COPYRIGHT 2013-2019 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2013-2020 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -32,10 +33,6 @@
#ifdef CONFIG_DEBUG_FS
-#if (KERNEL_VERSION(4, 1, 0) > LINUX_VERSION_CODE)
-#define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count)
-#endif
-
struct debug_mem_mapping {
struct list_head node;
@@ -179,6 +176,13 @@ static int debug_mem_zone_open(struct rb_root *rbtree,
/* Empty region - ignore */
continue;
+ if (reg->flags & KBASE_REG_PROTECTED) {
+ /* CPU access to protected memory is forbidden - so
+ * skip this GPU virtual region.
+ */
+ continue;
+ }
+
mapping = kmalloc(sizeof(*mapping), GFP_KERNEL);
if (!mapping) {
ret = -ENOMEM;
@@ -222,19 +226,19 @@ static int debug_mem_open(struct inode *i, struct file *file)
kbase_gpu_vm_lock(kctx);
ret = debug_mem_zone_open(&kctx->reg_rbtree_same, mem_data);
- if (0 != ret) {
+ if (ret != 0) {
kbase_gpu_vm_unlock(kctx);
goto out;
}
ret = debug_mem_zone_open(&kctx->reg_rbtree_custom, mem_data);
- if (0 != ret) {
+ if (ret != 0) {
kbase_gpu_vm_unlock(kctx);
goto out;
}
ret = debug_mem_zone_open(&kctx->reg_rbtree_exec, mem_data);
- if (0 != ret) {
+ if (ret != 0) {
kbase_gpu_vm_unlock(kctx);
goto out;
}