Commit 6deccafc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull parisc fixes from Helge Deller:
 "While testing Sasha Levin's 'kallsyms: embed source file:line info in
  kernel stack traces' patch series, which increases the typical kernel
  image size, I found some issues with the parisc initial kernel mapping
  which may prevent the kernel to boot.

  The three small patches here fix this"

* tag 'parisc-for-7.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Fix initial page table creation for boot
  parisc: Check kernel mapping earlier at bootup
  parisc: Increase initial mapping to 64 MB with KALLSYMS
parents 8b7f4cd3 8475d8fe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ extern void __update_cache(pte_t pte);
	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))

/* This is the size of the initially mapped kernel memory */
#if defined(CONFIG_64BIT)
#if defined(CONFIG_64BIT) || defined(CONFIG_KALLSYMS)
#define KERNEL_INITIAL_ORDER	26	/* 1<<26 = 64MB */
#else
#define KERNEL_INITIAL_ORDER	25	/* 1<<25 = 32MB */
+6 −1
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ ENTRY(parisc_kernel_start)

	.import __bss_start,data
	.import __bss_stop,data
	.import __end,data

	load32		PA(__bss_start),%r3
	load32		PA(__bss_stop),%r4
@@ -149,7 +150,11 @@ $cpu_ok:
	 * everything ... it will get remapped correctly later */
	ldo		0+_PAGE_KERNEL_RWX(%r0),%r3 /* Hardwired 0 phys addr start */
	load32		(1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */
	load32		PA(pg0),%r1
	load32		PA(_end),%r1
	SHRREG		%r1,PAGE_SHIFT,%r1  /* %r1 is PFN count for _end symbol */
	cmpb,<<,n	%r11,%r1,1f
	copy		%r1,%r11	/* %r1 PFN count smaller than %r11 */
1:	load32		PA(pg0),%r1

$pgt_fill_loop:
	STREGM          %r3,ASM_PTE_ENTRY_SIZE(%r1)
+12 −8
Original line number Diff line number Diff line
@@ -120,14 +120,6 @@ void __init setup_arch(char **cmdline_p)
#endif
	printk(KERN_CONT ".\n");

	/*
	 * Check if initial kernel page mappings are sufficient.
	 * panic early if not, else we may access kernel functions
	 * and variables which can't be reached.
	 */
	if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
		panic("KERNEL_INITIAL_ORDER too small!");

#ifdef CONFIG_64BIT
	if(parisc_narrow_firmware) {
		printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
@@ -279,6 +271,18 @@ void __init start_parisc(void)
	int ret, cpunum;
	struct pdc_coproc_cfg coproc_cfg;

	/*
	 * Check if initial kernel page mapping is sufficient.
	 * Print warning if not, because we may access kernel functions and
	 * variables which can't be reached yet through the initial mappings.
	 * Note that the panic() and printk() functions are not functional
	 * yet, so we need to use direct iodc() firmware calls instead.
	 */
	const char warn1[] = "CRITICAL: Kernel may crash because "
			     "KERNEL_INITIAL_ORDER is too small.\n";
	if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
		pdc_iodc_print(warn1, sizeof(warn1) - 1);

	/* check QEMU/SeaBIOS marker in PAGE0 */
	running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0);