Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp734871ybz; Wed, 29 Apr 2020 08:27:51 -0700 (PDT) X-Google-Smtp-Source: APiQypJA4zmsxJ30ftcRcLP8ej+rqvw0f5ynuliCG4ZGhIinh07DDVNIw3T6JCaRvw27L1LMkpH9 X-Received: by 2002:aa7:db41:: with SMTP id n1mr3011559edt.314.1588174070932; Wed, 29 Apr 2020 08:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588174070; cv=none; d=google.com; s=arc-20160816; b=UEj0wVooh7ZkGsQ6TF3OwzG3ChGkaAxyY7sRQgz47OqjF9NI3uotf63iwrA/2B/ObG cI2jDZEuQpfc9HJv5tA/Z1Vxj4MbuApK9pHfCTNpc7eWM6iECPyZDxBFME0qUz21zsiD LooZC4g3x9UE4cRPd3f6yIYfQPjwecsOOIHBv3J4N3O/WbdfmEgfXd1uVx8nCTyGiq3Z oxttJpscG/nTqXpEqV0C1Mq1rbUcqf0fRTmCN3BUY0JE2ZbUPyId937ILbyuk1JokvSi KqUsz8jz968xFNjKbVVPXJyYNbGkm3ua+8hE+DHe41Zc/sDfLtFai/00z/1O6MYSMEKs ta0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n7MNVntR2hzdBos1b1qY3omx/9gteBl17M6iJffUlGU=; b=IImvE5CUu80qqYa5P5AabwwpNy85BWGwxwK+eeKX7rDEyQ5FkGrW60lWvA41q6FHfI 02aZWQ0yJb5DmzwR3QKwrS0y6HEwxz5h9DbBVRY2KUTlSy5qtvdHCO1WMBLtcsz3peRZ 10CL9zAtQP11F2A/b49Yp1KMcFJnEBOzPW0TTwNxdrcEvCPmohdPaZ/mfRg4DXQKE+0K fSy47W9jYLoHDnzDWWSa0NxWSqVbKMj2XQDFzTdIq/YKLpV7f3UxSNGE/cZUj5D46I/5 bxHK8YKuB1uD1sr7jTTVDo+0fzKvkq6/857NLs/P2i1ZUy+0zY5vZ6T+R4TGdpizhz8q zjTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D7cK+1uG; 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 w26si4038549ejs.63.2020.04.29.08.27.26; Wed, 29 Apr 2020 08:27:50 -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=D7cK+1uG; 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 S1726691AbgD2PZa (ORCPT + 99 others); Wed, 29 Apr 2020 11:25:30 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:35076 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727887AbgD2PZ1 (ORCPT ); Wed, 29 Apr 2020 11:25:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588173926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n7MNVntR2hzdBos1b1qY3omx/9gteBl17M6iJffUlGU=; b=D7cK+1uGKo5qhslaVTWyjklYgFV1+HNM5k+VmCpycYBJl6W1oqqV0z7YhAUoRf1+dQHmtG 9hXJ8udYMQXX6d91+d/Dl4OB+Vizfo4VTcGAk+sCeeyNiZpp4IRMz7TJDcfsXiPcIC9kIB wavzFl6psAHw8XzWfAWz0ZdFpCR1nZc= 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-405-4uGGnM5wOgOOSpEELuMYZw-1; Wed, 29 Apr 2020 11:25:22 -0400 X-MC-Unique: 4uGGnM5wOgOOSpEELuMYZw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EF2B80BC52; Wed, 29 Apr 2020 15:25:14 +0000 (UTC) Received: from treble.redhat.com (ovpn-113-19.rdu2.redhat.com [10.10.113.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 516C163BBE; Wed, 29 Apr 2020 15:25:13 +0000 (UTC) From: Josh Poimboeuf To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Jessica Yu , Joe Lawrence , Miroslav Benes Subject: [PATCH v4 11/11] module: Make module_enable_ro() static again Date: Wed, 29 Apr 2020 10:24:53 -0500 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; =20 #define __MODULE_STRING(x) __stringify(x) =20 -#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..572d626508d2 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); } =20 -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 *hd= r, Elf_Shdr *sechdrs, } =20 #else /* !CONFIG_STRICT_MODULE_RWX */ -/* module_{enable,disable}_ro() stubs are in module.h */ +static 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) --=20 2.21.1