aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/module.c')
-rw-r--r--arch/i386/kernel/module.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c
index 470cf97e7cd3..3db0a5442eb1 100644
--- a/arch/i386/kernel/module.c
+++ b/arch/i386/kernel/module.c
@@ -21,6 +21,7 @@
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/bug.h>
24 25
25#if 0 26#if 0
26#define DEBUGP printk 27#define DEBUGP printk
@@ -108,7 +109,8 @@ int module_finalize(const Elf_Ehdr *hdr,
108 const Elf_Shdr *sechdrs, 109 const Elf_Shdr *sechdrs,
109 struct module *me) 110 struct module *me)
110{ 111{
111 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL; 112 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL,
113 *para = NULL;
112 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 114 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
113 115
114 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { 116 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
@@ -118,6 +120,8 @@ int module_finalize(const Elf_Ehdr *hdr,
118 alt = s; 120 alt = s;
119 if (!strcmp(".smp_locks", secstrings + s->sh_name)) 121 if (!strcmp(".smp_locks", secstrings + s->sh_name))
120 locks= s; 122 locks= s;
123 if (!strcmp(".parainstructions", secstrings + s->sh_name))
124 para = s;
121 } 125 }
122 126
123 if (alt) { 127 if (alt) {
@@ -132,10 +136,17 @@ int module_finalize(const Elf_Ehdr *hdr,
132 lseg, lseg + locks->sh_size, 136 lseg, lseg + locks->sh_size,
133 tseg, tseg + text->sh_size); 137 tseg, tseg + text->sh_size);
134 } 138 }
135 return 0; 139
140 if (para) {
141 void *pseg = (void *)para->sh_addr;
142 apply_paravirt(pseg, pseg + para->sh_size);
143 }
144
145 return module_bug_finalize(hdr, sechdrs, me);
136} 146}
137 147
138void module_arch_cleanup(struct module *mod) 148void module_arch_cleanup(struct module *mod)
139{ 149{
140 alternatives_smp_module_del(mod); 150 alternatives_smp_module_del(mod);
151 module_bug_cleanup(mod);
141} 152}