Message ID | 20210413001159.341a95d6@xhacker (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | riscv: improve self-protection | expand |
On Mon, Apr 12, 2021 at 9:47 PM Jisheng Zhang <jszhang3@mail.ustc.edu.cn> wrote: > > From: Jisheng Zhang <jszhang@kernel.org> > > 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. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Looks good to me. Reviewed-by: Anup Patel <anup@brainfault.org> Regards, Anup > --- > arch/riscv/mm/init.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 7f5036fbee8c..dbeaa4144e4d 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -57,11 +57,6 @@ static void __init zone_sizes_init(void) > free_area_init(max_zone_pfns); > } > > -static void 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) > { > @@ -589,7 +584,6 @@ void mark_rodata_ro(void) > void __init paging_init(void) > { > setup_vm_final(); > - setup_zero_page(); > } > > void __init misc_mem_init(void) > -- > 2.31.0 > >
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 7f5036fbee8c..dbeaa4144e4d 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -57,11 +57,6 @@ static void __init zone_sizes_init(void) free_area_init(max_zone_pfns); } -static void 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) { @@ -589,7 +584,6 @@ void mark_rodata_ro(void) void __init paging_init(void) { setup_vm_final(); - setup_zero_page(); } void __init misc_mem_init(void)