Commit c70e9b8e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull m68k fixes from Geert Uytterhoeven:

 - Fix systems with memory at end of 32-bit address space

 - Fix initrd on systems where memory does not start at address zero

 - Fix 68030 handling of bus errors for addresses in exception tables

* tag 'm68k-for-v6.3-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k: Only force 030 bus error if PC not in exception table
  m68k: mm: Move initrd phys_to_virt handling after paging_init()
  m68k: mm: Fix systems with memory at end of 32-bit address space
parents 573b22cc e36a82be
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -326,16 +326,16 @@ void __init setup_arch(char **cmdline_p)
		panic("No configuration setup");
	}

#ifdef CONFIG_BLK_DEV_INITRD
	if (m68k_ramdisk.size) {
	if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && m68k_ramdisk.size)
		memblock_reserve(m68k_ramdisk.addr, m68k_ramdisk.size);

	paging_init();

	if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && m68k_ramdisk.size) {
		initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
		initrd_end = initrd_start + m68k_ramdisk.size;
		pr_info("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
	}
#endif

	paging_init();

#ifdef CONFIG_NATFEAT
	nf_init();
+3 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/init.h>
#include <linux/ptrace.h>
#include <linux/kallsyms.h>
#include <linux/extable.h>

#include <asm/setup.h>
#include <asm/fpu.h>
@@ -545,7 +546,8 @@ static inline void bus_error030 (struct frame *fp)
			errorcode |= 2;

		if (mmusr & (MMU_I | MMU_WP)) {
			if (ssw & 4) {
			/* We might have an exception table for this PC */
			if (ssw & 4 && !search_exception_tables(fp->ptregs.pc)) {
				pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n",
				       ssw & RW ? "read" : "write",
				       fp->un.fmtb.daddr,
+5 −5
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ void __init paging_init(void)
	}

	min_addr = m68k_memory[0].addr;
	max_addr = min_addr + m68k_memory[0].size;
	max_addr = min_addr + m68k_memory[0].size - 1;
	memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0,
			  MEMBLOCK_NONE);
	for (i = 1; i < m68k_num_memory;) {
@@ -452,21 +452,21 @@ void __init paging_init(void)
		}
		memblock_add_node(m68k_memory[i].addr, m68k_memory[i].size, i,
				  MEMBLOCK_NONE);
		addr = m68k_memory[i].addr + m68k_memory[i].size;
		addr = m68k_memory[i].addr + m68k_memory[i].size - 1;
		if (addr > max_addr)
			max_addr = addr;
		i++;
	}
	m68k_memoffset = min_addr - PAGE_OFFSET;
	m68k_virt_to_node_shift = fls(max_addr - min_addr - 1) - 6;
	m68k_virt_to_node_shift = fls(max_addr - min_addr) - 6;

	module_fixup(NULL, __start_fixup, __stop_fixup);
	flush_icache();

	high_memory = phys_to_virt(max_addr);
	high_memory = phys_to_virt(max_addr) + 1;

	min_low_pfn = availmem >> PAGE_SHIFT;
	max_pfn = max_low_pfn = max_addr >> PAGE_SHIFT;
	max_pfn = max_low_pfn = (max_addr >> PAGE_SHIFT) + 1;

	/* Reserve kernel text/data/bss and the memory allocated in head.S */
	memblock_reserve(m68k_memory[0].addr, availmem - m68k_memory[0].addr);