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

Commit a6a8aabd authored by Jordan Crouse's avatar Jordan Crouse
Browse files

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: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 279398cf
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