Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3270033ybz; Sun, 3 May 2020 22:41:27 -0700 (PDT) X-Google-Smtp-Source: APiQypKLqgumsMpOETPyBYGXa0HLSR1iaXf+PiosMYpcqcq3arxOOMUkrUU3P/hVuC62AnMwuad7 X-Received: by 2002:a17:906:cf8a:: with SMTP id um10mr13106977ejb.60.1588570887574; Sun, 03 May 2020 22:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588570887; cv=none; d=google.com; s=arc-20160816; b=Qbj/H0IbrDxsZMojrPfqJNiWPwn+Y1Zg8RqLGinfAlJOjmaJS+DQoF7ahN0okFZGq6 DhsReTqk2pSGTAy7WDC0fj7rCZPukn0gQpqj6nc64trl+o9vDynmEpOMBP0dxGiRJReE s9ta6vS1FgT56s3S/MNKbWax6psSH/785kIG1BHLjqHjAo/Jyo7046RhJRW82ez0dDXc bDv8sDnI7+VHy5xXCNMGSTl6qhFgk8U3mXhMPShXZQ8Mv2VdBr3wFZca7snL42vEFpO9 BTO90HyMrwubG9HwI+v4hPyKEgJEEkcGG/0MifkKbVFBFmkMN7WY5U+5083PNT9Qx/8x lj6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uEr7VDGO1sQzOvtIGcTs52hYhp3KlihYjjFwOGOE52E=; b=Jwhhkq9TRusLHWpiko27VwrdUA0nv2Sb/R6Vd+O17Qn0rXUdN0jdHoEDwIOMng7dY5 eUNjpP8s5Q0URC6vLZ/3VsM4x8hJTGObRuVbDrOMhgVE04xv1naZHw4Vbd3pmFlP0BAU 2Egfgs7M4isKeY4ZAfhwkR/LVL0ZSsNez0G33yaU0doWDAXnj+kTFGi9j2xPpgD993dz S2LY1mGnF2yPPy0S+Jr6OvCFvbyKG9GRrq9RVAPdbphC9GBaFx18uWA9HnSGzljhDim9 9rGGHYVWAp6Xl7yXfdV3JoCl7Ag6c2I/6GwY1nwpUwggRhdVkQL62qdQxeGgDaNDjDx9 zmQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=AnMCjUrc; 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 pj27si6718123ejb.196.2020.05.03.22.41.03; Sun, 03 May 2020 22:41:27 -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=@sifive.com header.s=google header.b=AnMCjUrc; 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 S1726974AbgEDFg4 (ORCPT + 99 others); Mon, 4 May 2020 01:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725859AbgEDFg4 (ORCPT ); Mon, 4 May 2020 01:36:56 -0400 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C50DC061A0E for ; Sun, 3 May 2020 22:36:56 -0700 (PDT) Received: by mail-oi1-x244.google.com with SMTP id r66so5695566oie.5 for ; Sun, 03 May 2020 22:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uEr7VDGO1sQzOvtIGcTs52hYhp3KlihYjjFwOGOE52E=; b=AnMCjUrc0dEBsDtyieZcjRyaWh1ZyG7DB345/RKRwunS9IbLIl18twCJWYDSN1f092 M+39bCI4yvuMpohhu1PNnD5u4xGLJkdXBH8HGV9aN3NKRyM+x7PhL2wqb7fUdEqfSp2G EMFjB0nmBOpmz1FQ5lOB6Gg0RlZuz5dTYZYSHUfdX2CjGWT8Bn11GpCCF6FGOWIzLVlQ 1mJ/ECtrVccBsw+S6DXsG6y0VmYSx8lOQyhEHD/s8//lfppknEQzqLzgvY59saAigEbN 4+3P9sKuuzp5/wijfK1HjOZXqjJmmXFr/GsS8M0DI4H2KfG8Wfq/9ZYAQ5NRQlK/BuGf kvfg== 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=uEr7VDGO1sQzOvtIGcTs52hYhp3KlihYjjFwOGOE52E=; b=akdyaiWDB/1sb6inxCqFcDrzEQUZJFIUcxq68Rdc+fRNMCXTq0OXV4EW0NE+VACHnD +3+Vxizo2OKwh/yPjEGkFX9Q/It8/ivGcLKW0b8GJplhz65szAfVLkDyZ/BRPCkOBG7g Tt3aU71x/LDjVj8z0uCRsyxv2OqvM31y5NWa/zi/K2eGU+4lfOcW6eRWtnWMgeOn9YO6 U/N9wnQvarq+/epq1qNVXJ0KWd7RI4YUXM5eK8IlOqkOiSi0e23/wECXUpvtiykz4CGg Fj5zEAbNsqL3JmTweEat91bRm/hoWHbCkTzYhR0dDR5LMcuQUnwTTM6HELP1B15xDj2n DIdg== X-Gm-Message-State: AGi0PuYb85jJM0oi9rNuVx81jGvmOimI7lcV0DLvHhclGSGiHFwAMkwz 7IL8RtQcl6Hj2l6lwpqE4mIvj9PQnoOuX5X+G+U90Q== X-Received: by 2002:aca:c78d:: with SMTP id x135mr7835649oif.91.1588570614459; Sun, 03 May 2020 22:36:54 -0700 (PDT) MIME-Version: 1.0 References: <20200504040319.31423-1-atish.patra@wdc.com> In-Reply-To: <20200504040319.31423-1-atish.patra@wdc.com> From: Zong Li Date: Mon, 4 May 2020 13:36:43 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: Remove unused code from STRICT_KERNEL_RWX To: Atish Patra Cc: "linux-kernel@vger.kernel.org List" , Albert Ou , Anup Patel , linux-riscv , Palmer Dabbelt , Paul Walmsley Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 4, 2020 at 12:04 PM Atish Patra wrote: > > This patch removes the unused functions set_kernel_text_rw/ro. > Currently, it is not being invoked from anywhere and no other architecture > (except arm) uses this code. Even in ARM, these functions are not invoked > from anywhere currently. > > Fixes: d27c3c90817e ("riscv: add STRICT_KERNEL_RWX support") > > Signed-off-by: Atish Patra > --- > arch/riscv/mm/init.c | 16 ---------------- > 1 file changed, 16 deletions(-) > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index b55be44ff9bd..ba60a581e9b6 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -501,22 +501,6 @@ static inline void setup_vm_final(void) > #endif /* CONFIG_MMU */ > > #ifdef CONFIG_STRICT_KERNEL_RWX > -void set_kernel_text_rw(void) > -{ > - unsigned long text_start = (unsigned long)_text; > - unsigned long text_end = (unsigned long)_etext; > - > - set_memory_rw(text_start, (text_end - text_start) >> PAGE_SHIFT); > -} > - > -void set_kernel_text_ro(void) > -{ > - unsigned long text_start = (unsigned long)_text; > - unsigned long text_end = (unsigned long)_etext; > - > - set_memory_ro(text_start, (text_end - text_start) >> PAGE_SHIFT); > -} > - > void mark_rodata_ro(void) > { > unsigned long text_start = (unsigned long)_text; > -- > 2.26.2 > Looks good to me. Thanks. Reviewed-by: Zong Li