Skip to content

Commit b94b735

Browse files
fthainmaddy-kerneldev
authored andcommitted
powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
Since Linux v6.7, booting using BootX on an Old World PowerMac produces an early crash. Stan Johnson writes, "the symptoms are that the screen goes blank and the backlight stays on, and the system freezes (Linux doesn't boot)." Further testing revealed that the failure can be avoided by disabling CONFIG_BOOTX_TEXT. Bisection revealed that the regression was caused by a change to the font bitmap pointer that's used when btext_init() begins painting characters on the display, early in the boot process. Christophe Leroy explains, "before kernel text is relocated to its final location ... data is addressed with an offset which is added to the Global Offset Table (GOT) entries at the start of bootx_init() by function reloc_got2(). But the pointers that are located inside a structure are not referenced in the GOT and are therefore not updated by reloc_got2(). It is therefore needed to apply the offset manually by using PTRRELOC() macro." Cc: stable@vger.kernel.org Link: https://lists.debian.org/debian-powerpc/2025/10/msg00111.html Link: https://lore.kernel.org/linuxppc-dev/d81ddca8-c5ee-d583-d579-02b19ed95301@yahoo.com/ Reported-by: Cedar Maxwell <cedarmaxwell@mac.com> Closes: https://lists.debian.org/debian-powerpc/2025/09/msg00031.html Bisected-by: Stan Johnson <userm57@yahoo.com> Tested-by: Stan Johnson <userm57@yahoo.com> Fixes: 0ebc7fe ("powerpc: Use shared font data") Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Finn Thain <fthain@linux-m68k.org> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/22b3b247425a052b079ab84da926706b3702c2c7.1762731022.git.fthain@linux-m68k.org
1 parent f116453 commit b94b735

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/powerpc/kernel/btext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <asm/io.h>
2121
#include <asm/processor.h>
2222
#include <asm/udbg.h>
23+
#include <asm/setup.h>
2324

2425
#define NO_SCROLL
2526

@@ -463,7 +464,7 @@ static noinline void draw_byte(unsigned char c, long locX, long locY)
463464
{
464465
unsigned char *base = calc_base(locX << 3, locY << 4);
465466
unsigned int font_index = c * 16;
466-
const unsigned char *font = font_sun_8x16.data + font_index;
467+
const unsigned char *font = PTRRELOC(font_sun_8x16.data) + font_index;
467468
int rb = dispDeviceRowBytes;
468469

469470
rmci_maybe_on();

0 commit comments

Comments
 (0)