aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2016-09-05 07:30:22 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-06 14:09:38 -0400
commitdae8c235d9a21a564793ea9fe716233e11d30e21 (patch)
treee2e46d253d4911af43cfd1d9b75a95ef3f78b395 /arch/arm64/mm
parent282b87963556a971f9acbe3d430991b80480541a (diff)
arm64: mm: drop fixup_init() and mm.h
There is only fixup_init() in mm.h , and it is only called in free_initmem(), so move the codes from fixup_init() into free_initmem(), then drop fixup_init() and mm.h. Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/flush.c2
-rw-r--r--arch/arm64/mm/init.c10
-rw-r--r--arch/arm64/mm/mm.h2
-rw-r--r--arch/arm64/mm/mmu.c12
-rw-r--r--arch/arm64/mm/pgd.c2
5 files changed, 7 insertions, 21 deletions
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index 43a76b07eb32..8377329d8c97 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -25,8 +25,6 @@
25#include <asm/cachetype.h> 25#include <asm/cachetype.h>
26#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
27 27
28#include "mm.h"
29
30void flush_cache_range(struct vm_area_struct *vma, unsigned long start, 28void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
31 unsigned long end) 29 unsigned long end)
32{ 30{
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 251e0824cd82..21c489bdeb4e 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -35,6 +35,7 @@
35#include <linux/dma-contiguous.h> 35#include <linux/dma-contiguous.h>
36#include <linux/efi.h> 36#include <linux/efi.h>
37#include <linux/swiotlb.h> 37#include <linux/swiotlb.h>
38#include <linux/vmalloc.h>
38 39
39#include <asm/boot.h> 40#include <asm/boot.h>
40#include <asm/fixmap.h> 41#include <asm/fixmap.h>
@@ -48,8 +49,6 @@
48#include <asm/tlb.h> 49#include <asm/tlb.h>
49#include <asm/alternative.h> 50#include <asm/alternative.h>
50 51
51#include "mm.h"
52
53/* 52/*
54 * 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
55 * that occur (potentially in generic code) before arm64_memblock_init() 54 * that occur (potentially in generic code) before arm64_memblock_init()
@@ -486,7 +485,12 @@ void free_initmem(void)
486{ 485{
487 free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)), 486 free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)),
488 0, "unused kernel"); 487 0, "unused kernel");
489 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));
490} 494}
491 495
492#ifdef CONFIG_BLK_DEV_INITRD 496#ifdef CONFIG_BLK_DEV_INITRD
diff --git a/arch/arm64/mm/mm.h b/arch/arm64/mm/mm.h
deleted file mode 100644
index 71fe98985455..000000000000
--- a/arch/arm64/mm/mm.h
+++ /dev/null
@@ -1,2 +0,0 @@
1
2void fixup_init(void);
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index e634a0f6d62b..05615a3fdc6f 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -43,8 +43,6 @@
43#include <asm/memblock.h> 43#include <asm/memblock.h>
44#include <asm/mmu_context.h> 44#include <asm/mmu_context.h>
45 45
46#include "mm.h"
47
48u64 idmap_t0sz = TCR_T0SZ(VA_BITS); 46u64 idmap_t0sz = TCR_T0SZ(VA_BITS);
49 47
50u64 kimage_voffset __ro_after_init; 48u64 kimage_voffset __ro_after_init;
@@ -400,16 +398,6 @@ void mark_rodata_ro(void)
400 section_size, PAGE_KERNEL_RO); 398 section_size, PAGE_KERNEL_RO);
401} 399}
402 400
403void fixup_init(void)
404{
405 /*
406 * Unmap the __init region but leave the VM area in place. This
407 * prevents the region from being reused for kernel modules, which
408 * is not supported by kallsyms.
409 */
410 unmap_kernel_range((u64)__init_begin, (u64)(__init_end - __init_begin));
411}
412
413static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end, 401static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end,
414 pgprot_t prot, struct vm_struct *vma) 402 pgprot_t prot, struct vm_struct *vma)
415{ 403{
diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c
index ae11d4e03d0e..371c5f03a170 100644
--- a/arch/arm64/mm/pgd.c
+++ b/arch/arm64/mm/pgd.c
@@ -26,8 +26,6 @@
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
28 28
29#include "mm.h"
30
31static struct kmem_cache *pgd_cache; 29static struct kmem_cache *pgd_cache;
32 30
33pgd_t *pgd_alloc(struct mm_struct *mm) 31pgd_t *pgd_alloc(struct mm_struct *mm)