Skip to contentSkip to conversation

riscv: mm: Remove setup_zero_page()

PATCH In review Jisheng Zhang 2 participants 2 messages May 7, 2021 – May 23, 2021 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: mm: Remove setup_zero_page()

The empty_zero_page sits at .bss..page_aligned section, so will be cleared to zero during clearing bss, we don't need to clear it again.

---

Hi Palmer,

This patch was one of v3 series of "riscv: improve self-protection" and acked by Anup. I checked Linus tree this tonight, it seems the v2 or v1 was merged, this patch is missing, so I rebased and sent out this patch. If it's late for linux-5.13, then I can rebase again once linux-5.13-rc1 is released.

Thanks in advance

 arch/riscv/mm/init.c | 6 ------
 1 file changed, 6 deletions(-)
arch/riscv/mm/init.c +0 -6
index dfb5e4f7a670..4a68b029e3d2 100644
@@ -67,11 +67,6 @@ static void __init zone_sizes_init(void)
 	free_area_init(max_zone_pfns);
 }
 
-static void __init setup_zero_page(void)
-{
-	memset((void *)empty_zero_page, 0, PAGE_SIZE);
-}
-
 #if defined(CONFIG_MMU) && defined(CONFIG_DEBUG_VM)
 static inline void print_mlk(char *name, unsigned long b, unsigned long t)
 {
@@ -862,7 +857,6 @@ RESERVEDMEM_OF_DECLARE(elfcorehdr, "linux,elfcorehdr", elfcore_hdr_setup);
 void __init paging_init(void)
 {
 	setup_vm_final();
-	setup_zero_page();
 }
 
 void __init misc_mem_init(void)
Signature · 8 lines
2.31.0



_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
maintainer
#1 lore raw
Quoted 37 lines · On Fri, 07 May 2021 07:19:59 PDT (-0700), [email protected] wrote:

The empty_zero_page sits at .bss..page_aligned section, so will be cleared to zero during clearing bss, we don't need to clear it again.

---

Hi Palmer,

This patch was one of v3 series of "riscv: improve self-protection" and acked by Anup. I checked Linus tree this tonight, it seems the v2 or v1 was merged, this patch is missing, so I rebased and sent out this patch. If it's late for linux-5.13, then I can rebase again once linux-5.13-rc1 is released.

Thanks in advance

 arch/riscv/mm/init.c | 6 ------
 1 file changed, 6 deletions(-)
arch/riscv/mm/init.c +0 -5
index dfb5e4f7a670..4a68b029e3d2 100644
@@ -67,11 +67,6 @@ static void __init zone_sizes_init(void)
 	free_area_init(max_zone_pfns);
 }
 
-static void __init setup_zero_page(void)
-{
-	memset((void *)empty_zero_page, 0, PAGE_SIZE);
-}
-
 #if defined(CONFIG_MMU) && defined(CONFIG_DEBUG_VM)
 static inline void print_mlk(char *name, unsigned long b, unsigned long t)
 {

arch/riscv/mm/init.c RESERVEDMEM_OF_DECLARE(elfcorehdr, "linux,elfcorehdr", elfcore_hdr_setup); · line 862

Quoted 7 lines
arch/riscv/mm/init.c +0 -1
@@ -862,7 +857,6 @@ RESERVEDMEM_OF_DECLARE(elfcorehdr, "linux,elfcorehdr", elfcore_hdr_setup);
 void __init paging_init(void)
 {
 	setup_vm_final();
-	setup_zero_page();
 }
 
 void __init misc_mem_init(void)

Sorry, I missed this one. It's on for-next now.