Commit d6316aae authored by Carlo Caione's avatar Carlo Caione Committed by Anas Nashif
Browse files

aarch64: Fix corrupted IRQ state when tracing enabled



The call to sys_trace_idle() is potentially clobbering x0 resulting in a
wrong value being used by the following code. Save and restore x0 before
and after the call to sys_trace_idle() to avoid any issue.

Signed-off-by: default avatarCarlo Caione <ccaione@baylibre.com>
Suggested-by: default avatarJames Harris <james.harris@intel.com>
parent b88bfde8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ SECTION_FUNC(TEXT, arch_cpu_idle)
GTEXT(arch_cpu_atomic_idle)
SECTION_FUNC(TEXT, arch_cpu_atomic_idle)
#ifdef CONFIG_TRACING
	stp	xzr, x30, [sp, #-16]!
	stp	x0, x30, [sp, #-16]!
	bl	sys_trace_idle
	ldp	xzr, x30, [sp], #16
	ldp	x0, x30, [sp], #16
#endif
	msr	daifset, #(DAIFSET_IRQ)
	isb