]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: mm: treat memstart_addr as a signed quantity
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 26 Feb 2016 16:57:14 +0000 (17:57 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 29 Feb 2016 18:31:03 +0000 (18:31 +0000)
commit7722f7f7ebe8f384c06d0a4984da5d15d670db4b
tree77456326c82899b4ef57593788b0bebf02f00ed0
parent14fcbd8ee7c7366a72245475063e436f093a1706
arm64: mm: treat memstart_addr as a signed quantity

Commit 7ecc2c517cb1 ("arm64: kaslr: randomize the linear region")
implements randomization of the linear region, by subtracting a random
multiple of PUD_SIZE from memstart_addr. This causes the virtual mapping
of system RAM to move upwards in the linear region, and at the same time
causes memstart_addr to assume a value which may be negative if the offset
of system RAM in the physical space is smaller than its offset relative to
PAGE_OFFSET in the virtual space.

Since memstart_addr is effectively an offset now, redefine its type as s64
so that expressions involving shifting or division preserve its sign.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/memory.h
arch/arm64/mm/init.c