Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1002814pxf; Thu, 1 Apr 2021 21:08:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR84T5Dc2WvzxXVZ9GC74sce2hSlhQFfCk8Kgdj1jzSO1wjPZQydp2WWZgQpmp3U/03s4J X-Received: by 2002:a92:6e0e:: with SMTP id j14mr9458437ilc.90.1617336525456; Thu, 01 Apr 2021 21:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617336525; cv=none; d=google.com; s=arc-20160816; b=FeSXm8T1WFjAkwmKgxS4uj5TTFTkopPL5T6lfja8SrPpWV16tBzUCL4UxtOTReMYYo Ewdwndx8sJJcXXnKsQdrRuKvkJGIBOg1Y2bOn6p5BY0tpLf+oC0ZJSDkhBoXvRAhI/+m cWjyVQCF2zfTTsm4zGFKj5pZV11Vbpu2YFMlRpAb9bp3lrK0wGv79k3fj3acXaIX56hm d7DVw35C87N19UVMk9+J7Tx8Z67scDTNQ/SLrSbU5+2vdNcZAnXuIFDhGiRBjHO+NUmr NCFOCP7EDI80YdsoeziC0fnycVJX+YnYWFM0s04zvuCST0QwFN+NmFHffhkb35/uanT/ IeYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=r29s2NuB4h8xDuoc4V2TUkw3k2SQOmwLpoFzxMpsSfU=; b=nVKOPat7hU0HaiVtqHSVoOqB3EQu9vNjnhsDFutBbPzw6nJzQVcPqxTHAuvv4hE0dW o5kley4sDLBVbJhSuasTZYt2hA2bpCgEKb64yE+etpUz1w0B2eZzXZkkSrfspsv2IMw8 Mu63FVAV/va2dOoPwM+tloOGO7kmOFekjNo4KNrURjq+Q7xs4av9eBUhZUG1YegSfR93 7AsmM3ewAg3Z6admfTO9Atk86oQvgLqpEYBiR8UKmt2mRlkPDNKZuuDejluucESBtX9G 3eDw+D9hIx6weQkRtw7Nf2i+1xg6EqCVe+kJD0oAJN0mCWboYmmQPmokSVyK217IXaT0 MbCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=uO9cVaFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si7230866ilg.92.2021.04.01.21.08.31; Thu, 01 Apr 2021 21:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=uO9cVaFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbhDBEIQ (ORCPT + 99 others); Fri, 2 Apr 2021 00:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhDBEIP (ORCPT ); Fri, 2 Apr 2021 00:08:15 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 445CFC06178A for ; Thu, 1 Apr 2021 21:08:15 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so1811340wmj.2 for ; Thu, 01 Apr 2021 21:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r29s2NuB4h8xDuoc4V2TUkw3k2SQOmwLpoFzxMpsSfU=; b=uO9cVaFbcLWG2qSj/V5Qkp9SImi/1O/PNF5uCdkXCUUYZJA9vpqlZt2zRX/qXJ+oah rO4VamcAG68UI6cC43pmYE6l2QOlTbqrFGjbSxNuXrWd/OtmqO6rMnqhxjBVRyqFyxlC OUKieCjk5HQ7Tftt13rMzjeAfydRy7xK+3jCFtWg8v5ll3hzus2DVE8HIb+pwdbsI7yC QVCqXkHxo8PllGMMtIKKFuW4k/d3AriUj05NbOe4teBaYbR9X2E74zD2YaXYDn5M4r7L PIglkR+DonJicpVCPf6bYjXpdXpqh5F3TGvDZnH7i+ffnm5eBtVnpMfc7h/1w6E2v96N XOog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r29s2NuB4h8xDuoc4V2TUkw3k2SQOmwLpoFzxMpsSfU=; b=YjokvyaWnNxoE9nvruHsNAsikSSpdUtiWfAUF67Lz2fe1Bjgz/nH+xXoqF9kcs4VOi wfFl5YSDE12XDJgacy53gVirwdpneCPV2M4anUGCcs3CG9VF3exDsKivQqlV54Y15GnE OHw6XT514VQir2KBXxNyJeMUiZe9A5/qb9FE1hLRZPTyaLckzSes4grPJYuUTfp/kdBw VwvXvrfvN2w02dPeLc7ywaOOVucPNQWsAV/aLV5WQO0Moh8rNnURhscNoUgyUoktaWVl KmiapeSBlMwBCbl8gU/NVgIIPHWMtlSBg/sO2z0hYoNlIsnnKC4N2sUXcJmkzd/H7MW7 G8ww== X-Gm-Message-State: AOAM531aT1Z0hgwYK3GufmxnU1CFXYRxJnMtqwjyUvYX4x457XYa5kiL 67VVeBHieCKMWy+J+HuF7/udayvgy4/qzucv2xT3IQ== X-Received: by 2002:a05:600c:9:: with SMTP id g9mr11022806wmc.134.1617336493632; Thu, 01 Apr 2021 21:08:13 -0700 (PDT) MIME-Version: 1.0 References: <20210401002442.2fe56b88@xhacker> <20210401002518.5cf48e91@xhacker> In-Reply-To: <20210401002518.5cf48e91@xhacker> From: Anup Patel Date: Fri, 2 Apr 2021 09:38:02 +0530 Message-ID: Subject: Re: [PATCH v2 1/9] riscv: add __init section marker to some functions To: Jisheng Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Luke Nelson , Xi Wang , linux-riscv , "linux-kernel@vger.kernel.org List" , kasan-dev@googlegroups.com, netdev@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 10:00 PM Jisheng Zhang wrote: > > From: Jisheng Zhang > > They are not needed after booting, so mark them as __init to move them > to the __init section. > > Signed-off-by: Jisheng Zhang > --- > arch/riscv/kernel/traps.c | 2 +- > arch/riscv/mm/init.c | 6 +++--- > arch/riscv/mm/kasan_init.c | 6 +++--- > arch/riscv/mm/ptdump.c | 2 +- > 4 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c > index 1357abf79570..07fdded10c21 100644 > --- a/arch/riscv/kernel/traps.c > +++ b/arch/riscv/kernel/traps.c > @@ -197,6 +197,6 @@ int is_valid_bugaddr(unsigned long pc) > #endif /* CONFIG_GENERIC_BUG */ > > /* stvec & scratch is already set from head.S */ > -void trap_init(void) > +void __init trap_init(void) > { > } The trap_init() is unused currently so you can drop this change and remove trap_init() as a separate patch. > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 067583ab1bd7..76bf2de8aa59 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -57,7 +57,7 @@ static void __init zone_sizes_init(void) > free_area_init(max_zone_pfns); > } > > -static void setup_zero_page(void) > +static void __init setup_zero_page(void) > { > memset((void *)empty_zero_page, 0, PAGE_SIZE); > } > @@ -75,7 +75,7 @@ static inline void print_mlm(char *name, unsigned long b, unsigned long t) > (((t) - (b)) >> 20)); > } > > -static void print_vm_layout(void) > +static void __init print_vm_layout(void) > { > pr_notice("Virtual kernel memory layout:\n"); > print_mlk("fixmap", (unsigned long)FIXADDR_START, > @@ -557,7 +557,7 @@ static inline void setup_vm_final(void) > #endif /* CONFIG_MMU */ > > #ifdef CONFIG_STRICT_KERNEL_RWX > -void protect_kernel_text_data(void) > +void __init protect_kernel_text_data(void) > { > unsigned long text_start = (unsigned long)_start; > unsigned long init_text_start = (unsigned long)__init_text_begin; > diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c > index 4f85c6d0ddf8..e1d041ac1534 100644 > --- a/arch/riscv/mm/kasan_init.c > +++ b/arch/riscv/mm/kasan_init.c > @@ -60,7 +60,7 @@ asmlinkage void __init kasan_early_init(void) > local_flush_tlb_all(); > } > > -static void kasan_populate_pte(pmd_t *pmd, unsigned long vaddr, unsigned long end) > +static void __init kasan_populate_pte(pmd_t *pmd, unsigned long vaddr, unsigned long end) > { > phys_addr_t phys_addr; > pte_t *ptep, *base_pte; > @@ -82,7 +82,7 @@ static void kasan_populate_pte(pmd_t *pmd, unsigned long vaddr, unsigned long en > set_pmd(pmd, pfn_pmd(PFN_DOWN(__pa(base_pte)), PAGE_TABLE)); > } > > -static void kasan_populate_pmd(pgd_t *pgd, unsigned long vaddr, unsigned long end) > +static void __init kasan_populate_pmd(pgd_t *pgd, unsigned long vaddr, unsigned long end) > { > phys_addr_t phys_addr; > pmd_t *pmdp, *base_pmd; > @@ -117,7 +117,7 @@ static void kasan_populate_pmd(pgd_t *pgd, unsigned long vaddr, unsigned long en > set_pgd(pgd, pfn_pgd(PFN_DOWN(__pa(base_pmd)), PAGE_TABLE)); > } > > -static void kasan_populate_pgd(unsigned long vaddr, unsigned long end) > +static void __init kasan_populate_pgd(unsigned long vaddr, unsigned long end) > { > phys_addr_t phys_addr; > pgd_t *pgdp = pgd_offset_k(vaddr); > diff --git a/arch/riscv/mm/ptdump.c b/arch/riscv/mm/ptdump.c > index ace74dec7492..3b7b6e4d025e 100644 > --- a/arch/riscv/mm/ptdump.c > +++ b/arch/riscv/mm/ptdump.c > @@ -331,7 +331,7 @@ static int ptdump_show(struct seq_file *m, void *v) > > DEFINE_SHOW_ATTRIBUTE(ptdump); > > -static int ptdump_init(void) > +static int __init ptdump_init(void) > { > unsigned int i, j; > > -- > 2.31.0 > > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Apart from above, looks good to me. Reviewed-by: Anup Patel Regards, Anup