Skip to content

Commit b4affec

Browse files
author
Fox Snowpatch
committed
1 parent 7170d5d commit b4affec

3 files changed

Lines changed: 4 additions & 20 deletions

File tree

arch/arm/include/asm/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* ZERO_PAGE is a global shared page that is always zero: used
1616
* for zero-mapped memory areas etc..
1717
*/
18-
extern struct page *empty_zero_page;
19-
#define ZERO_PAGE(vaddr) (empty_zero_page)
18+
extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
19+
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
2020
#endif
2121

2222
#include <asm-generic/pgtable-nopud.h>

arch/arm/mm/mmu.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern unsigned long __atags_pointer;
4545
* empty_zero_page is a special page that is used for
4646
* zero-initialized data and COW.
4747
*/
48-
struct page *empty_zero_page;
48+
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
4949
EXPORT_SYMBOL(empty_zero_page);
5050

5151
/*
@@ -1754,8 +1754,6 @@ static void __init early_fixmap_shutdown(void)
17541754
*/
17551755
void __init paging_init(const struct machine_desc *mdesc)
17561756
{
1757-
void *zero_page;
1758-
17591757
#ifdef CONFIG_XIP_KERNEL
17601758
/* Store the kernel RW RAM region start/end in these variables */
17611759
kernel_sec_start = CONFIG_PHYS_OFFSET & SECTION_MASK;
@@ -1781,13 +1779,7 @@ void __init paging_init(const struct machine_desc *mdesc)
17811779

17821780
top_pmd = pmd_off_k(0xffff0000);
17831781

1784-
/* allocate the zero page. */
1785-
zero_page = early_alloc(PAGE_SIZE);
1786-
17871782
bootmem_init();
1788-
1789-
empty_zero_page = virt_to_page(zero_page);
1790-
__flush_dcache_folio(NULL, page_folio(empty_zero_page));
17911783
}
17921784

17931785
void __init early_mm_init(const struct machine_desc *mdesc)

arch/arm/mm/nommu.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ unsigned long vectors_base;
3131
* empty_zero_page is a special page that is used for
3232
* zero-initialized data and COW.
3333
*/
34-
struct page *empty_zero_page;
34+
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
3535
EXPORT_SYMBOL(empty_zero_page);
3636

3737
#ifdef CONFIG_ARM_MPU
@@ -156,18 +156,10 @@ void __init adjust_lowmem_bounds(void)
156156
*/
157157
void __init paging_init(const struct machine_desc *mdesc)
158158
{
159-
void *zero_page;
160-
161159
early_trap_init((void *)vectors_base);
162160
mpu_setup();
163161

164-
/* allocate the zero page. */
165-
zero_page = (void *)memblock_alloc_or_panic(PAGE_SIZE, PAGE_SIZE);
166-
167162
bootmem_init();
168-
169-
empty_zero_page = virt_to_page(zero_page);
170-
flush_dcache_page(empty_zero_page);
171163
}
172164

173165
/*

0 commit comments

Comments
 (0)