Commit 45b30faf authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc: Define empty_zero_page[] in C

At the time being, empty_zero_page[] is defined in each
platform head.S.

Define it in mm/mem.c instead, and put it in BSS section instead
of the DATA section. Commit 5227cfa7 ("arm64: mm: place
empty_zero_page in bss") explains why it is interesting to have
it in BSS.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5838caffa269e0957c5a50cc85477876220298b0.1623063174.git.christophe.leroy@csgroup.eu
parent a1ea0ca8
...@@ -709,10 +709,6 @@ _GLOBAL(abort) ...@@ -709,10 +709,6 @@ _GLOBAL(abort)
.align 12 .align 12
.globl sdata .globl sdata
sdata: sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir .globl swapper_pg_dir
swapper_pg_dir: swapper_pg_dir:
.space PGD_TABLE_SIZE .space PGD_TABLE_SIZE
...@@ -1241,10 +1241,6 @@ head_start_common: ...@@ -1241,10 +1241,6 @@ head_start_common:
.align PAGE_SHIFT .align PAGE_SHIFT
.globl sdata .globl sdata
sdata: sdata:
.globl empty_zero_page
empty_zero_page:
.space PAGE_SIZE
EXPORT_SYMBOL(empty_zero_page)
/* /*
* To support >32-bit physical addresses, we use an 8KB pgdir. * To support >32-bit physical addresses, we use an 8KB pgdir.
......
...@@ -1012,8 +1012,3 @@ start_here_common: ...@@ -1012,8 +1012,3 @@ start_here_common:
.globl swapper_pg_dir .globl swapper_pg_dir
swapper_pg_dir: swapper_pg_dir:
.space PGD_TABLE_SIZE .space PGD_TABLE_SIZE
.globl empty_zero_page
empty_zero_page:
.space PAGE_SIZE
EXPORT_SYMBOL(empty_zero_page)
...@@ -795,12 +795,6 @@ _GLOBAL(mmu_pin_tlb) ...@@ -795,12 +795,6 @@ _GLOBAL(mmu_pin_tlb)
.data .data
.globl sdata .globl sdata
sdata: sdata:
.globl empty_zero_page
.align PAGE_SHIFT
empty_zero_page:
.space PAGE_SIZE
EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir .globl swapper_pg_dir
swapper_pg_dir: swapper_pg_dir:
.space PGD_TABLE_SIZE .space PGD_TABLE_SIZE
...@@ -1216,11 +1216,6 @@ setup_usbgecko_bat: ...@@ -1216,11 +1216,6 @@ setup_usbgecko_bat:
.data .data
.globl sdata .globl sdata
sdata: sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir .globl swapper_pg_dir
swapper_pg_dir: swapper_pg_dir:
.space PGD_TABLE_SIZE .space PGD_TABLE_SIZE
...@@ -1221,10 +1221,6 @@ _GLOBAL(restore_to_as0) ...@@ -1221,10 +1221,6 @@ _GLOBAL(restore_to_as0)
.align 12 .align 12
.globl sdata .globl sdata
sdata: sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir .globl swapper_pg_dir
swapper_pg_dir: swapper_pg_dir:
.space PGD_TABLE_SIZE .space PGD_TABLE_SIZE
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
unsigned long long memory_limit; unsigned long long memory_limit;
bool init_mem_is_free; bool init_mem_is_free;
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
EXPORT_SYMBOL(empty_zero_page);
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot) unsigned long size, pgprot_t vma_prot)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment