Commit 0de79858 authored by Helge Deller's avatar Helge Deller

parisc: Use generic extable search and sort routines

Switch to the generic extable search and sort routines which were introduced
with commit a272858a from Ard Biesheuvel. This saves quite some memory in the
vmlinux binary with the 64bit kernel.
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent c95a23da
...@@ -11,6 +11,7 @@ config PARISC ...@@ -11,6 +11,7 @@ config PARISC
select RTC_DRV_GENERIC select RTC_DRV_GENERIC
select INIT_ALL_POSSIBLE select INIT_ALL_POSSIBLE
select BUG select BUG
select BUILDTIME_EXTABLE_SORT
select HAVE_PERF_EVENTS select HAVE_PERF_EVENTS
select GENERIC_ATOMIC64 if !64BIT select GENERIC_ATOMIC64 if !64BIT
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
......
...@@ -523,7 +523,7 @@ ...@@ -523,7 +523,7 @@
*/ */
#define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \ #define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \
.section __ex_table,"aw" ! \ .section __ex_table,"aw" ! \
ASM_ULONG_INSN fault_addr, except_addr ! \ .word (fault_addr - .), (except_addr - .) ! \
.previous .previous
......
...@@ -60,14 +60,15 @@ static inline long access_ok(int type, const void __user * addr, ...@@ -60,14 +60,15 @@ static inline long access_ok(int type, const void __user * addr,
* use a 32bit (unsigned int) address here. * use a 32bit (unsigned int) address here.
*/ */
#define ARCH_HAS_RELATIVE_EXTABLE
struct exception_table_entry { struct exception_table_entry {
unsigned long insn; /* address of insn that is allowed to fault. */ int insn; /* relative address of insn that is allowed to fault. */
unsigned long fixup; /* fixup routine */ int fixup; /* relative address of fixup routine */
}; };
#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\ #define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\
".section __ex_table,\"aw\"\n" \ ".section __ex_table,\"aw\"\n" \
ASM_WORD_INSN #fault_addr ", " #except_addr "\n\t" \ ".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \
".previous\n" ".previous\n"
/* /*
......
...@@ -140,12 +140,6 @@ int fixup_exception(struct pt_regs *regs) ...@@ -140,12 +140,6 @@ int fixup_exception(struct pt_regs *regs)
{ {
const struct exception_table_entry *fix; const struct exception_table_entry *fix;
/* If we only stored 32bit addresses in the exception table we can drop
* out if we faulted on a 64bit address. */
if ((sizeof(regs->iaoq[0]) > sizeof(fix->insn))
&& (regs->iaoq[0] >> 32))
return 0;
fix = search_exception_tables(regs->iaoq[0]); fix = search_exception_tables(regs->iaoq[0]);
if (fix) { if (fix) {
struct exception_data *d; struct exception_data *d;
...@@ -154,7 +148,8 @@ int fixup_exception(struct pt_regs *regs) ...@@ -154,7 +148,8 @@ int fixup_exception(struct pt_regs *regs)
d->fault_space = regs->isr; d->fault_space = regs->isr;
d->fault_addr = regs->ior; d->fault_addr = regs->ior;
regs->iaoq[0] = ((fix->fixup) & ~3); regs->iaoq[0] = (unsigned long)&fix->fixup + fix->fixup;
regs->iaoq[0] &= ~3;
/* /*
* NOTE: In some cases the faulting instruction * NOTE: In some cases the faulting instruction
* may be in the delay slot of a branch. We * may be in the delay slot of a branch. We
......
...@@ -315,6 +315,7 @@ do_file(char const *const fname) ...@@ -315,6 +315,7 @@ do_file(char const *const fname)
case EM_S390: case EM_S390:
case EM_AARCH64: case EM_AARCH64:
case EM_PARISC:
custom_sort = sort_relative_table; custom_sort = sort_relative_table;
break; break;
case EM_ARCOMPACT: case EM_ARCOMPACT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment