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:
Jordan Crouse <jcrouse@codeaurora.org>
Loading
Please register or sign in to comment