From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Aaron Tomlin <atomlin@redhat.com>,
Luis Chamberlain <mcgrof@kernel.org>,
Jessica Yu <jeyu@kernel.org>
Cc: linux-arch@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linuxppc-dev@lists.ozlabs.org, linux-modules@vger.kernel.org
Subject: [PATCH v4 1/6] module: Always have struct mod_tree_root
Date: Tue, 22 Feb 2022 11:32:15 +0100 [thread overview]
Message-ID: <5aa01e3616b21e0852339f16977c4748d753a877.1645525635.git.christophe.leroy@csgroup.eu> (raw)
In-Reply-To: <cover.1645525635.git.christophe.leroy@csgroup.eu>
In order to separate text and data, we need to setup
two rb trees.
This means that struct mod_tree_root is required even without
MODULES_TREE_LOOKUP.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
kernel/module/internal.h | 4 +++-
kernel/module/main.c | 5 -----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index fecfa590c149..07561753158d 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -143,15 +143,17 @@ static inline void module_decompress_cleanup(struct load_info *info)
}
#endif
-#ifdef CONFIG_MODULES_TREE_LOOKUP
struct mod_tree_root {
+#ifdef CONFIG_MODULES_TREE_LOOKUP
struct latch_tree_root root;
+#endif
unsigned long addr_min;
unsigned long addr_max;
};
extern struct mod_tree_root mod_tree;
+#ifdef CONFIG_MODULES_TREE_LOOKUP
void mod_tree_insert(struct module *mod);
void mod_tree_remove_init(struct module *mod);
void mod_tree_remove(struct module *mod);
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 0749afdc34b5..3b75cb97f8c2 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -74,7 +74,6 @@ static void do_free_init(struct work_struct *w);
static DECLARE_WORK(init_free_wq, do_free_init);
static LLIST_HEAD(init_free_list);
-#ifdef CONFIG_MODULES_TREE_LOOKUP
struct mod_tree_root mod_tree __cacheline_aligned = {
.addr_min = -1UL,
};
@@ -82,10 +81,6 @@ struct mod_tree_root mod_tree __cacheline_aligned = {
#define module_addr_min mod_tree.addr_min
#define module_addr_max mod_tree.addr_max
-#else /* !CONFIG_MODULES_TREE_LOOKUP */
-static unsigned long module_addr_min = -1UL, module_addr_max;
-#endif /* CONFIG_MODULES_TREE_LOOKUP */
-
struct symsearch {
const struct kernel_symbol *start, *stop;
const s32 *crcs;
--
2.34.1
next prev parent reply other threads:[~2022-02-22 10:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 10:32 [PATCH v4 0/6] Allocate module text and data separately Christophe Leroy
2022-02-22 10:32 ` Christophe Leroy [this message]
2022-02-22 10:32 ` [PATCH v4 2/6] module: Prepare for handling several RB trees Christophe Leroy
2022-02-22 10:32 ` [PATCH v4 3/6] module: Introduce data_layout Christophe Leroy
2022-02-22 10:32 ` [PATCH v4 4/6] module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC Christophe Leroy
2022-02-22 10:32 ` [PATCH v4 5/6] module: Remove module_addr_min and module_addr_max Christophe Leroy
2022-02-22 10:32 ` [PATCH v4 6/6] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Christophe Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5aa01e3616b21e0852339f16977c4748d753a877.1645525635.git.christophe.leroy@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=atomlin@redhat.com \
--cc=jeyu@kernel.org \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-modules@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).