diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2014-11-21 16:50:38 -0500 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2014-11-25 10:56:44 -0500 |
commit | fcff588633e848aa728a4437ef96d437299ba03d (patch) | |
tree | 295e7b44cc0e9c6a8ba64304815b5b61b777cc6b /arch/arm64 | |
parent | 3eebdbe5fc7d64c7a6ef14cc5b8be518ffd563fa (diff) |
arm64: Treat handle_arch_irq as a function pointer
handle_arch_irq isn't actually text, it's just a function pointer.
It doesn't need to be stored in the text section and doing so
causes problesm if we ever want to make the kernel text read only.
Declare handle_arch_irq as a proper function pointer stored in
the data section.
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/asm/irq.h | 1 | ||||
-rw-r--r-- | arch/arm64/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/arm64/kernel/irq.c | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h index e1f7ecdde11f..1eebf5bb0b58 100644 --- a/arch/arm64/include/asm/irq.h +++ b/arch/arm64/include/asm/irq.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm-generic/irq.h> | 4 | #include <asm-generic/irq.h> |
5 | 5 | ||
6 | extern void (*handle_arch_irq)(struct pt_regs *); | ||
7 | extern void migrate_irqs(void); | 6 | extern void migrate_irqs(void); |
8 | extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); | 7 | extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); |
9 | 8 | ||
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 622a409916f3..99c8d13fc00d 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -167,7 +167,8 @@ tsk .req x28 // current thread_info | |||
167 | * Interrupt handling. | 167 | * Interrupt handling. |
168 | */ | 168 | */ |
169 | .macro irq_handler | 169 | .macro irq_handler |
170 | ldr x1, handle_arch_irq | 170 | adrp x1, handle_arch_irq |
171 | ldr x1, [x1, #:lo12:handle_arch_irq] | ||
171 | mov x0, sp | 172 | mov x0, sp |
172 | blr x1 | 173 | blr x1 |
173 | .endm | 174 | .endm |
@@ -699,6 +700,3 @@ ENTRY(sys_rt_sigreturn_wrapper) | |||
699 | mov x0, sp | 700 | mov x0, sp |
700 | b sys_rt_sigreturn | 701 | b sys_rt_sigreturn |
701 | ENDPROC(sys_rt_sigreturn_wrapper) | 702 | ENDPROC(sys_rt_sigreturn_wrapper) |
702 | |||
703 | ENTRY(handle_arch_irq) | ||
704 | .quad 0 | ||
diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c index 071a6ec13bd8..240b75c0e94f 100644 --- a/arch/arm64/kernel/irq.c +++ b/arch/arm64/kernel/irq.c | |||
@@ -40,6 +40,8 @@ int arch_show_interrupts(struct seq_file *p, int prec) | |||
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | 42 | ||
43 | void (*handle_arch_irq)(struct pt_regs *) = NULL; | ||
44 | |||
43 | void __init set_handle_irq(void (*handle_irq)(struct pt_regs *)) | 45 | void __init set_handle_irq(void (*handle_irq)(struct pt_regs *)) |
44 | { | 46 | { |
45 | if (handle_arch_irq) | 47 | if (handle_arch_irq) |