summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/alternative.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-01-01 15:02:12 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2016-02-24 15:57:26 +0100
commit6c94f27ac847ff8ef15b3da5b200574923bd6287 (patch)
treee7a5384289c44b3d10a0ffb92dd7fb912998cfa6 /arch/arm64/include/asm/alternative.h
parentextable: add support for relative extables to search and sort routines (diff)
downloadlinux-6c94f27ac847ff8ef15b3da5b200574923bd6287.tar.xz
linux-6c94f27ac847ff8ef15b3da5b200574923bd6287.zip
arm64: switch to relative exception tables
Instead of using absolute addresses for both the exception location and the fixup, use offsets relative to the exception table entry values. Not only does this cut the size of the exception table in half, it is also a prerequisite for KASLR, since absolute exception table entries are subject to dynamic relocation, which is incompatible with the sorting of the exception table that occurs at build time. This patch also introduces the _ASM_EXTABLE preprocessor macro (which exists on x86 as well) and its _asm_extable assembly counterpart, as shorthands to emit exception table entries. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/alternative.h')
-rw-r--r--arch/arm64/include/asm/alternative.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
index a9fc24ec1aa9..beccbdefa106 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
@@ -157,11 +157,8 @@ void apply_alternatives(void *start, size_t length);
add \addr, \addr, \post_inc;
alternative_endif
- .section __ex_table,"a";
- .align 3;
- .quad 8888b,\l;
- .quad 8889b,\l;
- .previous;
+ _asm_extable 8888b,\l;
+ _asm_extable 8889b,\l;
.endm
.macro uao_stp l, reg1, reg2, addr, post_inc
@@ -175,11 +172,8 @@ void apply_alternatives(void *start, size_t length);
add \addr, \addr, \post_inc;
alternative_endif
- .section __ex_table,"a";
- .align 3;
- .quad 8888b,\l;
- .quad 8889b,\l;
- .previous
+ _asm_extable 8888b,\l;
+ _asm_extable 8889b,\l;
.endm
.macro uao_user_alternative l, inst, alt_inst, reg, addr, post_inc
@@ -191,10 +185,7 @@ void apply_alternatives(void *start, size_t length);
add \addr, \addr, \post_inc;
alternative_endif
- .section __ex_table,"a";
- .align 3;
- .quad 8888b,\l;
- .previous
+ _asm_extable 8888b,\l;
.endm
#else
.macro uao_ldp l, reg1, reg2, addr, post_inc