mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 04:25:09 +07:00
c21f5a9ed8
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 commit215b823707
("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:215b823707
("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>
35 lines
1006 B
C
35 lines
1006 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Definitions for using the procedures in btext.c.
|
|
*
|
|
* Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
*/
|
|
#ifndef __PPC_BTEXT_H
|
|
#define __PPC_BTEXT_H
|
|
#ifdef __KERNEL__
|
|
|
|
extern int btext_find_display(int allow_nonstdout);
|
|
extern void btext_update_display(unsigned long phys, int width, int height,
|
|
int depth, int pitch);
|
|
extern void btext_setup_display(int width, int height, int depth, int pitch,
|
|
unsigned long address);
|
|
#ifdef CONFIG_PPC32
|
|
extern void btext_prepare_BAT(void);
|
|
#else
|
|
static inline void btext_prepare_BAT(void) { }
|
|
#endif
|
|
extern void btext_map(void);
|
|
extern void btext_unmap(void);
|
|
|
|
extern void btext_drawchar(char c);
|
|
extern void btext_drawstring(const char *str);
|
|
extern void btext_drawhex(unsigned long v);
|
|
extern void btext_drawtext(const char *c, unsigned int len);
|
|
|
|
extern void btext_clearscreen(void);
|
|
extern void btext_flushscreen(void);
|
|
extern void btext_flushline(void);
|
|
|
|
#endif /* __KERNEL__ */
|
|
#endif /* __PPC_BTEXT_H */
|