diff options
| author | Akhil P Oommen <akhilpo@codeaurora.org> | 2017-06-21 12:54:18 +0530 |
|---|---|---|
| committer | Akhil P Oommen <akhilpo@qti.qualcomm.com> | 2017-10-04 17:39:45 +0530 |
| commit | 7ec8ae11d9e7f93ea26c00b12615532e2d78c6b9 (patch) | |
| tree | c31580d4f21cc1e2cc8c84a0ea254e4ae28978d7 | |
| parent | bd208931386764a067e10e686d4735d03830e9d6 (diff) | |
msm: kgsl: Avoid cache ops on secure memory
There is no check before cache ops if the memory is marked secure.
This leads to stage 2 pagefault if a secure memory is passed to
IOCTL_KGSL_GPUMEM_SYNC_CACHE ioctl because kernel is not allowed to
do cache ops on secure memory. This can be avoided by returning
success immediately if the memory is marked as secure.
Change-Id: I215d77d2a488cdb00e8e18cfd38cddd9632fd9f6
Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>
| -rw-r--r-- | drivers/gpu/msm/kgsl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c index c46d5ee3c468..ef61f0102a00 100644 --- a/drivers/gpu/msm/kgsl.c +++ b/drivers/gpu/msm/kgsl.c @@ -2742,6 +2742,10 @@ static int _kgsl_gpumem_sync_cache(struct kgsl_mem_entry *entry, int cacheop; int mode; + /* Cache ops are not allowed on secure memory */ + if (entry->memdesc.flags & KGSL_MEMFLAGS_SECURE) + return 0; + /* * Flush is defined as (clean | invalidate). If both bits are set, then * do a flush, otherwise check for the individual bits and clean or inv |
