defconfig: 8226: enable free page read only

Recently we have seen several reports of memory
corruption on 8926 baselines. This config marks
any freed page as read only enabling us to detect
use after free.

This is a hot fix which is planned to be reverted at
a later point of time.

CRs-Fixed: 675914
Change-Id: I6a492d9581f392a729cdc6c51b1bece70a8ec4b6
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
msm: kgsl: Fix memory entry leak when calling adreno_convertaddr

When adreno_convertaddr is called the memory searched in this function
may have a memory entry associated with it if this allocation belongs
to user space. A reference to this memory entry is taken when
this function is called which should be returned when the caller is
done using the memory. Made changes to return a reference to the
entry when calling this function which is returned when caller is
done using the memory.

Change-Id: I610553fd4b119d3c47cbfcec970d50046dbb2863
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: kgsl: Keep track of kernel space mappings to memory

Add a counter to count number of times a memory descriptor is
mapped in the kernel and unmap the kernel mapping only when the
count reaches 0. There can be multiple threads using the kernel
mapping at the same time hence a counter is used to make sure
that we do not unmap the mapping before the last thread has
finished using it.

Change-Id: I9c53deb6af12fb1f6ed30e46b386e1cd60dafdda
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Merge "msm: kgsl: Fix memory entry leak when calling adreno_convertaddr"
Merge "msm: kgsl: Keep track of kernel space mappings to memory"
Merge "defconfig: 8226: enable free page read only"