Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4575603ybb; Tue, 14 Apr 2020 09:56:08 -0700 (PDT) X-Google-Smtp-Source: APiQypIrHc9A0vjSXVHna3YOeVWy2oUbmy1nZ7qua6/Z7ZAZuWLgBX7vbzdTWdbaZWktcV4F4h7O X-Received: by 2002:a17:906:6483:: with SMTP id e3mr1064336ejm.284.1586883368729; Tue, 14 Apr 2020 09:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586883368; cv=none; d=google.com; s=arc-20160816; b=UiQkqBWE8Vdod0wKoBXQ+YV+yyYDeYEQQwg5Z0q4XKhgCKcX2mSuSul9tmrfYPhxOZ b+cqHJUbd+hIiLYmx//GSYKuKIvHFfcAPWM1SAcuQ5w3Ng2AboKuqvCvLTtn+IYwGFg3 yAzn8tezdyMDg6t1Ftn0PbsfHYavLIVyK4uR/Pr4aVZrr0Hdgrmw8LGwjmjr4wdHfdrg QVUfH+NKtJotXLJbBo2KxBPqoMIyZZE3qG/fN67YZY0b7YlatySH7s74cN8JqR67YD4o KXrrwav9yjxY30hiS3hGIw/hpf3wHUr+vDORetktybnJ7L6MBQ2ly5H33p9NleQFxwg8 f+7A== 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=mI0X+qpNN8QkK4GuqcTnDoFIUVteWF3NgrYV4egmVdI=; b=x+ZCRQlPUz5DfG0bfmqenMegSZXNzPiDj0KpDZGNRV3do466kKdN0tiii3R8kFISSv cT2m7LMkDDCpWnCSxT55xhX8sDnWrhVyQUtLzjaqEiYsvPOii5Qb+NKPJFWE+cSPhWgp Rf4FEWJmTiG1W96EoYVSIYYV3iH1SIqjATpVhkdVQKemU3ymtHQali5IW33a+TnJHfdD GcmZsxuXTZUqxtWR5LrsMRnCHC5r3ynJMw8F1u2QDSBvwDeT96PDqSrTVuABtfM21mwt ePQaeIpmpkXxrPGnpI/dbZ7yFeCsSG+jdcmH3BhQGmht/zneIIwAhx5BptX8H3yp48j1 PZ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hy2WlQJ+; spf=pass (google.com: best guess record for 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 cb28si8642582edb.11.2020.04.14.09.55.45; Tue, 14 Apr 2020 09:56:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=hy2WlQJ+; spf=pass (google.com: best guess record for 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 S2391619AbgDNQcV (ORCPT + 99 others); Tue, 14 Apr 2020 12:32:21 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:47351 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391612AbgDNQ3Q (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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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