[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c9584f48abce748e62e65e6757ceb23800f15380.1645541930.git.christophe.leroy@csgroup.eu>
Date: Tue, 22 Feb 2022 16:00:18 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Luis Chamberlain <mcgrof@...nel.org>,
Aaron Tomlin <atomlin@...hat.com>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
kgdb-bugreport@...ts.sourceforge.net, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-modules@...r.kernel.org
Subject: [PATCH v5 1/6] module: Always have struct mod_tree_root
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@...roup.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 3fc139d5074b..743b598e7cc2 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
Powered by blists - more mailing lists