]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32s: fix booting with CONFIG_PPC_EARLY_DEBUG_BOOTX
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 3 Jun 2019 13:00:51 +0000 (13:00 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 7 Jun 2019 09:00:14 +0000 (19:00 +1000)
commit0b0f951d3b0508da1fa4c838fd8bfe7696ffa8c1
tree5e94ef7d9d6f48699453261e6f86652e848b3f69
parenta43c7d6ece15f402a8fee198a6f0023ec6e49e1b
powerpc/32s: fix booting with CONFIG_PPC_EARLY_DEBUG_BOOTX

When booting through OF, setup_disp_bat() does nothing because
disp_BAT are not set. By change, it used to work because BOOTX
buffer is mapped 1:1 at address 0x81000000 by the bootloader, and
btext_setup_display() sets virt addr same as phys addr.

But since commit 421dad021ee4 ("powerpc/32s: set up an early static
hash table for KASAN."), a temporary page table overrides the
bootloader mapping.

This 0x81000000 is also problematic with the newly implemented
Kernel Userspace Access Protection (KUAP) because it is within user
address space.

This patch fixes those issues by properly setting disp_BAT through
a call to btext_prepare_BAT(), allowing setup_disp_bat() to
properly setup BAT3 for early bootx screen buffer access.

Reported-by: Mathieu Malaterre <malat@debian.org>
Fixes: 421dad021ee4 ("powerpc/32s: set up an early static hash table for KASAN.")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Tested-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/btext.h
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/prom_init_check.sh