Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4130711imm; Tue, 29 May 2018 23:00:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIht+FCj+0w8R4wtQOqhxlOnzZQ3IvZR9BomYb379IH3whVLfdhslgQc3cB2rGalsOZr3Es X-Received: by 2002:a63:bf0c:: with SMTP id v12-v6mr1127920pgf.18.1527660016126; Tue, 29 May 2018 23:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527660016; cv=none; d=google.com; s=arc-20160816; b=qfeGGMBEc0sdCyF/BHXHaeh+ocao4iMUeBufULq3n8uSDmtKVzKNjArBuSJbpO1Awe rV2lWUV3VIhcQ1qqWMDqJr0KqRn/fZsjNHiuQ0FoZ1Ia7GJMCh7cjxrkmfEmedcMEd6e wZB8flI+1R5lset+fObXm3Yu1k9UHs01j1cff57sfumcrofadrN2ufV+t0pNwHk/sLbh TMJleojm/bcI3uLbAx96jLxVqQvl2TGgUb9f7jQlsxdxwQQFRRaGcL+7oxoMDD1Y2eRE /R68IOd0MCHhyCfpBvAnhIEUwA58Y42JCwxA51ILijyxCroZDvAxJSv97qKF7JgVsVtA Zs/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ZQJiFe4eIwLh+izde5RNrOI8sLEzgCBqVtMpdCMTWnk=; b=rV/ItEfHdnBwPayfHeOM6RjP+wOTSOezzZr/D1M0Xg+f5aR4E4eXdhKqvlC7SF4iOH Egu9rVUOtqbUjb/PMqa9RPIb4QDx0Kw8Ls1SHm4kjNDKURYulQdM6w9RqoCFjWuGrj0p 81qsLxdRyV0w1xLBZUvaUDEeT4Pqf28ZWyZc6QC1k2FIwbqzdWMs87pI1wPmT02cUd8z I3rwSNibewznKR+SVEFwJ6V3BKLfIkzQ3zdWXc9pjAP+YACf/meIHzH6M9919EhUOQV4 Di/C2SwV8teYOY/0HUyIqFuZMa+L0nmcoIWZJl7XbVxZvaC8giTW486jVXFHbzd4Wj2c Eueg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vZZnn8lP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si9257541pgb.588.2018.05.29.23.00.02; Tue, 29 May 2018 23:00:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vZZnn8lP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935721AbeE3F6W (ORCPT + 99 others); Wed, 30 May 2018 01:58:22 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:39333 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933788AbeE3F6U (ORCPT ); Wed, 30 May 2018 01:58:20 -0400 Received: by mail-wm0-f65.google.com with SMTP id f8-v6so45409865wmc.4; Tue, 29 May 2018 22:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZQJiFe4eIwLh+izde5RNrOI8sLEzgCBqVtMpdCMTWnk=; b=vZZnn8lPeyjS1TK54BoNUl0JGB4Al+G+QMZDprj5TACaa8av5UYu9NEvKNh3hmJcnA a8p6jtPRvagqyQvjMTItBjq3O7xYzgcALFP7gzgg98isAs69chnxXbSB1qVWUcwB9hqN 5AATBRZ8i98hOQAKTX495fwolCQ+rbnYtKofOZfyZMZCRvrw7uJYyG7pu3ErwSpMOaMZ MXLZDC74JNVF0M5s8h6ymJJIaLT87YJCOWNj0uuy5t9mfUUog7RGPYU2H0BI/FhJmqi5 uSn76FmiVjFrUSV2JuIMEnvx6czCoQ6Yz8GG7zzxihTQ/wqAm/8d4LYsyiCqBoCJgcfI MoaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ZQJiFe4eIwLh+izde5RNrOI8sLEzgCBqVtMpdCMTWnk=; b=hjSuqKLDXDsas14y5n7u/3irc1Pn6LoPcAs8Dl8XL7YwnS85jmYQmphzUgYIUxKFM2 yUPIcCmr3fJDohbXLe4nMDs0ifWDCcGi5F9kDtZKSpPUmuq3bRtRa/eICohZf74QZxjx fAntfxQ7Rb3YlaDR6RfYrJ+sL5AONdio3wn2B+2mZWv00U8dxok4EZy1DtFUAq1YlUxs 7V6kESEeHggs1Q6WEa461ebu4caaS1cCP2PIKX+r7EpKBeZToWTBoi3OEO04gwf7peKw 7wClvjQTlr2DsZQ4/ikZjhSfa+4xnU2UoNnthHaPkKiShl3q41PYpVEhJlJxWV9Yd6Nv kXRw== X-Gm-Message-State: ALKqPwcNVGgJ/M1StSQM2wPakgk5mlRZ7KbG9BFRdNV3vHYXig2d0QfR cAvp6ufxI7SwowQfLrgAymA= X-Received: by 2002:a1c:9249:: with SMTP id u70-v6mr361454wmd.128.1527659899192; Tue, 29 May 2018 22:58:19 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id b185-v6sm15017385wmb.25.2018.05.29.22.58.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 22:58:18 -0700 (PDT) Date: Wed, 30 May 2018 07:58:15 +0200 From: Ingo Molnar To: nixiaoming Cc: catalin.marinas@arm.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, james.morse@arm.com, kristina.martsenko@arm.com, steve.capper@arm.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, akpm@linux-foundation.org, vbabka@suse.cz, mhocko@suse.com, dave.hansen@linux.intel.com, dan.j.williams@intel.com, kirill.shutemov@linux.intel.com, zhang.jia@linux.alibaba.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH 2/3] x86:add missing CONFIG_STRICT_KERNEL_RWX for mark_rodata_ro Message-ID: <20180530055815.GB6463@gmail.com> References: <20180529133622.26982-1-nixiaoming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180529133622.26982-1-nixiaoming@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * nixiaoming wrote: > mark_rodata_ro is only called by the function mark_readonly > when CONFIG_STRICT_KERNEL_RWX=y > > if CONFIG_STRICT_KERNEL_RWX is not set > a compile warning may be triggered: unused function > > Signed-off-by: nixiaoming > --- > arch/x86/mm/init_32.c | 2 ++ > arch/x86/mm/init_64.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c > index c893c6a..121c567 100644 > --- a/arch/x86/mm/init_32.c > +++ b/arch/x86/mm/init_32.c > @@ -920,6 +920,7 @@ static void mark_nxdata_nx(void) > set_pages_nx(virt_to_page(start), size >> PAGE_SHIFT); > } > > +#ifdef CONFIG_STRICT_KERNEL_RWX > void mark_rodata_ro(void) > { > unsigned long start = PFN_ALIGN(_text); > @@ -957,3 +958,4 @@ void mark_rodata_ro(void) > if (__supported_pte_mask & _PAGE_NX) > debug_checkwx(); > } > +#endif /*end of CONFIG_STRICT_KERNEL_RWX*/ > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index 0a40060..1b7a1a7 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -1245,6 +1245,7 @@ void set_kernel_text_ro(void) > set_memory_ro(start, (end - start) >> PAGE_SHIFT); > } > > +#ifdef CONFIG_STRICT_KERNEL_RWX > void mark_rodata_ro(void) > { > unsigned long start = PFN_ALIGN(_text); > @@ -1298,6 +1299,7 @@ void mark_rodata_ro(void) > */ > pti_clone_kernel_text(); > } > +#endif NAK, this is very ugly and the changelog doesn't appear to be true: the build warning does not trigger in the default build, correct? Thanks, Ingo