Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1278471ybj; Tue, 5 May 2020 17:02:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJQjwThpUWCYif5GLicXj+F6nub3MxY/SBvg/2RjTtfT1ZYlpc9CMEIT4LMMiBAxMI5njDs X-Received: by 2002:a50:f058:: with SMTP id u24mr4489326edl.171.1588723365906; Tue, 05 May 2020 17:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588723365; cv=none; d=google.com; s=arc-20160816; b=eXHWDI+mix/QI9XfXzQ8af/0tyVYSdTWgcqLfnkvh07pLNiQ5iByp0Tvfz5VmOX8JL E1KBEJxLaWJP8/VMeeb/X0Tkkz8SNW7Dbpb6hNkjjeT270uSjkzvXFsCkm+IRm9CE+Wf gsPGS+LpgVzq6domoZsrnsdV5XSXYq2OcLk9eQUR9pXXrsXk40SRKEce4FtYw+iEC7Jq JBsxi8frCzu0oMFrHjqjZmpa9XtgS1xZzWrsGJQJ419AldkV7VRbR9fmVYLOor/CLRXX wXwlicgBQzEzeHzyBhZcshuRUBeJNWatq689AvuRiG0UgY7va+Lt1y99pdCENt17APgs kfsA== 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=3iD14m2oqtz2m5olanAMCvHCDcEx9U6emVEbdAioaj8=; b=gHBIGKnBdb1P/k+JHPsmhfN9TuuP0ASXLnKu9VyWtHOZ7ZHcMINKTRRpYu27683RLa phDooOFwBXkPw65W1tWQoffjgc5F626d1fJhjGqHUv/tGj131rPxOVPX+fDNh/A842bb oyENqvX5j+BnPxfDR33RRITm0Wkaql94K5Nct2++Ff8buHXMrmXa42f9kX1Gid3yVo/E BcUPUX6qYYlVimDq9+jHxpXbuE8jLfX7jkOrqhlZBPvMwXrfFEsJTnCZFAvC1QAgPReZ 4E74kFWIakO3eny7cluwD9SObt0gox+OSMHqy3wGVjUi34NtIaaSS0y8PBxKtVijqq0L x/nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b="nSJZu/Fo"; 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 r11si54048edq.390.2020.05.05.17.02.23; Tue, 05 May 2020 17:02: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=@atishpatra.org header.s=google header.b="nSJZu/Fo"; 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 S1729636AbgEFAAT (ORCPT + 99 others); Tue, 5 May 2020 20:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728875AbgEFAAS (ORCPT ); Tue, 5 May 2020 20:00:18 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 542BCC061A0F for ; Tue, 5 May 2020 17:00:18 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id z6so385861wml.2 for ; Tue, 05 May 2020 17:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3iD14m2oqtz2m5olanAMCvHCDcEx9U6emVEbdAioaj8=; b=nSJZu/FoIdJ+qkbbRlKX/R3Ewl+m3sPF9nEVWJt+/W45oSngIvx5d8Qphlbp4P08bN Pu4Emc3Zg4MMm+MaCwmWTGETQmAMJ9sy8sUHu2MUHmTq8ZLHs9VkLM9MBJzyEbkYqVgU EAx3O9Vf55SxohUSlOgAM62+r6tPhWgoLzQSI= 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=3iD14m2oqtz2m5olanAMCvHCDcEx9U6emVEbdAioaj8=; b=dVpcLiRP0jgdP3eaxQJ6R3A4UXBRzwPFz0g9QCzbRQvAMCUbC02viBCR0+fos0coEJ HXDA2l/Ahyzky9xyn4iqxtgwZHOGqGwN4GhdAntZpc8e2IR5tWkt/wI8dXphmHox0+IY lUhcpMoMXuUIKwhSlUEA6n3cOWO/G5Cp/+6tMtn4JNHFfmqYLN/JAhqcNvaFzAsMgAiK 05+oY1T+64tfUymXNcBw1MgMyZLyFu1zVdryL8G+6CKj7Z+vN5ktqmmyqAE17ft1tqZw WOAM9djUBgMFl0ItmMmdSkwJCh6FlQQCYHdxMkP2C9XwKRw6RsxToiMynN+9+c+IaTRV fX7A== X-Gm-Message-State: AGi0PubjqyFdLlJPLdag5HVeT8bEO2WHEkYD2DbU6X3yTiJm+avKuaGy /VQbTL/qxS/7uGHTNQ+Jxh7WByLT3WuxaGt5pX7T X-Received: by 2002:a7b:cdfa:: with SMTP id p26mr1122660wmj.186.1588723216414; Tue, 05 May 2020 17:00:16 -0700 (PDT) MIME-Version: 1.0 References: <20200504040319.31423-1-atish.patra@wdc.com> In-Reply-To: From: Atish Patra Date: Tue, 5 May 2020 17:00:05 -0700 Message-ID: Subject: Re: [PATCH] RISC-V: Remove unused code from STRICT_KERNEL_RWX To: Palmer Dabbelt Cc: Atish Patra , Albert Ou , Anup Patel , "linux-kernel@vger.kernel.org List" , Zong Li , Paul Walmsley , linux-riscv 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 Tue, May 5, 2020 at 4:55 PM Palmer Dabbelt wrote: > > On Sun, 03 May 2020 21:03:19 PDT (-0700), 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; > > Thanks, this is on fixes. Are you going to remove the ARM code as well? > Yeah and also I realized that I forgot to remove the declarations from the header file. My bad. I will send out a v2. Please drop this one and take v2. -- Regards, Atish