From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72A48C2BB85 for ; Tue, 14 Apr 2020 16:32:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40C2120678 for ; Tue, 14 Apr 2020 16:32:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hy2WlQJ+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391716AbgDNQcI (ORCPT ); Tue, 14 Apr 2020 12:32:08 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:56757 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390547AbgDNQ3Q (ORCPT ); Tue, 14 Apr 2020 12:29:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586881746; 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=mI0X+qpNN8QkK4GuqcTnDoFIUVteWF3NgrYV4egmVdI=; b=hy2WlQJ+BWc4pDYsWNdDte8lf8CThxLfpngMzJ8Mb09rvlnsnlIN/7NLlHScm7e1Pk8NR0 ktaYi+KU+8pQXUi0bB3Ljk7VDo+vOlNoGU/pVYi6fod2nEiGTXKKievEDgZ0XM9UOdO6kA XSBekft+Ltwxc/p6z30DUc+3wh+h6/k= 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-341-_vcLn_wUMLm09pKWmQvKYw-1; Tue, 14 Apr 2020 12:29:04 -0400 X-MC-Unique: _vcLn_wUMLm09pKWmQvKYw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37465DB60; Tue, 14 Apr 2020 16:29:03 +0000 (UTC) Received: from treble.redhat.com (ovpn-116-146.rdu2.redhat.com [10.10.116.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D5C75DA66; Tue, 14 Apr 2020 16:29:02 +0000 (UTC) From: Josh Poimboeuf To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Jessica Yu Subject: [PATCH 7/7] module: Remove module_disable_ro() Date: Tue, 14 Apr 2020 11:28:43 -0500 Message-Id: <3115fb64e95420dea2d43da55c4474feb03c4185.1586881704.git.jpoimboe@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Content-Transfer-Encoding: quoted-printable Sender: live-patching-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org module_disable_ro() has no more users. Remove it. Signed-off-by: Josh Poimboeuf --- include/linux/module.h | 2 -- kernel/module.c | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 1ad393e62bef..e4ef7b36feda 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -860,10 +860,8 @@ extern int module_sysfs_initialized; =20 #ifdef CONFIG_STRICT_MODULE_RWX extern void module_enable_ro(const struct module *mod, bool after_init); -extern void module_disable_ro(const struct module *mod); #else static inline void module_enable_ro(const struct module *mod, bool after= _init) { } -static inline void module_disable_ro(const struct module *mod) { } #endif =20 #ifdef CONFIG_GENERIC_BUG diff --git a/kernel/module.c b/kernel/module.c index d36ea8a8c3ec..b1d30ad67e82 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1997,19 +1997,6 @@ static void frob_writable_data(const struct module= _layout *layout, (layout->size - layout->ro_after_init_size) >> PAGE_SHIFT); } =20 -/* livepatching wants to disable read-only so it can frob module. */ -void module_disable_ro(const struct module *mod) -{ - if (!rodata_enabled) - return; - - frob_text(&mod->core_layout, set_memory_rw); - frob_rodata(&mod->core_layout, set_memory_rw); - frob_ro_after_init(&mod->core_layout, set_memory_rw); - frob_text(&mod->init_layout, set_memory_rw); - frob_rodata(&mod->init_layout, set_memory_rw); -} - void module_enable_ro(const struct module *mod, bool after_init) { if (!rodata_enabled) --=20 2.21.1