From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 797ABCA9EAF for ; Thu, 24 Oct 2019 15:36:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3FE0F20650 for ; Thu, 24 Oct 2019 15:36:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FE0F20650 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F1CC16B0266; Thu, 24 Oct 2019 11:36:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECA706B0269; Thu, 24 Oct 2019 11:36:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E09346B026A; Thu, 24 Oct 2019 11:36:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id B545E6B0266 for ; Thu, 24 Oct 2019 11:36:28 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 56A27181BC0A2 for ; Thu, 24 Oct 2019 15:36:28 +0000 (UTC) X-FDA: 76079080056.14.gold69_386dec514c215 X-HE-Tag: gold69_386dec514c215 X-Filterd-Recvd-Size: 3253 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Oct 2019 15:36:27 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCC1E1763; Tue, 22 Oct 2019 06:56:53 -0700 (PDT) Received: from [10.1.197.57] (e110467-lin.cambridge.arm.com [10.1.197.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A01083F71A; Tue, 22 Oct 2019 06:56:52 -0700 (PDT) Subject: Re: [PATCH V2] kernel: dma: contigous: Make CMA parameters __initdata/__initconst To: Shyam Saini , kernel-hardening@lists.openwall.com Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Marek Szyprowski , Matthew Wilcox , Christopher Lameter , Kees Cook References: <20191020050322.2634-1-mayhs11saini@gmail.com> From: Robin Murphy Message-ID: <1a358862-0c0c-e4c6-9dd7-f626c0a904b0@arm.com> Date: Tue, 22 Oct 2019 14:56:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20191020050322.2634-1-mayhs11saini@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 20/10/2019 06:03, Shyam Saini wrote: > These parameters are only referenced by __init routine calls during early > boot so they should be marked as __initdata and __initconst accordingly. Reviewed-by: Robin Murphy > Cc: Christoph Hellwig > Cc: Marek Szyprowski > Cc: Robin Murphy > Cc: Matthew Wilcox > Cc: Christopher Lameter > Cc: Kees Cook > Signed-off-by: Shyam Saini > --- > V1->V2: > mark cma parameters as __initdata/__initconst > instead of __ro_after_init. As these parameters > are only used by __init calls and never used afterwards > which contrast the __ro_after_init usage. > --- > kernel/dma/contiguous.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c > index 69cfb4345388..10bfc8c44c54 100644 > --- a/kernel/dma/contiguous.c > +++ b/kernel/dma/contiguous.c > @@ -42,10 +42,10 @@ struct cma *dma_contiguous_default_area; > * Users, who want to set the size of global CMA area for their system > * should use cma= kernel parameter. > */ > -static const phys_addr_t size_bytes = (phys_addr_t)CMA_SIZE_MBYTES * SZ_1M; > -static phys_addr_t size_cmdline = -1; > -static phys_addr_t base_cmdline; > -static phys_addr_t limit_cmdline; > +static const phys_addr_t size_bytes __initconst = (phys_addr_t)CMA_SIZE_MBYTES * SZ_1M; > +static phys_addr_t size_cmdline __initdata = -1; > +static phys_addr_t base_cmdline __initdata; > +static phys_addr_t limit_cmdline __initdata; > > static int __init early_cma(char *p) > { >