diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-06-09 20:09:41 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-06-09 20:09:41 +1000 |
commit | 45b2cc2f1b879cc03bc6e013477cba5274d363a0 (patch) | |
tree | 19e3e5a84556c2e52c45c7e44924f7cc120f7df0 | |
parent | 0e528d910e4d4389b9d0358a02b9aa6d893f1767 (diff) |
Revert "module: trim exception table on init free."
This reverts commit 07c674557e43c27d4e7243a35b9ea030b09e3c3d.
-rw-r--r-- | arch/alpha/mm/extable.c | 19 | ||||
-rw-r--r-- | arch/ia64/mm/extable.c | 24 | ||||
-rw-r--r-- | arch/sparc/include/asm/uaccess_32.h | 3 | ||||
-rw-r--r-- | arch/sparc/mm/extable.c | 27 | ||||
-rw-r--r-- | include/linux/module.h | 1 | ||||
-rw-r--r-- | kernel/module.c | 1 | ||||
-rw-r--r-- | lib/extable.c | 17 |
7 files changed, 0 insertions, 92 deletions
diff --git a/arch/alpha/mm/extable.c b/arch/alpha/mm/extable.c index b81d6921c2a8..62dc379d301a 100644 --- a/arch/alpha/mm/extable.c +++ b/arch/alpha/mm/extable.c @@ -48,25 +48,6 @@ void sort_extable(struct exception_table_entry *start, cmp_ex, swap_ex); } -/* - * Any entry referring to the module init will be at the beginning or - * the end. - */ -void trim_init_extable(struct module *m) -{ - /*trim the beginning*/ - while (m->num_exentries && - within_module_init(ex_to_addr(&m->extable[0]), m)) { - m->extable++; - m->num_exentries--; - } - /*trim the end*/ - while (m->num_exentries && - within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]), - m)) - m->num_exentries--; -} - const struct exception_table_entry * search_extable(const struct exception_table_entry *first, const struct exception_table_entry *last, diff --git a/arch/ia64/mm/extable.c b/arch/ia64/mm/extable.c index 0fcf8c492b27..71c50dd8f870 100644 --- a/arch/ia64/mm/extable.c +++ b/arch/ia64/mm/extable.c @@ -53,30 +53,6 @@ void sort_extable (struct exception_table_entry *start, cmp_ex, swap_ex); } -static inline unsigned long ex_to_addr(const struct exception_table_entry *x) -{ - return (unsigned long)&x->insn + x->insn; -} - -/* - * Any entry referring to the module init will be at the beginning or - * the end. - */ -void trim_init_extable(struct module *m) -{ - /*trim the beginning*/ - while (m->num_exentries && - within_module_init(ex_to_addr(&m->extable[0]), m)) { - m->extable++; - m->num_exentries--; - } - /*trim the end*/ - while (m->num_exentries && - within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]), - m)) - m->num_exentries--; -} - const struct exception_table_entry * search_extable (const struct exception_table_entry *first, const struct exception_table_entry *last, diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h index 8303ac481034..47d5619d43fa 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@ -17,9 +17,6 @@ #ifndef __ASSEMBLY__ -#define ARCH_HAS_SORT_EXTABLE -#define ARCH_HAS_SEARCH_EXTABLE - /* Sparc is not segmented, however we need to be able to fool access_ok() * when doing system calls from kernel mode legitimately. * diff --git a/arch/sparc/mm/extable.c b/arch/sparc/mm/extable.c index e7b940dab7cc..16cc28935e39 100644 --- a/arch/sparc/mm/extable.c +++ b/arch/sparc/mm/extable.c @@ -28,10 +28,6 @@ search_extable(const struct exception_table_entry *start, * word 3: last insn address + 4 bytes * word 4: fixup code address * - * Deleted entries are encoded as: - * word 1: unused - * word 2: -1 - * * See asm/uaccess.h for more details. */ @@ -43,10 +39,6 @@ search_extable(const struct exception_table_entry *start, continue; } - /* A deleted entry; see trim_init_extable */ - if (walk->fixup == -1) - continue; - if (walk->insn == value) return walk; } @@ -65,25 +57,6 @@ search_extable(const struct exception_table_entry *start, return NULL; } -/* We could memmove them around; easier to mark the trimmed ones. */ -void trim_init_extable(struct module *m) -{ - unsigned int i; - bool range; - - for (i = 0; i < m->num_exentries; i += range ? 2 : 1) { - range = m->extable[i].fixup == 0; - - if (within_module_init(m->extable[i].insn)) { - m->extable[i].fixup = -1; - if (range) - m->extable[i+1].fixup = -1; - } - if (range) - i++; - } -} - /* Special extable search, which handles ranges. Returns fixup */ unsigned long search_extables_range(unsigned long addr, unsigned long *g2) { diff --git a/include/linux/module.h b/include/linux/module.h index a7bc6e7b43a7..a8f2c0aa4c32 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -77,7 +77,6 @@ search_extable(const struct exception_table_entry *first, void sort_extable(struct exception_table_entry *start, struct exception_table_entry *finish); void sort_main_extable(void); -void trim_init_extable(struct module *m); #ifdef MODULE #define MODULE_GENERIC_TABLE(gtype,name) \ diff --git a/kernel/module.c b/kernel/module.c index e4ab36ce7672..35f7de00bf0d 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2455,7 +2455,6 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, mutex_lock(&module_mutex); /* Drop initial reference. */ module_put(mod); - trim_init_extable(mod); module_free(mod, mod->module_init); mod->module_init = NULL; mod->init_size = 0; diff --git a/lib/extable.c b/lib/extable.c index 14f7dabfdd75..179c08745595 100644 --- a/lib/extable.c +++ b/lib/extable.c @@ -39,23 +39,6 @@ void sort_extable(struct exception_table_entry *start, sort(start, finish - start, sizeof(struct exception_table_entry), cmp_ex, NULL); } - -/* - * If the exception table is sorted, any referring to the module init - * will be at the beginning or the end. - */ -void trim_init_extable(struct module *m) -{ - /*trim the beginning*/ - while (m->num_exentries && within_module_init(m->extable[0].insn, m)) { - m->extable++; - m->num_exentries--; - } - /*trim the end*/ - while (m->num_exentries && - within_module_init(m->extable[m->num_exentries-1].insn, m)) - m->num_exentries--; -} #endif #ifndef ARCH_HAS_SEARCH_EXTABLE |