|
|
@@ -16,6 +16,7 @@
|
|
|
#include <linux/jump_label_ratelimit.h>
|
|
|
#include <linux/bug.h>
|
|
|
#include <linux/cpu.h>
|
|
|
+#include <asm/sections.h>
|
|
|
|
|
|
#ifdef HAVE_JUMP_LABEL
|
|
|
|
|
|
@@ -417,6 +418,20 @@ void __init jump_label_init(void)
|
|
|
cpus_read_unlock();
|
|
|
}
|
|
|
|
|
|
+/* Disable any jump label entries in __init code */
|
|
|
+void __init jump_label_invalidate_init(void)
|
|
|
+{
|
|
|
+ struct jump_entry *iter_start = __start___jump_table;
|
|
|
+ struct jump_entry *iter_stop = __stop___jump_table;
|
|
|
+ struct jump_entry *iter;
|
|
|
+
|
|
|
+ for (iter = iter_start; iter < iter_stop; iter++) {
|
|
|
+ if (iter->code >= (unsigned long)_sinittext &&
|
|
|
+ iter->code < (unsigned long)_einittext)
|
|
|
+ iter->code = 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
#ifdef CONFIG_MODULES
|
|
|
|
|
|
static enum jump_label_type jump_label_init_type(struct jump_entry *entry)
|
|
|
@@ -633,6 +648,7 @@ static void jump_label_del_module(struct module *mod)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/* Disable any jump label entries in module init code */
|
|
|
static void jump_label_invalidate_module_init(struct module *mod)
|
|
|
{
|
|
|
struct jump_entry *iter_start = mod->jump_entries;
|