From: Finn Thain <fthain@linux-m68k.org>
To: "Dr. David Alan Gilbert" <linux@treblig.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
Stan Johnson <userm57@yahoo.com>,
mpe@ellerman.id.au, npiggin@gmail.com, sam@ravnborg.org,
benh@kernel.crashing.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, rdunlap@infradead.org,
Cedar Maxwell <cedarmaxwell@mac.com>
Subject: Re: [PATCH v4] powerpc: Use shared font data
Date: Thu, 6 Nov 2025 10:48:25 +1100 (AEDT) [thread overview]
Message-ID: <6c805c35-a23d-569e-42ef-f3d875997048@linux-m68k.org> (raw)
In-Reply-To: <3cc3d311-35b0-42f1-b20f-ed59391bb8e0@csgroup.eu>
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.
next prev parent reply other threads:[~2025-11-05 23:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 14:27 [PATCH v4] powerpc: Use shared font data linux
2023-09-30 13:15 ` Dr. David Alan Gilbert
2023-10-01 12:08 ` Michael Ellerman
2023-10-02 12:21 ` Dr. David Alan Gilbert
2023-10-15 10:04 ` Michael Ellerman
2025-11-02 5:02 ` Stan Johnson
2025-11-02 11:20 ` Finn Thain
2025-11-02 17:09 ` Dr. David Alan Gilbert
2025-11-02 19:01 ` Stan Johnson
2025-11-03 1:33 ` Finn Thain
2025-11-03 1:48 ` Dr. David Alan Gilbert
2025-11-03 7:26 ` Finn Thain
2025-11-04 17:59 ` Dr. David Alan Gilbert
2025-11-04 19:49 ` Stan Johnson
2025-11-04 21:59 ` Dr. David Alan Gilbert
2025-11-05 4:13 ` QEMU limitations, was " Finn Thain
2025-11-05 14:58 ` Dr. David Alan Gilbert
2025-11-05 21:44 ` Christophe Leroy
2025-11-05 23:48 ` Finn Thain [this message]
2025-11-06 4:11 ` Finn Thain
2025-11-06 9:28 ` Christophe Leroy
2025-11-06 11:50 ` Finn Thain
2025-11-06 12:07 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6c805c35-a23d-569e-42ef-f3d875997048@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=benh@kernel.crashing.org \
--cc=cedarmaxwell@mac.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@treblig.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=rdunlap@infradead.org \
--cc=sam@ravnborg.org \
--cc=userm57@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).