Skip to content

Commit

Permalink
Merge tag 'm68k-for-v6.3-tag2' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/geert/linux-m68k

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
  • Loading branch information
Linus Torvalds committed Mar 9, 2023
2 parents 573b22c + e36a82b commit c70e9b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions arch/m68k/kernel/setup_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion arch/m68k/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions arch/m68k/mm/motorola.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;) {
Expand All @@ -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);
Expand Down

0 comments on commit c70e9b8

Please sign in to comment.