.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * PowerPC version |
---|
3 | 4 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) |
---|
.. | .. |
---|
9 | 10 | * |
---|
10 | 11 | * Derived from "arch/i386/mm/init.c" |
---|
11 | 12 | * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds |
---|
12 | | - * |
---|
13 | | - * This program is free software; you can redistribute it and/or |
---|
14 | | - * modify it under the terms of the GNU General Public License |
---|
15 | | - * as published by the Free Software Foundation; either version |
---|
16 | | - * 2 of the License, or (at your option) any later version. |
---|
17 | | - * |
---|
18 | 13 | */ |
---|
19 | 14 | |
---|
20 | 15 | #include <linux/module.h> |
---|
.. | .. |
---|
34 | 29 | #include <linux/slab.h> |
---|
35 | 30 | #include <linux/hugetlb.h> |
---|
36 | 31 | |
---|
37 | | -#include <asm/pgalloc.h> |
---|
38 | 32 | #include <asm/prom.h> |
---|
39 | 33 | #include <asm/io.h> |
---|
40 | | -#include <asm/pgtable.h> |
---|
41 | 34 | #include <asm/mmu.h> |
---|
42 | 35 | #include <asm/smp.h> |
---|
43 | 36 | #include <asm/machdep.h> |
---|
.. | .. |
---|
45 | 38 | #include <asm/tlb.h> |
---|
46 | 39 | #include <asm/sections.h> |
---|
47 | 40 | #include <asm/hugetlb.h> |
---|
| 41 | +#include <asm/kup.h> |
---|
| 42 | +#include <asm/kasan.h> |
---|
48 | 43 | |
---|
49 | | -#include "mmu_decl.h" |
---|
| 44 | +#include <mm/mmu_decl.h> |
---|
50 | 45 | |
---|
51 | 46 | #if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL) |
---|
52 | 47 | /* The amount of lowmem must be within 0xF0000000 - KERNELBASE. */ |
---|
.. | .. |
---|
58 | 53 | |
---|
59 | 54 | phys_addr_t total_memory; |
---|
60 | 55 | phys_addr_t total_lowmem; |
---|
61 | | - |
---|
62 | | -phys_addr_t memstart_addr = (phys_addr_t)~0ull; |
---|
63 | | -EXPORT_SYMBOL(memstart_addr); |
---|
64 | | -phys_addr_t kernstart_addr; |
---|
65 | | -EXPORT_SYMBOL(kernstart_addr); |
---|
66 | 56 | |
---|
67 | 57 | #ifdef CONFIG_RELOCATABLE |
---|
68 | 58 | /* Used in __va()/__pa() */ |
---|
.. | .. |
---|
104 | 94 | if (strstr(boot_command_line, "noltlbs")) { |
---|
105 | 95 | __map_without_ltlbs = 1; |
---|
106 | 96 | } |
---|
107 | | - if (debug_pagealloc_enabled()) { |
---|
108 | | - __map_without_bats = 1; |
---|
| 97 | + if (IS_ENABLED(CONFIG_PPC_8xx)) |
---|
| 98 | + return; |
---|
| 99 | + |
---|
| 100 | + if (debug_pagealloc_enabled()) |
---|
109 | 101 | __map_without_ltlbs = 1; |
---|
110 | | - } |
---|
111 | | -#ifdef CONFIG_STRICT_KERNEL_RWX |
---|
112 | | - if (rodata_enabled) { |
---|
113 | | - __map_without_bats = 1; |
---|
| 102 | + |
---|
| 103 | + if (strict_kernel_rwx_enabled()) |
---|
114 | 104 | __map_without_ltlbs = 1; |
---|
115 | | - } |
---|
116 | | -#endif |
---|
117 | 105 | } |
---|
118 | 106 | |
---|
119 | 107 | /* |
---|
.. | .. |
---|
182 | 170 | btext_unmap(); |
---|
183 | 171 | #endif |
---|
184 | 172 | |
---|
| 173 | + kasan_mmu_init(); |
---|
| 174 | + |
---|
| 175 | + setup_kup(); |
---|
| 176 | + |
---|
185 | 177 | /* Shortly after that, the entire linear mapping will be available */ |
---|
186 | 178 | memblock_set_current_limit(lowmem_end_addr); |
---|
187 | 179 | } |
---|