Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4323d4ca authored by Akhil P Oommen's avatar Akhil P Oommen
Browse files

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: default avatarAkhil P Oommen <akhilpo@codeaurora.org>
parent 099e9fc7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2763,6 +2763,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