Skip to content

Commit dae8c23

Browse files
Kefeng Wangwildea01
authored andcommitted
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 <[email protected]> Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 282b879 commit dae8c23

File tree

5 files changed

+7
-21
lines changed

5 files changed

+7
-21
lines changed

arch/arm64/mm/flush.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include <asm/cachetype.h>
2626
#include <asm/tlbflush.h>
2727

28-
#include "mm.h"
29-
3028
void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
3129
unsigned long end)
3230
{

arch/arm64/mm/init.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/dma-contiguous.h>
3636
#include <linux/efi.h>
3737
#include <linux/swiotlb.h>
38+
#include <linux/vmalloc.h>
3839

3940
#include <asm/boot.h>
4041
#include <asm/fixmap.h>
@@ -48,8 +49,6 @@
4849
#include <asm/tlb.h>
4950
#include <asm/alternative.h>
5051

51-
#include "mm.h"
52-
5352
/*
5453
* We need to be able to catch inadvertent references to memstart_addr
5554
* that occur (potentially in generic code) before arm64_memblock_init()
@@ -486,7 +485,12 @@ void free_initmem(void)
486485
{
487486
free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)),
488487
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));
490494
}
491495

492496
#ifdef CONFIG_BLK_DEV_INITRD

arch/arm64/mm/mm.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

arch/arm64/mm/mmu.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#include <asm/memblock.h>
4444
#include <asm/mmu_context.h>
4545

46-
#include "mm.h"
47-
4846
u64 idmap_t0sz = TCR_T0SZ(VA_BITS);
4947

5048
u64 kimage_voffset __ro_after_init;
@@ -400,16 +398,6 @@ void mark_rodata_ro(void)
400398
section_size, PAGE_KERNEL_RO);
401399
}
402400

403-
void 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-
413401
static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end,
414402
pgprot_t prot, struct vm_struct *vma)
415403
{

arch/arm64/mm/pgd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include <asm/page.h>
2727
#include <asm/tlbflush.h>
2828

29-
#include "mm.h"
30-
3129
static struct kmem_cache *pgd_cache;
3230

3331
pgd_t *pgd_alloc(struct mm_struct *mm)

0 commit comments

Comments
 (0)