sh: fix fallout from ZERO_PAGE consolidation
PATCH 1/1 sh: fix fallout from ZERO_PAGE consolidation
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of empty_zero_page declarations broke boot on sh.
sh stores its initial boot parameters in a page reserved in arch/sh/kernel/head_32.S. Before commit 6215d9f4470f ("arch, mm:
consolidate empty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.
This causes wrong code generation and boot hang.
Declare boot_params_page as an array to fix the issue.
--- arch/sh/include/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/include/asm/setup.h +1 -1
@@ -7,7 +7,7 @@/* * This is set up by the setup-routine at boot-time */ -extern unsigned char *boot_params_page; +extern unsigned char boot_params_page[];#define PARAM boot_params_page#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
base-commit: 43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9
Signature · 1 line
2.53.0
John Paul Adrian Glaubitz
maintainerHi Mike,
Quoted 35 lines · Mike Rapoport
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of
empty_zero_pagedeclarations broke boot on sh.sh stores its initial boot parameters in a page reserved in
arch/sh/kernel/head_32.S. Before commit6215d9f4470f("arch, mm:
consolidateempty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.This causes wrong code generation and boot hang.
Declare
boot_params_pageas an array to fix the issue.Reported-by Thomas Weißschuh <[email protected]>Tested-by Thomas Weißschuh <[email protected]>Fixes 6215d9f4470f ("arch, mm: consolidate empty_zero_page")Signed-off-by Mike Rapoport (Microsoft) <[email protected]>--- arch/sh/include/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/sh/include/asm/setup.h +1
-1@@ -7,7 +7,7 @@/* * This is set up by the setup-routine at boot-time */ -extern unsigned char *boot_params_page; +extern unsigned char boot_params_page[];#define PARAM boot_params_page#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
Quoted 1 line
base-commit:
43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9
Thanks, I'll try to test this patch this weekend and will pick it up for v7.1. I have already collected a number of patches for v7.1 with my Reviewed-by.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerHi Mike,
Quoted 34 lines · John Paul Adrian Glaubitz
Quoted 33 lines · Mike Rapoport
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of
empty_zero_pagedeclarations broke boot on sh.sh stores its initial boot parameters in a page reserved in
arch/sh/kernel/head_32.S. Before commit6215d9f4470f("arch, mm:
consolidateempty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.This causes wrong code generation and boot hang.
Declare
boot_params_pageas an array to fix the issue.Reported-by Thomas Weißschuh <[email protected]>Tested-by Thomas Weißschuh <[email protected]>Fixes 6215d9f4470f ("arch, mm: consolidate empty_zero_page")Signed-off-by Mike Rapoport (Microsoft) <[email protected]>--- arch/sh/include/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/sh/include/asm/setup.h +1
-1@@ -7,7 +7,7 @@/* * This is set up by the setup-routine at boot-time */ -extern unsigned char *boot_params_page; +extern unsigned char boot_params_page[];#define PARAM boot_params_page
Quoted 6 lines
Quoted 3 lines
arch/sh/include/asm/setup.h +0
-0#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))base-commit:
43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9Thanks, I'll try to test this patch this weekend and will pick it up for v7.1. I have already collected a number of patches for v7.1 with my Reviewed-by.
I just realized that this patch actually depends on 6215d9f4470f ("arch, mm:
consolidate empty_zero_page"), so I cannot take it directly into my tree now.
Shall we wait for v7.0-rc1 then, so I can pick it up as a regression fix?
Thanks,
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Hi Adrian,
Quoted 11 lines · John Paul Adrian Glaubitz
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 2 lines
base-commit:
43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9Thanks, I'll try to test this patch this weekend and will pick it up for v7.1. I have already collected a number of patches for v7.1 with my Reviewed-by.
I just realized that this patch actually depends on
6215d9f4470f("arch, mm:
consolidateempty_zero_page"), so I cannot take it directly into my tree now.Shall we wait for v7.0-rc1 then, so I can pick it up as a regression fix?
Or we can ask Andrew to pick it via mm tree.
Quoted 2 lines
Thanks,
Adrian
Signature · 2 lines
Sincerely yours, Mike.
John Paul Adrian Glaubitz
maintainerHi Mike,
Quoted 10 lines · Mike Rapoport
Hi Adrian,
Quoted 7 lines · John Paul Adrian Glaubitz
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 2 lines
base-commit:
43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9Thanks, I'll try to test this patch this weekend and will pick it up for v7.1. I have already collected a number of patches for v7.1 with my Reviewed-by.
Quoted 6 lines
Quoted 4 lines
I just realized that this patch actually depends on
6215d9f4470f("arch, mm:
consolidateempty_zero_page"), so I cannot take it directly into my tree now.Shall we wait for v7.0-rc1 then, so I can pick it up as a regression fix?
Or we can ask Andrew to pick it via mm tree.
Let me take it for v7.0-rc2, so I can take more time for testing the patch.
Thanks,
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 8 lines · On Sat, 18 Apr 2026 13:26:50 +0200 John Paul Adrian Glaubitz…
Quoted 6 lines
Quoted 4 lines
I just realized that this patch actually depends on
6215d9f4470f("arch, mm:
consolidateempty_zero_page"), so I cannot take it directly into my tree now.Shall we wait for v7.0-rc1 then, so I can pick it up as a regression fix?
Or we can ask Andrew to pick it via mm tree.
Let me take it for v7.0-rc2, so I can take more time for testing the patch.
I put a copy of this into mm.git, so it goes into linux-next.
John Paul Adrian Glaubitz
maintainerQuoted 5 lines · Andrew Morton
Quoted 3 lines · On Sat, 18 Apr 2026 13:26:50 +0200 John Paul Adrian Glaubitz…
Quoted 3 lines
Quoted 3 lines
I just realized that this patch actually depends on
6215d9f4470f("arch, mm:
consolidateempty_zero_page"), so I cannot take it directly into my tree now.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Shall we wait for v7.0-rc1 then, so I can pick it up as a regression fix?
Or we can ask Andrew to pick it via mm tree.
Let me take it for v7.0-rc2, so I can take more time for testing the patch.
I put a copy of this into mm.git, so it goes into linux-next.
Erhm, I wanted to merge it myself being the SH maintainer.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 8 lines · On Tue, 28 Apr 2026 15:20:21 +0200 John Paul Adrian Glaubitz…
Quoted 7 lines · Andrew Morton
Quoted 5 lines · On Sat, 18 Apr 2026 13:26:50 +0200 John Paul Adrian Glaubitz…
Quoted 5 lines
Quoted 4 lines
I just realized that this patch actually depends on
6215d9f4470f("arch, mm:
consolidateempty_zero_page"), so I cannot take it directly into my tree now.Shall we wait for v7.0-rc1 then, so I can pick it up as a regression fix?
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Or we can ask Andrew to pick it via mm tree.
Let me take it for v7.0-rc2, so I can take more time for testing the patch.
I put a copy of this into mm.git, so it goes into linux-next.
Erhm, I wanted to merge it myself being the SH maintainer.
Yep, I saw that. I wanted to unbreak linux-next.
If/when this turns up in -next I'll drop the mm.git copy.
John Paul Adrian Glaubitz
maintainerHi Andrew,
Quoted 3 lines · Andrew Morton
Yep, I saw that. I wanted to unbreak linux-next.
If/when this turns up in -next I'll drop the mm.git copy.
Sorry for the late reply. I am currently having trouble building a kernel for my J-Core J2 board. My custom J2 toolchain is choking on the current kernel and I can't test the patch myself now.
However, since Geert has confirmed that the patch works, I'm merging it now.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 9 lines · Mike Rapoport
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of
empty_zero_pagedeclarations broke boot on sh.sh stores its initial boot parameters in a page reserved in
arch/sh/kernel/head_32.S. Before commit6215d9f4470f("arch, mm:
consolidateempty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.
Quoted 8 lines
This causes wrong code generation and boot hang.
Declare
boot_params_pageas an array to fix the issue.Reported-by Thomas Weißschuh <[email protected]>Tested-by Thomas Weißschuh <[email protected]>Fixes 6215d9f4470f ("arch, mm: consolidate empty_zero_page")Signed-off-by Mike Rapoport (Microsoft) <[email protected]>
I confirm this fixes boot issues on SEGA Dreamcast (sh4).
Quoted 20 lines
--- arch/sh/include/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)base-commit:
43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9arch/sh/include/asm/setup.h +1
-1@@ -7,7 +7,7 @@/* * This is set up by the setup-routine at boot-time */ -extern unsigned char *boot_params_page; +extern unsigned char boot_params_page[];#define PARAM boot_params_page#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
Hi Mike,
Quoted 9 lines · Mike Rapoport
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of
empty_zero_pagedeclarations broke boot on sh.sh stores its initial boot parameters in a page reserved in
arch/sh/kernel/head_32.S. Before commit6215d9f4470f("arch, mm:
consolidateempty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.
Quoted 8 lines
This causes wrong code generation and boot hang.
Declare
boot_params_pageas an array to fix the issue.Reported-by Thomas Weißschuh <[email protected]>Tested-by Thomas Weißschuh <[email protected]>Fixes 6215d9f4470f ("arch, mm: consolidate empty_zero_page")Signed-off-by Mike Rapoport (Microsoft) <[email protected]>
Thanks, this fixes booting on Landisk and QEMU rts7751r2d.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
John Paul Adrian Glaubitz
maintainerHi,
Quoted 16 lines · Geert Uytterhoeven
Hi Mike,
Quoted 13 lines · Mike Rapoport
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of
empty_zero_pagedeclarations broke boot on sh.sh stores its initial boot parameters in a page reserved in
arch/sh/kernel/head_32.S. Before commit6215d9f4470f("arch, mm:
consolidateempty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.This causes wrong code generation and boot hang.
Declare
boot_params_pageas an array to fix the issue.
Quoted 8 lines
Quoted 4 lines
Reported-by Thomas Weißschuh <[email protected]>Tested-by Thomas Weißschuh <[email protected]>Fixes 6215d9f4470f ("arch, mm: consolidate empty_zero_page")Signed-off-by Mike Rapoport (Microsoft) <[email protected]>Thanks, this fixes booting on Landisk and QEMU rts7751r2d.
Tested-by Geert Uytterhoeven <[email protected]>
I'm going to pick this up later this week. I just wanted to give it a spin myself.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Hi,
Quoted 35 lines · Mike Rapoport
From: "Mike Rapoport (Microsoft)" <[email protected]>
Consolidation of
empty_zero_pagedeclarations broke boot on sh.sh stores its initial boot parameters in a page reserved in
arch/sh/kernel/head_32.S. Before commit6215d9f4470f("arch, mm:
consolidateempty_zero_page") this page was referenced in C code as an array and after that commit it is referenced as a pointer.This causes wrong code generation and boot hang.
Declare
boot_params_pageas an array to fix the issue.Reported-by Thomas Weißschuh <[email protected]>Tested-by Thomas Weißschuh <[email protected]>Fixes 6215d9f4470f ("arch, mm: consolidate empty_zero_page")Signed-off-by Mike Rapoport (Microsoft) <[email protected]>--- arch/sh/include/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/sh/include/asm/setup.h +1
-1@@ -7,7 +7,7 @@/* * This is set up by the setup-routine at boot-time */ -extern unsigned char *boot_params_page; +extern unsigned char boot_params_page[];#define PARAM boot_params_page#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
Quoted 1 line
base-commit:
43cfbdda5af60ffc6272a7b8c5c37d1d0a181ca9
I can't test the patch myself now as my custom J2 toolchain is choking on building the latest kernel from git. But the change looks good to me, so I'm going to merge it now and send another PR to Linus.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913