Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: Use generic extable search and sort routines

Switch to the generic extable search and sort routines which were introduced
with commit a272858 from Ard Biesheuvel. This saves quite some memory in the
vmlinux binary with the 64bit kernel.

Signed-off-by: Helge Deller <deller@gmx.de>

+9 -11
+1
arch/parisc/Kconfig
··· 11 11 select RTC_DRV_GENERIC 12 12 select INIT_ALL_POSSIBLE 13 13 select BUG 14 + select BUILDTIME_EXTABLE_SORT 14 15 select HAVE_PERF_EVENTS 15 16 select GENERIC_ATOMIC64 if !64BIT 16 17 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+1 -1
arch/parisc/include/asm/assembly.h
··· 523 523 */ 524 524 #define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \ 525 525 .section __ex_table,"aw" ! \ 526 - ASM_ULONG_INSN fault_addr, except_addr ! \ 526 + .word (fault_addr - .), (except_addr - .) ! \ 527 527 .previous 528 528 529 529
+4 -3
arch/parisc/include/asm/uaccess.h
··· 60 60 * use a 32bit (unsigned int) address here. 61 61 */ 62 62 63 + #define ARCH_HAS_RELATIVE_EXTABLE 63 64 struct exception_table_entry { 64 - unsigned long insn; /* address of insn that is allowed to fault. */ 65 - unsigned long fixup; /* fixup routine */ 65 + int insn; /* relative address of insn that is allowed to fault. */ 66 + int fixup; /* relative address of fixup routine */ 66 67 }; 67 68 68 69 #define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\ 69 70 ".section __ex_table,\"aw\"\n" \ 70 - ASM_WORD_INSN #fault_addr ", " #except_addr "\n\t" \ 71 + ".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \ 71 72 ".previous\n" 72 73 73 74 /*
+2 -7
arch/parisc/mm/fault.c
··· 140 140 { 141 141 const struct exception_table_entry *fix; 142 142 143 - /* If we only stored 32bit addresses in the exception table we can drop 144 - * out if we faulted on a 64bit address. */ 145 - if ((sizeof(regs->iaoq[0]) > sizeof(fix->insn)) 146 - && (regs->iaoq[0] >> 32)) 147 - return 0; 148 - 149 143 fix = search_exception_tables(regs->iaoq[0]); 150 144 if (fix) { 151 145 struct exception_data *d; ··· 148 154 d->fault_space = regs->isr; 149 155 d->fault_addr = regs->ior; 150 156 151 - regs->iaoq[0] = ((fix->fixup) & ~3); 157 + regs->iaoq[0] = (unsigned long)&fix->fixup + fix->fixup; 158 + regs->iaoq[0] &= ~3; 152 159 /* 153 160 * NOTE: In some cases the faulting instruction 154 161 * may be in the delay slot of a branch. We
+1
scripts/sortextable.c
··· 315 315 316 316 case EM_S390: 317 317 case EM_AARCH64: 318 + case EM_PARISC: 318 319 custom_sort = sort_relative_table; 319 320 break; 320 321 case EM_ARCOMPACT: