Skip to content

Commit

Permalink
arm64: Unmask asynchronous aborts when in kernel mode
Browse files Browse the repository at this point in the history
The asynchronous aborts are generally fatal for the kernel but they can
be masked via the pstate A bit. If a system error happens while in
kernel mode, it won't be visible until returning to user space. This
patch enables this kind of abort early to help identifying the cause.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Catalin Marinas committed Nov 25, 2013
1 parent df503ba commit b3bf6aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ static inline void arch_local_irq_disable(void)
#define local_fiq_enable() asm("msr daifclr, #1" : : : "memory")
#define local_fiq_disable() asm("msr daifset, #1" : : : "memory")

#define local_async_enable() asm("msr daifclr, #4" : : : "memory")
#define local_async_disable() asm("msr daifset, #4" : : : "memory")

/*
* Save the current interrupt enable state.
*/
Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };

void __init setup_arch(char **cmdline_p)
{
/*
* Unmask asynchronous aborts early to catch possible system errors.
*/
local_async_enable();

setup_processor();

setup_machine_fdt(__fdt_pointer);
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ asmlinkage void secondary_start_kernel(void)

local_irq_enable();
local_fiq_enable();
local_async_enable();

/*
* OK, it's off to the idle thread for us
Expand Down

0 comments on commit b3bf6aa

Please sign in to comment.