]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: memory: Fix virt_addr_valid() using __is_lm_address()
authorWill Deacon <will@kernel.org>
Tue, 13 Aug 2019 14:52:23 +0000 (15:52 +0100)
committerWill Deacon <will@kernel.org>
Wed, 14 Aug 2019 12:00:57 +0000 (13:00 +0100)
commit7637e7be3dfc01cdb0c2be249cb91c4af0580386
tree28f9129443d076c4ab76bd1e878110ed3c4791a2
parent0743a87922b6e24ad2cc97852f8192b1a8e88322
arm64: memory: Fix virt_addr_valid() using __is_lm_address()

virt_addr_valid() is intended to test whether or not the passed address
is a valid linear map address. Unfortunately, it relies on
_virt_addr_is_linear() which is broken because it assumes the linear
map is at the top of the address space, which it no longer is.

Reimplement virt_addr_valid() using __is_lm_address() and remove
_virt_addr_is_linear() entirely. At the same time, ensure we evaluate
the macro parameter only once and move it within the __ASSEMBLY__ block.

Reported-by: Qian Cai <cai@lca.pw>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Fixes: 7fe9a0a5e9ce ("arm64: mm: Flip kernel VA space")
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/memory.h