Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4370428ybz; Tue, 28 Apr 2020 10:07:59 -0700 (PDT) X-Google-Smtp-Source: APiQypLzKFELODk+MCCiqbp0Pq5tqhGfnHMLyAuGzMCq7xuJRvnAlhbptuL2stCxS4uNpnE8NA85 X-Received: by 2002:aa7:c492:: with SMTP id m18mr17823055edq.346.1588093679483; Tue, 28 Apr 2020 10:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588093679; cv=none; d=google.com; s=arc-20160816; b=a5nfyqHObpk0oNcY/IiPmE+db2Th8CbrmVMys7UgxGabFVyGTc8JT98P+pTnjfgbjn oBcy1Wcf9Gi+24LJX72Xh1+j/VXWWYrZZty/z1zHHbWuP8aCcPLPze2Maq3ze9HC0TTT WoLCQ0276P5G93XNTeuz7sZeJYAxxiGrCAgmH4P5WCTHjwhBnPYVQEW78b92dahzGknS P19Spu6cywfM5/WydAyFw4oHhg7KzRhG9g2y8t4xoJ7Eeg7Jh1n018Ks3ap5jiXYbuQd LkFJUFgmT4Bag4xKhTpSmpsPxFabcdx0v6XGCV2k1gQldksBly1co+d2whpLExcxoRl/ 4T5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zcoS40fbpIucEVEOA18HqlGMwt7Vf5w2w5C7357mLPs=; b=rS6w0zWkjjwQ1THnCH6INEsQlADm0nlFWX/8Up24z15UOco1jsbhmo3LLqag6boPjD odZ1q2IJsd88xxbin0Yr8fOGywXnxJIwUmjOkAgTPd5dIL90+X0gRnsupn6hIUUa8liD okp0exQrLiCRrXik8Jj9xpUtqTOpTLlLEUh8o0zciKi1rwGhXGUipSODHzfyEAXr+BA5 lCNxh6aQ9ZeBwr2eq/nlAVRtTvooqllfwsPmFdYiqnIsSS0dH2xpgQxwsySs8oB/z9Sl 83O3nfe2g2bAx+QEjN/v4g7GVhVGrlJTfsAY0xVh7+loJVO1J1ogWXmQS7vTQStuXuNp ZaOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FtAXSZMd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dv25si2306103ejb.270.2020.04.28.10.07.34; Tue, 28 Apr 2020 10:07:59 -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=@redhat.com header.s=mimecast20190719 header.b=FtAXSZMd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728336AbgD1RDY (ORCPT + 99 others); Tue, 28 Apr 2020 13:03:24 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:27759 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728089AbgD1RDW (ORCPT ); Tue, 28 Apr 2020 13:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588093400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zcoS40fbpIucEVEOA18HqlGMwt7Vf5w2w5C7357mLPs=; b=FtAXSZMdsy0+8qWKKothD8tLz8RCrMTPPfroPihP3S+3Xf0LkERa+hlfUjzRMqJVN6JEMq qRwJPWFXYm0OOp+pu3Y9wHLL+9ao7pLCxPSNFH+ORehrTQvaPHg52gQyUhWKaYB1XTsndW D/Q85s1FoKUpFsRr5Psoi4098Hq33JE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-461-Nec0OIyTPYeJqz0YXu2cSw-1; Tue, 28 Apr 2020 13:03:16 -0400 X-MC-Unique: Nec0OIyTPYeJqz0YXu2cSw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CFB5835B41; Tue, 28 Apr 2020 17:03:15 +0000 (UTC) Received: from treble (ovpn-112-209.rdu2.redhat.com [10.10.112.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2ACE19C58; Tue, 28 Apr 2020 17:03:11 +0000 (UTC) Date: Tue, 28 Apr 2020 12:03:09 -0500 From: Josh Poimboeuf To: Jessica Yu Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Joe Lawrence Subject: Re: [PATCH v3 09/10] module: Remove module_disable_ro() Message-ID: <20200428170309.xrsmqdwj5qu2q6t6@treble> References: <33089a8ffb2e724cecfa51d72887ae9bf70354f9.1587812518.git.jpoimboe@redhat.com> <20200428162505.GA12860@linux-8ccs.fritz.box> <20200428163602.77t6s2qeh4xeacdq@treble> <20200428164155.GB12860@linux-8ccs.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200428164155.GB12860@linux-8ccs.fritz.box> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 06:41:55PM +0200, Jessica Yu wrote: > +++ Josh Poimboeuf [28/04/20 11:36 -0500]: > > On Tue, Apr 28, 2020 at 06:25:05PM +0200, Jessica Yu wrote: > > > +++ Josh Poimboeuf [25/04/20 06:07 -0500]: > > > > module_disable_ro() has no more users. Remove it. > > > > > > > > Signed-off-by: Josh Poimboeuf > > > > Acked-by: Peter Zijlstra (Intel) > > > > > > Hm, I guess this means we can also remove the module_enable_ro() stubs > > > in module.h and make it a static function again (like the other > > > module_enable_* functions) as there are no more outside users. I have to > > > remind myself after this patchset is merged :-) > > > > Ah, true. I'm respinning the patch set anyway, I can just add this as a > > another patch. > > That would be great. Thanks! Sneak preview: From: Josh Poimboeuf Subject: [PATCH] module: Make module_enable_ro() static again Now that module_enable_ro() has no more external users, make it static again. Suggested-by: Jessica Yu Signed-off-by: Josh Poimboeuf --- include/linux/module.h | 6 ------ kernel/module.c | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index e4ef7b36feda..2c2e988bcf10 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -858,12 +858,6 @@ extern int module_sysfs_initialized; #define __MODULE_STRING(x) __stringify(x) -#ifdef CONFIG_STRICT_MODULE_RWX -extern void module_enable_ro(const struct module *mod, bool after_init); -#else -static inline void module_enable_ro(const struct module *mod, bool after_init) { } -#endif - #ifdef CONFIG_GENERIC_BUG void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, struct module *); diff --git a/kernel/module.c b/kernel/module.c index f0e414a01d91..6d8aab60943e 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2016,7 +2016,7 @@ static void frob_writable_data(const struct module_layout *layout, (layout->size - layout->ro_after_init_size) >> PAGE_SHIFT); } -void module_enable_ro(const struct module *mod, bool after_init) +static void module_enable_ro(const struct module *mod, bool after_init) { if (!rodata_enabled) return; @@ -2057,7 +2057,7 @@ static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, } #else /* !CONFIG_STRICT_MODULE_RWX */ -/* module_{enable,disable}_ro() stubs are in module.h */ +void module_enable_ro(const struct module *mod, bool after_init) {} static void module_enable_nx(const struct module *mod) { } static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) -- 2.21.1