Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

parisc: Check kernel mapping earlier at bootup

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+

+12 -8
+12 -8
arch/parisc/kernel/setup.c
··· 120 120 #endif 121 121 printk(KERN_CONT ".\n"); 122 122 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 - 131 123 #ifdef CONFIG_64BIT 132 124 if(parisc_narrow_firmware) { 133 125 printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n"); ··· 270 278 { 271 279 int ret, cpunum; 272 280 struct pdc_coproc_cfg coproc_cfg; 281 + 282 + /* 283 + * Check if initial kernel page mapping is sufficient. 284 + * Print warning if not, because we may access kernel functions and 285 + * variables which can't be reached yet through the initial mappings. 286 + * Note that the panic() and printk() functions are not functional 287 + * yet, so we need to use direct iodc() firmware calls instead. 288 + */ 289 + const char warn1[] = "CRITICAL: Kernel may crash because " 290 + "KERNEL_INITIAL_ORDER is too small.\n"; 291 + if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE) 292 + pdc_iodc_print(warn1, sizeof(warn1) - 1); 273 293 274 294 /* check QEMU/SeaBIOS marker in PAGE0 */ 275 295 running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);