[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c805c35-a23d-569e-42ef-f3d875997048@linux-m68k.org>
Date: Thu, 6 Nov 2025 10:48:25 +1100 (AEDT)
From: Finn Thain <fthain@...ux-m68k.org>
To: "Dr. David Alan Gilbert" <linux@...blig.org>
cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Stan Johnson <userm57@...oo.com>, mpe@...erman.id.au, npiggin@...il.com,
sam@...nborg.org, benh@...nel.crashing.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, rdunlap@...radead.org,
Cedar Maxwell <cedarmaxwell@....com>
Subject: Re: [PATCH v4] powerpc: Use shared font data
On Wed, 5 Nov 2025, Christophe Leroy wrote:
> > I wonder if bodging those in lib/fonts/Makefile for
> > lib/fonts/font_sun8x16.c fixes it?
> > But... this is data - there's no code is there - are any of those
> > flags relevant for data only?
>
> I think -fPIC is relevant for data-only here because font_sun_8x16
> contains a pointer to fontdata_sun8x16 in font_sun_8x16.data
>
> I see two things to try:
>
> 1/ Either build font_sun8x16.o with -fPIC
>
> diff --git a/lib/fonts/Makefile b/lib/fonts/Makefile
> index e16f68492174a..844306d7b15e9 100644
> --- a/lib/fonts/Makefile
> +++ b/lib/fonts/Makefile
> @@ -20,3 +20,5 @@ font-objs-$(CONFIG_FONT_6x8) += font_6x8.o
> font-objs += $(font-objs-y)
>
> obj-$(CONFIG_FONT_SUPPORT) += font.o
> +
> +CFLAGS_font_sun8x16.o += -fPIC
>
> 2/ Or add a PTRRELOC:
>
> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
> index 7f63f1cdc6c39..fc461cfaf4a34 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();
>
Patch 2 has the virtue that it only needs to be tested on powerpc.
Patch 1 has the virtue that other architectures might benefit.
Commit 0ebc7feae79a ("powerpc: Use shared font data"), which caused the
regression, has a sparc equivalent in commit 0f1991949d9b ("sparc: Use
shared font data"). So I wonder whether CONFIG_EARLYFB has also regressed
(for CONFIG_SPARC64). Maybe QEMU could help answer that question.
Powered by blists - more mailing lists