From: Jeffrey Brian Arnold <jbarnold@MIT.EDU>
To: linux-kernel@vger.kernel.org
Cc: Tim Abbott <tabbott@MIT.EDU>, Anders Kaseorg <andersk@MIT.EDU>,
Waseem Daher <wdaher@MIT.EDU>,
Denys Vlasenko <vda.linux@googlemail.com>
Subject: [RFC PATCH 9/9] Ksplice: Add support for building Ksplice as a module
Date: Sat, 13 Sep 2008 00:49:57 -0400 [thread overview]
Message-ID: <d6b318d87ce57f8fbedeec562f4e70874ddfc101.1221280912.git.jbarnold@mit.edu> (raw)
In-Reply-To: <9db918711d1108cc89f991e2494f58d60cbd2555.1221280912.git.jbarnold@mit.edu>
In-Reply-To: <bfbae790a8f63d8697062036d47e0756e9f3ad5f.1221280912.git.jbarnold@mit.edu>
From: Tim Abbott <tabbott@mit.edu>
Export the symbols needed to build Ksplice as a module.
Signed-off-by: Tim Abbott <tabbott@mit.edu>
---
arch/Kconfig | 2 +-
arch/x86/mm/init_32.c | 5 +++--
arch/x86/mm/init_64.c | 3 ++-
kernel/kallsyms.c | 1 +
kernel/module.c | 9 +++++++++
kernel/sched.c | 1 +
6 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 9d5a843..cfbbcf3 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -28,7 +28,7 @@ config KPROBES
If in doubt, say "N".
config KSPLICE
- bool "Ksplice rebootless kernel updates"
+ tristate "Ksplice rebootless kernel updates"
depends on KALLSYMS_ALL && MODULE_UNLOAD && SYSFS && \
FUNCTION_DATA_SECTIONS
depends on HAVE_KSPLICE
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 5998d5c..549b021 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -1036,7 +1036,8 @@ void mark_rodata_ro(void)
unsigned long start = PFN_ALIGN(_text);
unsigned long size = PFN_ALIGN(_etext) - start;
-#if !defined(CONFIG_DYNAMIC_FTRACE) && !defined(CONFIG_KSPLICE)
+#if !defined(CONFIG_DYNAMIC_FTRACE) && \
+ !defined(CONFIG_KSPLICE) && !defined(CONFIG_KSPLICE_MODULE)
/* Dynamic tracing and Ksplice modify the kernel text section */
set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
printk(KERN_INFO "Write protecting the kernel text: %luk\n",
@@ -1050,7 +1051,7 @@ void mark_rodata_ro(void)
printk(KERN_INFO "Testing CPA: write protecting again\n");
set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT);
#endif
-#endif /* !CONFIG_DYNAMIC_FTRACE && !CONFIG_KSPLICE */
+#endif /* !CONFIG_DYNAMIC_FTRACE && !CONFIG_KSPLICE && !CONFIG_KSPLICE_MODULE */
start += size;
size = (unsigned long)__end_rodata - start;
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 31db657..dec6325 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -857,7 +857,8 @@ void mark_rodata_ro(void)
unsigned long rodata_start =
((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
-#if defined(CONFIG_DYNAMIC_FTRACE) || defined(CONFIG_KSPLICE)
+#if defined(CONFIG_DYNAMIC_FTRACE) || \
+ defined(CONFIG_KSPLICE) || defined(CONFIG_KSPLICE_MODULE)
/* Dynamic tracing and Ksplice modify the kernel text section */
start = rodata_start;
#endif
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 47d3e94..ef47021 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -178,6 +178,7 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
}
return module_kallsyms_on_each_symbol(fn, data);
}
+EXPORT_SYMBOL_GPL(kallsyms_on_each_symbol);
static unsigned long get_symbol_pos(unsigned long addr,
unsigned long *symbolsize,
diff --git a/kernel/module.c b/kernel/module.c
index 2acb646..d2fa540 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -63,6 +63,7 @@
/* List of modules, protected by module_mutex or preempt_disable
* (add/delete uses stop_machine). */
DEFINE_MUTEX(module_mutex);
+EXPORT_SYMBOL_GPL(module_mutex);
static LIST_HEAD(modules);
/* Waiting for a module to finish initializing? */
@@ -324,6 +325,7 @@ const struct kernel_symbol *find_symbol(const char *name,
DEBUGP("Failed to find symbol %s\n", name);
return NULL;
}
+EXPORT_SYMBOL_GPL(find_symbol);
/* Search for module by name: must hold module_mutex. */
struct module *find_module(const char *name)
@@ -336,6 +338,7 @@ struct module *find_module(const char *name)
}
return NULL;
}
+EXPORT_SYMBOL_GPL(find_module);
#ifdef CONFIG_SMP
/* Number of blocks used and allocated. */
@@ -612,6 +615,7 @@ int use_module(struct module *a, struct module *b)
no_warn = sysfs_create_link(b->holders_dir, &a->mkobj.kobj, a->name);
return 1;
}
+EXPORT_SYMBOL_GPL(use_module);
/* Clear the unload stuff of the module. */
static void module_unload_free(struct module *mod)
@@ -878,6 +882,7 @@ int use_module(struct module *a, struct module *b)
{
return strong_try_module_get(b) == 0;
}
+EXPORT_SYMBOL_GPL(use_module);
static inline void module_unload_init(struct module *mod)
{
@@ -2689,6 +2694,7 @@ struct module *__module_text_address(unsigned long addr)
return mod;
return NULL;
}
+EXPORT_SYMBOL_GPL(__module_text_address);
struct module *module_text_address(unsigned long addr)
{
@@ -2700,6 +2706,7 @@ struct module *module_text_address(unsigned long addr)
return mod;
}
+EXPORT_SYMBOL_GPL(module_text_address);
struct module *__module_data_address(unsigned long addr)
{
@@ -2717,6 +2724,7 @@ struct module *__module_data_address(unsigned long addr)
}
return NULL;
}
+EXPORT_SYMBOL_GPL(__module_data_address);
struct module *module_data_address(unsigned long addr)
{
@@ -2728,6 +2736,7 @@ struct module *module_data_address(unsigned long addr)
return mod;
}
+EXPORT_SYMBOL_GPL(module_data_address);
/* Don't grab lock, we're oopsing. */
void print_modules(void)
diff --git a/kernel/sched.c b/kernel/sched.c
index cc1f81b..bd385b6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1736,6 +1736,7 @@ inline int task_curr(const struct task_struct *p)
{
return cpu_curr(task_cpu(p)) == p;
}
+EXPORT_SYMBOL_GPL(task_curr);
static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
{
--
1.5.4.3
next prev parent reply other threads:[~2008-09-13 4:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-13 4:49 [RFC PATCH 0/9] Ksplice: Rebootless kernel updates Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 1/9] Ksplice: Make find_symbol return a struct kernel_symbol Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 2/9] Ksplice: Add module_data_address (the analogue of module_text_address) Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 3/9] Ksplice: Add functions for walking kallsyms symbols Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 4/9] Ksplice: Make needed symbol and module functions global Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 5/9] Ksplice: Architecture-independent core Jeffrey Brian Arnold
[not found] ` <8d86b7714a1012014ce3533aa24dc88704fe14a6.1221271644.git.jbarnold@mit.edu>
2008-09-13 4:49 ` [RFC PATCH 5/9] Ksplice core (architecture independent) Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 6/9] Ksplice: Documentation Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 6/9] Ksplice documentation Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 7/9] Ksplice: x86-32 and x86-64 support Jeffrey Brian Arnold
2008-09-13 4:49 ` [RFC PATCH 8/9] Ksplice: ARM support Jeffrey Brian Arnold
2008-09-13 4:49 ` Jeffrey Brian Arnold [this message]
2008-09-13 5:12 ` [RFC PATCH 0/9] Ksplice: Rebootless kernel updates Alexey Dobriyan
2008-09-14 20:24 ` Jeff Arnold
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=d6b318d87ce57f8fbedeec562f4e70874ddfc101.1221280912.git.jbarnold@mit.edu \
--to=jbarnold@mit.edu \
--cc=andersk@MIT.EDU \
--cc=linux-kernel@vger.kernel.org \
--cc=tabbott@MIT.EDU \
--cc=vda.linux@googlemail.com \
--cc=wdaher@MIT.EDU \
/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
all inboxes | Powered by JetHome®