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

Skip to content
Commit 387a5dfc authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Avoid legacy GPU address / ID conflicts in mmap



It is possible to have a conflict in mmap between a legacy GPU object
mapped at a very low address and a GPU object mapped via ID.  Prevent
a conflict by only allowing legacy GPU address mapping <
KGSL_SVM_UPPER_BOUND while at the same time moving the lower bound of
the assigned GPU object IDs to (KGSL_SVM_UPPER_BOUND >> PAGE_SHIFT)
thereby ensuring that never the twain shall meet.

This restriction means two things: 1) that legacy GPU memory
allocations (IOCTL_KGSL_GPUMEM_ALLOC and older) need to be allocated
from the user GPU address region (< KGSL_SVM_UPPER_BOUND) and 2)
external memory that is mapped in the upper region
(> KGSL_SVM_UPPER_BOUND) can no longer be mmaped(). The good news is
that this has always been implicitly true but this change makes it
explicit. To wit: Imported memory can never be mmaped() and legacy
GPU memory allocations always come from the lower address space.

Change-Id: Ic0dedbad98c2c014f522c1af2a664519a82c9506
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 548e7c28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment