Skip to content

Commit 45b30fa

Browse files
chleroympe
authored andcommitted
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 5227cfa ("arm64: mm: place empty_zero_page in bss") explains why it is interesting to have it in BSS. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/5838caffa269e0957c5a50cc85477876220298b0.1623063174.git.christophe.leroy@csgroup.eu
1 parent a1ea0ca commit 45b30fa

File tree

7 files changed

+3
-28
lines changed

7 files changed

+3
-28
lines changed

arch/powerpc/kernel/head_40x.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,6 @@ _GLOBAL(abort)
709709
.align 12
710710
.globl sdata
711711
sdata:
712-
.globl empty_zero_page
713-
empty_zero_page:
714-
.space 4096
715-
EXPORT_SYMBOL(empty_zero_page)
716712
.globl swapper_pg_dir
717713
swapper_pg_dir:
718714
.space PGD_TABLE_SIZE

arch/powerpc/kernel/head_44x.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,10 +1241,6 @@ head_start_common:
12411241
.align PAGE_SHIFT
12421242
.globl sdata
12431243
sdata:
1244-
.globl empty_zero_page
1245-
empty_zero_page:
1246-
.space PAGE_SIZE
1247-
EXPORT_SYMBOL(empty_zero_page)
12481244

12491245
/*
12501246
* To support >32-bit physical addresses, we use an 8KB pgdir.

arch/powerpc/kernel/head_64.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,3 @@ start_here_common:
10121012
.globl swapper_pg_dir
10131013
swapper_pg_dir:
10141014
.space PGD_TABLE_SIZE
1015-
1016-
.globl empty_zero_page
1017-
empty_zero_page:
1018-
.space PAGE_SIZE
1019-
EXPORT_SYMBOL(empty_zero_page)

arch/powerpc/kernel/head_8xx.S

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,6 @@ _GLOBAL(mmu_pin_tlb)
795795
.data
796796
.globl sdata
797797
sdata:
798-
.globl empty_zero_page
799-
.align PAGE_SHIFT
800-
empty_zero_page:
801-
.space PAGE_SIZE
802-
EXPORT_SYMBOL(empty_zero_page)
803-
804798
.globl swapper_pg_dir
805799
swapper_pg_dir:
806800
.space PGD_TABLE_SIZE

arch/powerpc/kernel/head_book3s_32.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,11 +1216,6 @@ setup_usbgecko_bat:
12161216
.data
12171217
.globl sdata
12181218
sdata:
1219-
.globl empty_zero_page
1220-
empty_zero_page:
1221-
.space 4096
1222-
EXPORT_SYMBOL(empty_zero_page)
1223-
12241219
.globl swapper_pg_dir
12251220
swapper_pg_dir:
12261221
.space PGD_TABLE_SIZE

arch/powerpc/kernel/head_fsl_booke.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,10 +1221,6 @@ _GLOBAL(restore_to_as0)
12211221
.align 12
12221222
.globl sdata
12231223
sdata:
1224-
.globl empty_zero_page
1225-
empty_zero_page:
1226-
.space 4096
1227-
EXPORT_SYMBOL(empty_zero_page)
12281224
.globl swapper_pg_dir
12291225
swapper_pg_dir:
12301226
.space PGD_TABLE_SIZE

arch/powerpc/mm/mem.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
unsigned long long memory_limit;
2929
bool init_mem_is_free;
3030

31+
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
32+
EXPORT_SYMBOL(empty_zero_page);
33+
3134
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
3235
unsigned long size, pgprot_t vma_prot)
3336
{

0 commit comments

Comments
 (0)