]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Fixed __debug_virt_addr_valid()
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 14 Jul 2022 22:25:12 +0000 (15:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:08 +0000 (14:24 +0200)
commitdec5307f04d6a815b5485037846c2d1099f6869d
treef6fb0e6c0bea7ffe1035a29f40e9ad2660c2fda7
parent97d7898d8afb95837bf2dfb6dd8c19ba38d9861e
MIPS: Fixed __debug_virt_addr_valid()

[ Upstream commit 9472906ac8da6db6a5227a6365fe95ebacb7ffd7 ]

It is permissible for kernel code to call virt_to_phys() against virtual
addresses that are in KSEG0 or KSEG1 and we need to be dealing with both
types. Rewrite the test condition to ensure that the kernel virtual
addresses are above PAGE_OFFSET which they must be, and below KSEG2
where the non-linear mapping starts.

For EVA, there is not much that we can do given the linear address range
that is offered, so just return any virtual address as being valid.

Finally, when HIGHMEM is not enabled, all virtual addresses are assumed
to be valid as well.

Fixes: f6c79b8d8bc7 ("MIPS: Add support for CONFIG_DEBUG_VIRTUAL")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/mm/physaddr.c