diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-09-05 07:26:11 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-09-26 09:45:10 -0400 |
commit | eb608fb366de123a97227437e5306f731f4a63c5 (patch) | |
tree | 6466e9b0bcd942457e0aa251af48816e3e925d90 /arch/s390/include | |
parent | 24996edce547fd981c089db9a12717fd76a51160 (diff) |
s390/exceptions: switch to relative exception table entries
This is the s390 port of 70627654 "x86, extable: Switch to relative
exception table entries".
Reduces the size of our exception tables by 50% on 64 bit builds.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/processor.h | 42 | ||||
-rw-r--r-- | arch/s390/include/asm/uaccess.h | 15 |
2 files changed, 38 insertions, 19 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 7e81ff17a89b..f3e0aabfc6bc 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_S390_PROCESSOR_H | 11 | #ifndef __ASM_S390_PROCESSOR_H |
12 | #define __ASM_S390_PROCESSOR_H | 12 | #define __ASM_S390_PROCESSOR_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
14 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
15 | #include <linux/irqflags.h> | 17 | #include <linux/irqflags.h> |
16 | #include <asm/cpu.h> | 18 | #include <asm/cpu.h> |
@@ -348,23 +350,6 @@ extern void (*s390_base_ext_handler_fn)(void); | |||
348 | 350 | ||
349 | #define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL | 351 | #define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL |
350 | 352 | ||
351 | /* | ||
352 | * Helper macro for exception table entries | ||
353 | */ | ||
354 | #ifndef CONFIG_64BIT | ||
355 | #define EX_TABLE(_fault,_target) \ | ||
356 | ".section __ex_table,\"a\"\n" \ | ||
357 | " .align 4\n" \ | ||
358 | " .long " #_fault "," #_target "\n" \ | ||
359 | ".previous\n" | ||
360 | #else | ||
361 | #define EX_TABLE(_fault,_target) \ | ||
362 | ".section __ex_table,\"a\"\n" \ | ||
363 | " .align 8\n" \ | ||
364 | " .quad " #_fault "," #_target "\n" \ | ||
365 | ".previous\n" | ||
366 | #endif | ||
367 | |||
368 | extern int memcpy_real(void *, void *, size_t); | 353 | extern int memcpy_real(void *, void *, size_t); |
369 | extern void memcpy_absolute(void *, void *, size_t); | 354 | extern void memcpy_absolute(void *, void *, size_t); |
370 | 355 | ||
@@ -375,4 +360,25 @@ extern void memcpy_absolute(void *, void *, size_t); | |||
375 | memcpy_absolute(&(dest), &__tmp, sizeof(__tmp)); \ | 360 | memcpy_absolute(&(dest), &__tmp, sizeof(__tmp)); \ |
376 | } | 361 | } |
377 | 362 | ||
378 | #endif /* __ASM_S390_PROCESSOR_H */ | 363 | /* |
364 | * Helper macro for exception table entries | ||
365 | */ | ||
366 | #define EX_TABLE(_fault, _target) \ | ||
367 | ".section __ex_table,\"a\"\n" \ | ||
368 | ".align 4\n" \ | ||
369 | ".long (" #_fault ") - .\n" \ | ||
370 | ".long (" #_target ") - .\n" \ | ||
371 | ".previous\n" | ||
372 | |||
373 | #else /* __ASSEMBLY__ */ | ||
374 | |||
375 | #define EX_TABLE(_fault, _target) \ | ||
376 | .section __ex_table,"a" ; \ | ||
377 | .align 4 ; \ | ||
378 | .long (_fault) - . ; \ | ||
379 | .long (_target) - . ; \ | ||
380 | .previous | ||
381 | |||
382 | #endif /* __ASSEMBLY__ */ | ||
383 | |||
384 | #endif /* __ASM_S390_PROCESSOR_H */ | ||
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index a8ab18b18b54..34268df959a3 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h | |||
@@ -76,9 +76,22 @@ static inline int __range_ok(unsigned long addr, unsigned long size) | |||
76 | 76 | ||
77 | struct exception_table_entry | 77 | struct exception_table_entry |
78 | { | 78 | { |
79 | unsigned long insn, fixup; | 79 | int insn, fixup; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static inline unsigned long extable_insn(const struct exception_table_entry *x) | ||
83 | { | ||
84 | return (unsigned long)&x->insn + x->insn; | ||
85 | } | ||
86 | |||
87 | static inline unsigned long extable_fixup(const struct exception_table_entry *x) | ||
88 | { | ||
89 | return (unsigned long)&x->fixup + x->fixup; | ||
90 | } | ||
91 | |||
92 | #define ARCH_HAS_SORT_EXTABLE | ||
93 | #define ARCH_HAS_SEARCH_EXTABLE | ||
94 | |||
82 | struct uaccess_ops { | 95 | struct uaccess_ops { |
83 | size_t (*copy_from_user)(size_t, const void __user *, void *); | 96 | size_t (*copy_from_user)(size_t, const void __user *, void *); |
84 | size_t (*copy_from_user_small)(size_t, const void __user *, void *); | 97 | size_t (*copy_from_user_small)(size_t, const void __user *, void *); |