diff options
Diffstat (limited to 'arch/arm64/mm/init.c')
-rw-r--r-- | arch/arm64/mm/init.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index bbb7ee76e319..21c489bdeb4e 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/swap.h> | 23 | #include <linux/swap.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/bootmem.h> | 25 | #include <linux/bootmem.h> |
26 | #include <linux/cache.h> | ||
26 | #include <linux/mman.h> | 27 | #include <linux/mman.h> |
27 | #include <linux/nodemask.h> | 28 | #include <linux/nodemask.h> |
28 | #include <linux/initrd.h> | 29 | #include <linux/initrd.h> |
@@ -34,6 +35,7 @@ | |||
34 | #include <linux/dma-contiguous.h> | 35 | #include <linux/dma-contiguous.h> |
35 | #include <linux/efi.h> | 36 | #include <linux/efi.h> |
36 | #include <linux/swiotlb.h> | 37 | #include <linux/swiotlb.h> |
38 | #include <linux/vmalloc.h> | ||
37 | 39 | ||
38 | #include <asm/boot.h> | 40 | #include <asm/boot.h> |
39 | #include <asm/fixmap.h> | 41 | #include <asm/fixmap.h> |
@@ -47,16 +49,14 @@ | |||
47 | #include <asm/tlb.h> | 49 | #include <asm/tlb.h> |
48 | #include <asm/alternative.h> | 50 | #include <asm/alternative.h> |
49 | 51 | ||
50 | #include "mm.h" | ||
51 | |||
52 | /* | 52 | /* |
53 | * We need to be able to catch inadvertent references to memstart_addr | 53 | * We need to be able to catch inadvertent references to memstart_addr |
54 | * that occur (potentially in generic code) before arm64_memblock_init() | 54 | * that occur (potentially in generic code) before arm64_memblock_init() |
55 | * executes, which assigns it its actual value. So use a default value | 55 | * executes, which assigns it its actual value. So use a default value |
56 | * that cannot be mistaken for a real physical address. | 56 | * that cannot be mistaken for a real physical address. |
57 | */ | 57 | */ |
58 | s64 memstart_addr __read_mostly = -1; | 58 | s64 memstart_addr __ro_after_init = -1; |
59 | phys_addr_t arm64_dma_phys_limit __read_mostly; | 59 | phys_addr_t arm64_dma_phys_limit __ro_after_init; |
60 | 60 | ||
61 | #ifdef CONFIG_BLK_DEV_INITRD | 61 | #ifdef CONFIG_BLK_DEV_INITRD |
62 | static int __init early_initrd(char *p) | 62 | static int __init early_initrd(char *p) |
@@ -485,7 +485,12 @@ void free_initmem(void) | |||
485 | { | 485 | { |
486 | free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)), | 486 | free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)), |
487 | 0, "unused kernel"); | 487 | 0, "unused kernel"); |
488 | fixup_init(); | 488 | /* |
489 | * Unmap the __init region but leave the VM area in place. This | ||
490 | * prevents the region from being reused for kernel modules, which | ||
491 | * is not supported by kallsyms. | ||
492 | */ | ||
493 | unmap_kernel_range((u64)__init_begin, (u64)(__init_end - __init_begin)); | ||
489 | } | 494 | } |
490 | 495 | ||
491 | #ifdef CONFIG_BLK_DEV_INITRD | 496 | #ifdef CONFIG_BLK_DEV_INITRD |