hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/powerpc/kernel/crash_dump.c
....@@ -1,12 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Routines for doing kexec-based kdump.
34 *
45 * Copyright (C) 2005, IBM Corp.
56 *
67 * Created by: Michael Ellerman
7
- *
8
- * This source code is licensed under the GNU General Public License,
9
- * Version 2. See the file COPYING for more details.
108 */
119
1210 #undef DEBUG
....@@ -20,6 +18,7 @@
2018 #include <asm/firmware.h>
2119 #include <linux/uaccess.h>
2220 #include <asm/rtas.h>
21
+#include <asm/inst.h>
2322
2423 #ifdef DEBUG
2524 #include <asm/udbg.h>
....@@ -36,7 +35,7 @@
3635
3736 static void __init create_trampoline(unsigned long addr)
3837 {
39
- unsigned int *p = (unsigned int *)addr;
38
+ struct ppc_inst *p = (struct ppc_inst *)addr;
4039
4140 /* The maximum range of a single instruction branch, is the current
4241 * instruction's address + (32 MB - 4) bytes. For the trampoline we
....@@ -46,8 +45,8 @@
4645 * branch to "addr" we jump to ("addr" + 32 MB). Although it requires
4746 * two instructions it doesn't require any registers.
4847 */
49
- patch_instruction(p, PPC_INST_NOP);
50
- patch_branch(++p, addr + PHYSICAL_START, 0);
48
+ patch_instruction(p, ppc_inst(PPC_INST_NOP));
49
+ patch_branch((void *)p + 4, addr + PHYSICAL_START, 0);
5150 }
5251
5352 void __init setup_kdump_trampoline(void)
....@@ -110,7 +109,7 @@
110109 vaddr = __va(paddr);
111110 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
112111 } else {
113
- vaddr = __ioremap(paddr, PAGE_SIZE, 0);
112
+ vaddr = ioremap_cache(paddr, PAGE_SIZE);
114113 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
115114 iounmap(vaddr);
116115 }