Skip to content
/ linux Public

Commit 540e52d

Browse files
hdellergregkh
authored andcommitted
parisc: Check kernel mapping earlier at bootup
commit 17c144f upstream. The check if the initial mapping is sufficient needs to happen much earlier during bootup. Move this test directly to the start_parisc() function and use native PDC iodc functions to print the warning, because panic() and printk() are not functional yet. This fixes boot when enabling various KALLSYSMS options which need much more space. Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # v6.0+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 05d239f commit 540e52d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

arch/parisc/kernel/setup.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,6 @@ void __init setup_arch(char **cmdline_p)
120120
#endif
121121
printk(KERN_CONT ".\n");
122122

123-
/*
124-
* Check if initial kernel page mappings are sufficient.
125-
* panic early if not, else we may access kernel functions
126-
* and variables which can't be reached.
127-
*/
128-
if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
129-
panic("KERNEL_INITIAL_ORDER too small!");
130-
131123
#ifdef CONFIG_64BIT
132124
if(parisc_narrow_firmware) {
133125
printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
@@ -279,6 +271,18 @@ void __init start_parisc(void)
279271
int ret, cpunum;
280272
struct pdc_coproc_cfg coproc_cfg;
281273

274+
/*
275+
* Check if initial kernel page mapping is sufficient.
276+
* Print warning if not, because we may access kernel functions and
277+
* variables which can't be reached yet through the initial mappings.
278+
* Note that the panic() and printk() functions are not functional
279+
* yet, so we need to use direct iodc() firmware calls instead.
280+
*/
281+
const char warn1[] = "CRITICAL: Kernel may crash because "
282+
"KERNEL_INITIAL_ORDER is too small.\n";
283+
if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
284+
pdc_iodc_print(warn1, sizeof(warn1) - 1);
285+
282286
/* check QEMU/SeaBIOS marker in PAGE0 */
283287
running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);
284288

0 commit comments

Comments
 (0)