]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc: Define empty_zero_page[] in C
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 7 Jun 2021 10:56:04 +0000 (10:56 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Jun 2021 14:09:10 +0000 (00:09 +1000)
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 00d03ac84053 ("arm64: mm: place
empty_zero_page in bss") explains why it is interesting to have
it in BSS.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5838caffa269e0957c5a50cc85477876220298b0.1623063174.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/head_40x.S
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_8xx.S
arch/powerpc/kernel/head_book3s_32.S
arch/powerpc/kernel/head_fsl_booke.S
arch/powerpc/mm/mem.c

index 2717aa860cae5ad29f1150558dcd83d2d503d112..92b6c735616198e10913548f8cb9992bfc05cbc0 100644 (file)
@@ -709,10 +709,6 @@ _GLOBAL(abort)
        .align  12
        .globl  sdata
 sdata:
-       .globl  empty_zero_page
-empty_zero_page:
-       .space  4096
-EXPORT_SYMBOL(empty_zero_page)
        .globl  swapper_pg_dir
 swapper_pg_dir:
        .space  PGD_TABLE_SIZE
index 2c4ffec027a2c268f9e07e7d804a6f032d8a5e8b..e037eb6157579e0bd4e506c4d59edb153f72718a 100644 (file)
@@ -1241,10 +1241,6 @@ head_start_common:
        .align  PAGE_SHIFT
        .globl  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.
index ece7f97bafff6af74a2adddf7f35016db539a50c..730838c7ca39a0e8970509c2dfde8fa236c90724 100644 (file)
@@ -1012,8 +1012,3 @@ start_here_common:
        .globl  swapper_pg_dir
 swapper_pg_dir:
        .space  PGD_TABLE_SIZE
-
-       .globl  empty_zero_page
-empty_zero_page:
-       .space  PAGE_SIZE
-EXPORT_SYMBOL(empty_zero_page)
index 817df9fe7fb34d4e9e5dce22c11472fb0d9d3f77..5ce42dfac061ec70eb23e8f5054fb79f6f8e927c 100644 (file)
@@ -795,12 +795,6 @@ _GLOBAL(mmu_pin_tlb)
        .data
        .globl  sdata
 sdata:
-       .globl  empty_zero_page
-       .align  PAGE_SHIFT
-empty_zero_page:
-       .space  PAGE_SIZE
-EXPORT_SYMBOL(empty_zero_page)
-
        .globl  swapper_pg_dir
 swapper_pg_dir:
        .space  PGD_TABLE_SIZE
index 0b82672ff7a65ff3ab7355755c21edaff20b4095..59ddd68d60bfe51a951b76eed69b9e7ac89e8c1c 100644 (file)
@@ -1216,11 +1216,6 @@ setup_usbgecko_bat:
        .data
        .globl  sdata
 sdata:
-       .globl  empty_zero_page
-empty_zero_page:
-       .space  4096
-EXPORT_SYMBOL(empty_zero_page)
-
        .globl  swapper_pg_dir
 swapper_pg_dir:
        .space  PGD_TABLE_SIZE
index ab718fd5e2a26ddb15614256222862209b68820c..f33bc5a8e73ea3ae993e3a7a0448866c2af7451c 100644 (file)
@@ -1221,10 +1221,6 @@ _GLOBAL(restore_to_as0)
        .align  12
        .globl  sdata
 sdata:
-       .globl  empty_zero_page
-empty_zero_page:
-       .space  4096
-EXPORT_SYMBOL(empty_zero_page)
        .globl  swapper_pg_dir
 swapper_pg_dir:
        .space  PGD_TABLE_SIZE
index a6b36a40897ae20d4488b24b75ddb60b2c4eff3d..77fce7aa7dc55142f3b7cb419a30e924e1e1f973 100644 (file)
@@ -28,6 +28,9 @@
 unsigned long long memory_limit;
 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,
                              unsigned long size, pgprot_t vma_prot)
 {