msm: kgsl: Make sure that mmap() hints falls inside the allowed range
The code is clamping mmap() hints to ensure that they fall within the
acceptable range. Unfortunately it was clamping the high end at the
very top of the range so addresses above the range were getting
clamped to the top of the range.
Take for example a 32 bit hint above 0xBF000000 (top of the
32 bit VA range). The hint gets clamped to 0xBF000000 and because
0xBF000000 is valid for the application the address ends up
getting accepted for both the CPU and the GPU. Later, when somebody
tries to use the address, it gets checked against the valid IOMMU
ranges and rejected because it is out of range.
Take into account the size of the allocation when clamping which
will ensure that the address we try will actually fit in the
acceptable region.
Change-Id: Ic0dedbada38b8fade09de144b11cc462e1fc2de3
Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
Loading
Please register or sign in to comment