Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00b06fb3 authored by Laura Abbott's avatar Laura Abbott Committed by Rohit Vaswani
Browse files

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.

Change-Id: I336aa1426c0e1c0ae64d1903c03e5ef492ac2fea
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
Tested-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Git-commit: fcff588633e848aa728a4437ef96d437299ba03d
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[hanumant@codeaurora.org: Resolve minor merge conflicts]
Signed-off-by: default avatarHanumant Singh <hanumant@codeaurora.org>
parent 861a4ae9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@

#include <asm-generic/irq.h>

extern void (*handle_arch_irq)(struct pt_regs *);
extern void migrate_irqs(void);
extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));

+2 −4
Original line number Diff line number Diff line
@@ -168,7 +168,8 @@ tsk .req x28 // current thread_info
 * Interrupt handling.
 */
	.macro	irq_handler
	ldr	x1, handle_arch_irq
	adrp	x1, handle_arch_irq
	ldr	x1, [x1, #:lo12:handle_arch_irq]
	mov	x0, sp
	blr	x1
	.endm
@@ -708,6 +709,3 @@ ENTRY(sys_rt_sigreturn_wrapper)
	mov	x0, sp
	b	sys_rt_sigreturn
ENDPROC(sys_rt_sigreturn_wrapper)

ENTRY(handle_arch_irq)
	.quad	0
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ int arch_show_interrupts(struct seq_file *p, int prec)
	return 0;
}

void (*handle_arch_irq)(struct pt_regs *) = NULL;

void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
{
	if (handle_arch_irq)