msm: Account for unaligned memory hole
The memory hole is required to be section size aligned. The
PMD size internally may be greater than the section size. If the
end of the memory hole is not PMD aligned, we may end up with the
case where the physical address is PMD aligned but not the virtual
address or vice versa. This results in crashes in features such
as CMA that (reasonablly) assume that the virtual address will be PMD
aligned if and only if the physical address is aligned. Account
for this in the memory hole code by aligning the virtual address
up to PMD_SIZE if there is a mismatch with the physical address.
This does result in a loss in virtual address space but the
amount should be small compared to what is gained by by turning
on CONFIG_DONT_MAP_HOLE_AFTER_MEMBANK0. The virtual address loss
will go away if the memory hole is properly aligned to PMD_SIZE.
Change-Id: I985568a7cc6bc22bdd65586111ff078ab61b6c34
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2 files changed