* [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
@ 2025-11-09 23:30 Finn Thain
2025-11-12 11:38 ` Christophe Leroy
2025-12-27 4:23 ` Madhavan Srinivasan
0 siblings, 2 replies; 6+ messages in thread
From: Finn Thain @ 2025-11-09 23:30 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy
Cc: Cedar Maxwell, Stan Johnson, Dr. David Alan Gilbert,
Benjamin Herrenschmidt, stable, linuxppc-dev, linux-kernel
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: Cedar Maxwell <cedarmaxwell@mac.com>
Cc: Stan Johnson <userm57@yahoo.com>
Cc: "Dr. David Alan Gilbert" <linux@treblig.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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: 0ebc7feae79a ("powerpc: Use shared font data")
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
Changed since v1:
- Improved commit log entry to better explain the need for PTRRELOC().
---
arch/powerpc/kernel/btext.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index 7f63f1cdc6c3..ca00c4824e31 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -20,6 +20,7 @@
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/udbg.h>
+#include <asm/setup.h>
#define NO_SCROLL
@@ -463,7 +464,7 @@ static noinline void draw_byte(unsigned char c, long locX, long locY)
{
unsigned char *base = calc_base(locX << 3, locY << 4);
unsigned int font_index = c * 16;
- const unsigned char *font = font_sun_8x16.data + font_index;
+ const unsigned char *font = PTRRELOC(font_sun_8x16.data) + font_index;
int rb = dispDeviceRowBytes;
rmci_maybe_on();
--
2.49.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
2025-11-09 23:30 [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf() Finn Thain
@ 2025-11-12 11:38 ` Christophe Leroy
2025-12-09 21:41 ` Finn Thain
2025-12-27 4:23 ` Madhavan Srinivasan
1 sibling, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2025-11-12 11:38 UTC (permalink / raw)
To: Finn Thain, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: Cedar Maxwell, Stan Johnson, Dr. David Alan Gilbert,
Benjamin Herrenschmidt, stable, linuxppc-dev, linux-kernel
Le 10/11/2025 à 00:30, Finn Thain a écrit :
> 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: Cedar Maxwell <cedarmaxwell@mac.com>
> Cc: Stan Johnson <userm57@yahoo.com>
> Cc: "Dr. David Alan Gilbert" <linux@treblig.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 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: 0ebc7feae79a ("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>
> ---
> Changed since v1:
> - Improved commit log entry to better explain the need for PTRRELOC().
> ---
> arch/powerpc/kernel/btext.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
> index 7f63f1cdc6c3..ca00c4824e31 100644
> --- a/arch/powerpc/kernel/btext.c
> +++ b/arch/powerpc/kernel/btext.c
> @@ -20,6 +20,7 @@
> #include <asm/io.h>
> #include <asm/processor.h>
> #include <asm/udbg.h>
> +#include <asm/setup.h>
>
> #define NO_SCROLL
>
> @@ -463,7 +464,7 @@ static noinline void draw_byte(unsigned char c, long locX, long locY)
> {
> unsigned char *base = calc_base(locX << 3, locY << 4);
> unsigned int font_index = c * 16;
> - const unsigned char *font = font_sun_8x16.data + font_index;
> + const unsigned char *font = PTRRELOC(font_sun_8x16.data) + font_index;
> int rb = dispDeviceRowBytes;
>
> rmci_maybe_on();
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
2025-11-12 11:38 ` Christophe Leroy
@ 2025-12-09 21:41 ` Finn Thain
2025-12-10 3:59 ` Madhavan Srinivasan
0 siblings, 1 reply; 6+ messages in thread
From: Finn Thain @ 2025-12-09 21:41 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman
Cc: Christophe Leroy, Nicholas Piggin, Cedar Maxwell, Stan Johnson,
Dr. David Alan Gilbert, Benjamin Herrenschmidt, stable,
linuxppc-dev, linux-kernel
I noticed that this bug fix did not get included in the 'powerpc-6.19-1'
pull last week. Was there a reason for that?
On Wed, 12 Nov 2025, Christophe Leroy wrote:
>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
2025-12-09 21:41 ` Finn Thain
@ 2025-12-10 3:59 ` Madhavan Srinivasan
0 siblings, 0 replies; 6+ messages in thread
From: Madhavan Srinivasan @ 2025-12-10 3:59 UTC (permalink / raw)
To: Finn Thain, Michael Ellerman
Cc: Christophe Leroy, Nicholas Piggin, Cedar Maxwell, Stan Johnson,
Dr. David Alan Gilbert, Benjamin Herrenschmidt, stable,
linuxppc-dev, linux-kernel
On 12/10/25 3:11 AM, Finn Thain wrote:
> I noticed that this bug fix did not get included in the 'powerpc-6.19-1'
> pull last week. Was there a reason for that?
My bad, Will add it as part of the -rc PR
Maddy
> On Wed, 12 Nov 2025, Christophe Leroy wrote:
>
>> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
2025-11-09 23:30 [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf() Finn Thain
2025-11-12 11:38 ` Christophe Leroy
@ 2025-12-27 4:23 ` Madhavan Srinivasan
2026-01-18 18:41 ` Cedar Maxwell
1 sibling, 1 reply; 6+ messages in thread
From: Madhavan Srinivasan @ 2025-12-27 4:23 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy, Finn Thain
Cc: Cedar Maxwell, Stan Johnson, Dr. David Alan Gilbert,
Benjamin Herrenschmidt, stable, linuxppc-dev, linux-kernel
On Mon, 10 Nov 2025 10:30:22 +1100, Finn Thain wrote:
> 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.
>
> [...]
Applied to powerpc/fixes.
[1/1] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
https://git.kernel.org/powerpc/c/b94b73567561642323617155bf4ee24ef0d258fe
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
2025-12-27 4:23 ` Madhavan Srinivasan
@ 2026-01-18 18:41 ` Cedar Maxwell
0 siblings, 0 replies; 6+ messages in thread
From: Cedar Maxwell @ 2026-01-18 18:41 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Finn Thain
Cc: Stan Johnson, Dr. David Alan Gilbert, Benjamin Herrenschmidt,
stable, linuxppc-dev, linux-kernel
Maddy (and everyone else),
Thank you all for your hard work in solving this issue!
Cedar Maxwell
On 12/26/25 10:23 PM, Madhavan Srinivasan wrote:
> On Mon, 10 Nov 2025 10:30:22 +1100, Finn Thain wrote:
>> 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.
>>
>> [...]
> Applied to powerpc/fixes.
>
> [1/1] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
> https://git.kernel.org/powerpc/c/b94b73567561642323617155bf4ee24ef0d258fe
>
> cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-01-18 21:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-09 23:30 [PATCH v2] powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf() Finn Thain
2025-11-12 11:38 ` Christophe Leroy
2025-12-09 21:41 ` Finn Thain
2025-12-10 3:59 ` Madhavan Srinivasan
2025-12-27 4:23 ` Madhavan Srinivasan
2026-01-18 18:41 ` Cedar Maxwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox