Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9146328ybl; Fri, 17 Jan 2020 07:05:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwOKxorQ699qRLrjwtZMH2pQnQPAQQtVJFeGLZx9GIBS6zIrBkxtHvJqhvOXr3YPMpTTedl X-Received: by 2002:a05:6808:53:: with SMTP id v19mr3796094oic.18.1579273545449; Fri, 17 Jan 2020 07:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579273545; cv=none; d=google.com; s=arc-20160816; b=f6OKMS1+JwCG60IndzahcJePPEl9dp8Hq+MwTo55OquRzn+AkbNeCgqDUIOreblzHX q/h5ogGhebAFtSJbqJynksHeYsoJzIql5aXNzc+ogAGV34avJAx3CBWMK/UrJKuBCrLS 0KfJqLxC4bZeAR5QYmE3bXZ8vuaOVG+iNZmMqxASAJvekjNV3CNlR0OSsJbzZ+Ul4w3T dpFa9ydjWSEy9PWxoYwQrHkB96AJp9uJlcFn/kaod1fajscYDCeZAao33vgbfx2FTewa qj5QAzo7MEdOJDmW0gNrby9d04rpRjdTJJXtuFBCfryicM0qsparZla7Twnvdd8+6+BW oTpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=NpZW430ET669dYcFiGW/8IhCiUU/8omon/0tL+xhIrc=; b=bfEBSwwPa8+HHiyTMNaehENgCLBbu6zZAhFLECq9JVOxDTYTM0AU1KcyIrZA/MC1co EElkuDsJZivbmsDoaPo/NLaqsjYEV9D9d//e+1ZUHIeTmBMV5qc21suGNgDdPQ6HoQDq C8sWxg+xDdq/bgBXR/+tArBMFoZCPq3bQf+1m/4NIpjjf3ZhCZyO4UV21z247xfXlULN BGAXUIfeDMCYdZCYzYfJgRjCk3Ux9NmRlO9zopWPmQ9SdBduG22G+J18fXK2YbzV6X6h m/uNIzVVzQ/l/6hKcFjXI9xLi2uc7lQWdpX+IwJvgWSB7rk0H+Y2v7DMJb31T0eu1zG7 zUJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si15687787otl.133.2020.01.17.07.05.32; Fri, 17 Jan 2020 07:05:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729252AbgAQPEJ (ORCPT + 99 others); Fri, 17 Jan 2020 10:04:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:46524 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729195AbgAQPEG (ORCPT ); Fri, 17 Jan 2020 10:04:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4C0F9BBC0; Fri, 17 Jan 2020 15:04:04 +0000 (UTC) From: Petr Mladek To: Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Joe Lawrence , Kamalesh Babulal , Nicolai Stange , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: [POC 23/23] module: Remove obsolete module_disable_ro() Date: Fri, 17 Jan 2020 16:03:23 +0100 Message-Id: <20200117150323.21801-24-pmladek@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200117150323.21801-1-pmladek@suse.com> References: <20200117150323.21801-1-pmladek@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The split livepatch modules are relocated immediately during the module load. There is no longer needed to disable the RO protection. The function can be finally remove because livepatching was the only user (sinner). Signed-off-by: Petr Mladek --- 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 8545f3087274..5c9e661ac3bc 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -854,12 +854,10 @@ extern int module_sysfs_initialized; extern void set_all_modules_text_rw(void); extern void set_all_modules_text_ro(void); 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 set_all_modules_text_rw(void) { } static inline void set_all_modules_text_ro(void) { } static inline void module_enable_ro(const struct module *mod, bool after_init) { } -static inline void module_disable_ro(const struct module *mod) { } #endif #ifdef CONFIG_GENERIC_BUG diff --git a/kernel/module.c b/kernel/module.c index 442926fc5f34..d435bad80d7d 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2030,19 +2030,6 @@ static void frob_writable_data(const struct module_layout *layout, (layout->size - layout->ro_after_init_size) >> PAGE_SHIFT); } -/* 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) -- 2.16.4