linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes
@ 2020-11-26 12:35 Mark Rutland
  2020-11-26 12:35 ` [PATCH 01/11] arm64: syscall: exit userspace before unmasking exceptions Mark Rutland
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

Hi,

Dmitry and Marco both reported some weirdness with lockdep on arm64 erroneously
reporting the hardware IRQ state, and inexplicable RCU stalls:

  https://lore.kernel.org/r/CACT4Y+aAzoJ48Mh1wNYD17pJqyEcDnrxGfApir=-j171TnQXhw@mail.gmail.com
  https://lore.kernel.org/r/20201119193819.GA2601289@elver.google.com

Having investigated, I believe that this is largely down to the arm64 entry
code not correctly managing RCU, lockdep, irq flag tracing, and context
tracking. This series attempts to fix those cases, and I've Cc'd folk from the
previous threads as a heads-up.

Today, the arm64 entry code:

* Doesn't correctly save/restore the lockdep/tracing view of the HW IRQ
  state, leaving this inconsistent.

* Doesn't correctly wake/sleep RCU arounds its use (e.g. by the IRQ tracing
  functions).

* Calls the context tracking functions (which wake and sleep RCU) at the wrong
  point w.r.t. lockdep, tracing.

Fixing all this requires reworking the entry/exit sequences along the lines of
the generic/x86 entry code. Moving arm64 over to the generic entry code
requires signficant changes to both arm64 and the generic code, so for now I've
added arm64-specific helpers to achieve the same thing. There's a lot of
cleanup we could do here as a follow-up, but for now I've tried to do the bare
minimum to make things work as expected without making it unmaintainable.

The patches are based on v5.10-rc3, and I've pushed them out to my
arm64/entry-fixes branch on kernel.org:

  git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/entry-fixes

Marco was able to test a WIP version of this, which seemed to address the
issues he was seeing. Since then I've had to alter the debug exception
handling, but I'm not expecting problems there. In future we'll want to make
more changes to the debug cases to align with x86, handling single-step,
watchpoints, and breakpoints as NMIs, but this will require significant
refactoring of the way we handle BRKs. For now I don't believe that there's a
major problem in practice with the approach taken in this series.

This version has seen an overnight soak under Syzkaller, where all the reports
I have so far look sound. I have been testing with additional debug patches:
  
  git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/entry-fixes

... which I do not think we should merge now, but intent to respin in future
with all the other cleanup.

While investigating this Peter and I spotted a latent issue in the core idle
code, for which peter has a patch queued in the tip locking/urgent branch:

  https://lore.kernel.org/r/20201120114925.594122626@infradead.org

... which the second patch in this series refers to.

Thanks,
Mark.

Mark Rutland (11):
  arm64: syscall: exit userspace before unmasking exceptions
  arm64: mark idle code as noinstr
  arm64: entry: mark entry code as noinstr
  arm64: entry: move enter_from_user_mode to entry-common.c
  arm64: entry: prepare ret_to_user for function call
  arm64: entry: move el1 irq/nmi logic to C
  arm64: entry: fix non-NMI user<->kernel transitions
  arm64: ptrace: prepare for EL1 irq/rcu tracking
  arm64: entry: fix non-NMI kernel<->kernel transitions
  arm64: entry: fix NMI {user,kernel}->kernel transitions
  arm64: entry: fix EL1 debug transitions

 arch/arm64/include/asm/daifflags.h |   3 +
 arch/arm64/include/asm/exception.h |   5 +
 arch/arm64/include/asm/ptrace.h    |   7 ++
 arch/arm64/kernel/entry-common.c   | 246 +++++++++++++++++++++++++++----------
 arch/arm64/kernel/entry.S          |  78 ++++--------
 arch/arm64/kernel/irq.c            |  15 ---
 arch/arm64/kernel/process.c        |   8 +-
 arch/arm64/kernel/sdei.c           |   7 +-
 arch/arm64/kernel/syscall.c        |   1 -
 arch/arm64/kernel/traps.c          |  22 ++--
 arch/arm64/mm/fault.c              |  25 ----
 11 files changed, 237 insertions(+), 180 deletions(-)

-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 01/11] arm64: syscall: exit userspace before unmasking exceptions
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-26 12:35 ` [PATCH 02/11] arm64: mark idle code as noinstr Mark Rutland
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

In el0_svc_common() we unmask exceptions before we call user_exit(), and
so there's a window where an IRQ or debug exception can be taken while
RCU is not watching. In do_debug_exception() we account for this in via
debug_exception_{enter,exit}(), but in the el1_irq asm we do not and we
call trace functions which rely on RCU before we have a guarantee that
RCU is watching.

Let's avoid this by having el0_svc_common() exit userspace before
unmasking exceptions, matching what we do for all other EL0 entry paths.
We can use user_exit_irqoff() to avoid the pointless save/restore of IRQ
flags while we're sure exceptions are masked in DAIF.

The workaround for Cortex-A76 erratum 1463225 may trigger a debug
exception before this point, but the debug code invoked in this case is
safe even when RCU is not watching.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
index e4c0dadf0d92..13fe79f8e2db 100644
--- a/arch/arm64/kernel/syscall.c
+++ b/arch/arm64/kernel/syscall.c
@@ -120,8 +120,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
 	 */
 
 	cortex_a76_erratum_1463225_svc_handler();
+	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
-	user_exit();
 
 	if (system_supports_mte() && (flags & _TIF_MTE_ASYNC_FAULT)) {
 		/*
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 02/11] arm64: mark idle code as noinstr
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
  2020-11-26 12:35 ` [PATCH 01/11] arm64: syscall: exit userspace before unmasking exceptions Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-26 12:35 ` [PATCH 03/11] arm64: entry: mark entry " Mark Rutland
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

Core code disables RCU when calling arch_cpu_idle(), so it's not safe
for arch_cpu_idle() or its calees to be instrumented, as the
instrumentation callbacks may attempt to use RCU or other features which
are unsafe to use in this context.

Mark them noinstr to prevent issues.

The use of local_irq_enable() in arch_cpu_idle() is similarly
problematic, and the "sched/idle: Fix arch_cpu_idle() vs tracing" patch
queued in the tip tree addresses that case.

Reported-by: Marco Elver <elver@google.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/process.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 4784011cecac..e6e2b8dc361e 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -72,13 +72,13 @@ EXPORT_SYMBOL_GPL(pm_power_off);
 
 void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
 
-static void __cpu_do_idle(void)
+static void noinstr __cpu_do_idle(void)
 {
 	dsb(sy);
 	wfi();
 }
 
-static void __cpu_do_idle_irqprio(void)
+static void noinstr __cpu_do_idle_irqprio(void)
 {
 	unsigned long pmr;
 	unsigned long daif_bits;
@@ -108,7 +108,7 @@ static void __cpu_do_idle_irqprio(void)
  *	ensure that interrupts are not masked at the PMR (because the core will
  *	not wake up if we block the wake up signal in the interrupt controller).
  */
-void cpu_do_idle(void)
+void noinstr cpu_do_idle(void)
 {
 	if (system_uses_irq_prio_masking())
 		__cpu_do_idle_irqprio();
@@ -119,7 +119,7 @@ void cpu_do_idle(void)
 /*
  * This is our default idle handler.
  */
-void arch_cpu_idle(void)
+void noinstr arch_cpu_idle(void)
 {
 	/*
 	 * This should do all the clock switching and wait for interrupt
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 03/11] arm64: entry: mark entry code as noinstr
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
  2020-11-26 12:35 ` [PATCH 01/11] arm64: syscall: exit userspace before unmasking exceptions Mark Rutland
  2020-11-26 12:35 ` [PATCH 02/11] arm64: mark idle code as noinstr Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-26 12:35 ` [PATCH 04/11] arm64: entry: move enter_from_user_mode to entry-common.c Mark Rutland
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

Functions in entry-common.c are marked as notrace and NOKPROBE_SYMBOL(),
but they're still subject to other instrumentation which may rely on
lockdep/rcu/context-tracking being up-to-date, and may cause nested
exceptions (e.g. for WARN/BUG or KASAN's use of BRK) which will corrupt
exceptions registers which have not yet been read.

Prevent this by marking all functions in entry-common.c as noinstr to
prevent compiler instrumentation. This also blacklists the functions for
tracing and kprobes, so we don't need to handle that separately.
Functions elsewhere will be dealt with in subsequent patches.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/entry-common.c | 75 ++++++++++++++--------------------------
 1 file changed, 25 insertions(+), 50 deletions(-)

diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 43d4c329775f..75e99161f79e 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -17,7 +17,7 @@
 #include <asm/mmu.h>
 #include <asm/sysreg.h>
 
-static void notrace el1_abort(struct pt_regs *regs, unsigned long esr)
+static void noinstr el1_abort(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
@@ -25,32 +25,28 @@ static void notrace el1_abort(struct pt_regs *regs, unsigned long esr)
 	far = untagged_addr(far);
 	do_mem_abort(far, esr, regs);
 }
-NOKPROBE_SYMBOL(el1_abort);
 
-static void notrace el1_pc(struct pt_regs *regs, unsigned long esr)
+static void noinstr el1_pc(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
 	local_daif_inherit(regs);
 	do_sp_pc_abort(far, esr, regs);
 }
-NOKPROBE_SYMBOL(el1_pc);
 
-static void notrace el1_undef(struct pt_regs *regs)
+static void noinstr el1_undef(struct pt_regs *regs)
 {
 	local_daif_inherit(regs);
 	do_undefinstr(regs);
 }
-NOKPROBE_SYMBOL(el1_undef);
 
-static void notrace el1_inv(struct pt_regs *regs, unsigned long esr)
+static void noinstr el1_inv(struct pt_regs *regs, unsigned long esr)
 {
 	local_daif_inherit(regs);
 	bad_mode(regs, 0, esr);
 }
-NOKPROBE_SYMBOL(el1_inv);
 
-static void notrace el1_dbg(struct pt_regs *regs, unsigned long esr)
+static void noinstr el1_dbg(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
@@ -64,16 +60,14 @@ static void notrace el1_dbg(struct pt_regs *regs, unsigned long esr)
 
 	do_debug_exception(far, esr, regs);
 }
-NOKPROBE_SYMBOL(el1_dbg);
 
-static void notrace el1_fpac(struct pt_regs *regs, unsigned long esr)
+static void noinstr el1_fpac(struct pt_regs *regs, unsigned long esr)
 {
 	local_daif_inherit(regs);
 	do_ptrauth_fault(regs, esr);
 }
-NOKPROBE_SYMBOL(el1_fpac);
 
-asmlinkage void notrace el1_sync_handler(struct pt_regs *regs)
+asmlinkage void noinstr el1_sync_handler(struct pt_regs *regs)
 {
 	unsigned long esr = read_sysreg(esr_el1);
 
@@ -106,9 +100,8 @@ asmlinkage void notrace el1_sync_handler(struct pt_regs *regs)
 		el1_inv(regs, esr);
 	}
 }
-NOKPROBE_SYMBOL(el1_sync_handler);
 
-static void notrace el0_da(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_da(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
@@ -117,9 +110,8 @@ static void notrace el0_da(struct pt_regs *regs, unsigned long esr)
 	far = untagged_addr(far);
 	do_mem_abort(far, esr, regs);
 }
-NOKPROBE_SYMBOL(el0_da);
 
-static void notrace el0_ia(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_ia(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
@@ -135,41 +127,36 @@ static void notrace el0_ia(struct pt_regs *regs, unsigned long esr)
 	local_daif_restore(DAIF_PROCCTX);
 	do_mem_abort(far, esr, regs);
 }
-NOKPROBE_SYMBOL(el0_ia);
 
-static void notrace el0_fpsimd_acc(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_fpsimd_acc(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_fpsimd_acc(esr, regs);
 }
-NOKPROBE_SYMBOL(el0_fpsimd_acc);
 
-static void notrace el0_sve_acc(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_sve_acc(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sve_acc(esr, regs);
 }
-NOKPROBE_SYMBOL(el0_sve_acc);
 
-static void notrace el0_fpsimd_exc(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_fpsimd_exc(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_fpsimd_exc(esr, regs);
 }
-NOKPROBE_SYMBOL(el0_fpsimd_exc);
 
-static void notrace el0_sys(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_sys(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sysinstr(esr, regs);
 }
-NOKPROBE_SYMBOL(el0_sys);
 
-static void notrace el0_pc(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_pc(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
@@ -180,41 +167,36 @@ static void notrace el0_pc(struct pt_regs *regs, unsigned long esr)
 	local_daif_restore(DAIF_PROCCTX);
 	do_sp_pc_abort(far, esr, regs);
 }
-NOKPROBE_SYMBOL(el0_pc);
 
-static void notrace el0_sp(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_sp(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sp_pc_abort(regs->sp, esr, regs);
 }
-NOKPROBE_SYMBOL(el0_sp);
 
-static void notrace el0_undef(struct pt_regs *regs)
+static void noinstr el0_undef(struct pt_regs *regs)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_undefinstr(regs);
 }
-NOKPROBE_SYMBOL(el0_undef);
 
-static void notrace el0_bti(struct pt_regs *regs)
+static void noinstr el0_bti(struct pt_regs *regs)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_bti(regs);
 }
-NOKPROBE_SYMBOL(el0_bti);
 
-static void notrace el0_inv(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_inv(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	bad_el0_sync(regs, 0, esr);
 }
-NOKPROBE_SYMBOL(el0_inv);
 
-static void notrace el0_dbg(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_dbg(struct pt_regs *regs, unsigned long esr)
 {
 	/* Only watchpoints write FAR_EL1, otherwise its UNKNOWN */
 	unsigned long far = read_sysreg(far_el1);
@@ -226,26 +208,23 @@ static void notrace el0_dbg(struct pt_regs *regs, unsigned long esr)
 	do_debug_exception(far, esr, regs);
 	local_daif_restore(DAIF_PROCCTX_NOIRQ);
 }
-NOKPROBE_SYMBOL(el0_dbg);
 
-static void notrace el0_svc(struct pt_regs *regs)
+static void noinstr el0_svc(struct pt_regs *regs)
 {
 	if (system_uses_irq_prio_masking())
 		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
 
 	do_el0_svc(regs);
 }
-NOKPROBE_SYMBOL(el0_svc);
 
-static void notrace el0_fpac(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_fpac(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_ptrauth_fault(regs, esr);
 }
-NOKPROBE_SYMBOL(el0_fpac);
 
-asmlinkage void notrace el0_sync_handler(struct pt_regs *regs)
+asmlinkage void noinstr el0_sync_handler(struct pt_regs *regs)
 {
 	unsigned long esr = read_sysreg(esr_el1);
 
@@ -297,27 +276,24 @@ asmlinkage void notrace el0_sync_handler(struct pt_regs *regs)
 		el0_inv(regs, esr);
 	}
 }
-NOKPROBE_SYMBOL(el0_sync_handler);
 
 #ifdef CONFIG_COMPAT
-static void notrace el0_cp15(struct pt_regs *regs, unsigned long esr)
+static void noinstr el0_cp15(struct pt_regs *regs, unsigned long esr)
 {
 	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 	do_cp15instr(esr, regs);
 }
-NOKPROBE_SYMBOL(el0_cp15);
 
-static void notrace el0_svc_compat(struct pt_regs *regs)
+static void noinstr el0_svc_compat(struct pt_regs *regs)
 {
 	if (system_uses_irq_prio_masking())
 		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
 
 	do_el0_svc_compat(regs);
 }
-NOKPROBE_SYMBOL(el0_svc_compat);
 
-asmlinkage void notrace el0_sync_compat_handler(struct pt_regs *regs)
+asmlinkage void noinstr el0_sync_compat_handler(struct pt_regs *regs)
 {
 	unsigned long esr = read_sysreg(esr_el1);
 
@@ -360,5 +336,4 @@ asmlinkage void notrace el0_sync_compat_handler(struct pt_regs *regs)
 		el0_inv(regs, esr);
 	}
 }
-NOKPROBE_SYMBOL(el0_sync_compat_handler);
 #endif /* CONFIG_COMPAT */
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 04/11] arm64: entry: move enter_from_user_mode to entry-common.c
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (2 preceding siblings ...)
  2020-11-26 12:35 ` [PATCH 03/11] arm64: entry: mark entry " Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-26 12:35 ` [PATCH 05/11] arm64: entry: prepare ret_to_user for function call Mark Rutland
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

In later patches we'll want to extend enter_from_user_mode() and add a
corresponding exit_to_user_mode(). As these will be common for all
entries/exits from userspace, it'd be better for these to live in
entry-common.c with the rest of the entry logic.

This patch moves enter_from_user_mode() into entry-common.c. As with
other functions in entry-common.c it is marked as noinstr (which
prevents all instrumentation, tracing, and kprobes) but there are no
other functional changes.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/entry-common.c | 6 ++++++
 arch/arm64/kernel/traps.c        | 7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 75e99161f79e..9a685e7686fe 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -101,6 +101,12 @@ asmlinkage void noinstr el1_sync_handler(struct pt_regs *regs)
 	}
 }
 
+asmlinkage void noinstr enter_from_user_mode(void)
+{
+	CT_WARN_ON(ct_state() != CONTEXT_USER);
+	user_exit_irqoff();
+}
+
 static void noinstr el0_da(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 8af4e0e85736..580c60afc39a 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -876,13 +876,6 @@ asmlinkage void do_serror(struct pt_regs *regs, unsigned int esr)
 	nmi_exit();
 }
 
-asmlinkage void enter_from_user_mode(void)
-{
-	CT_WARN_ON(ct_state() != CONTEXT_USER);
-	user_exit_irqoff();
-}
-NOKPROBE_SYMBOL(enter_from_user_mode);
-
 /* GENERIC_BUG traps */
 
 int is_valid_bugaddr(unsigned long addr)
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 05/11] arm64: entry: prepare ret_to_user for function call
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (3 preceding siblings ...)
  2020-11-26 12:35 ` [PATCH 04/11] arm64: entry: move enter_from_user_mode to entry-common.c Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-26 12:35 ` [PATCH 06/11] arm64: entry: move el1 irq/nmi logic to C Mark Rutland
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

In a subsequent patch ret_to_user will need to make a C function call
(in some configurations) which may clobber x0-x18 at the start of the
finish_ret_to_user block, before enable_step_tsk consumes the flags
loaded into x1.

In preparation for this, let's load the flags into x19, which is
preserved across C function calls. This avoids a redundant reload of the
flags and ensures we operate on a consistent shapshot regardless.

There should be no functional change as a result of this patch. At this
point of the entry/exit paths we only need to preserve x28 (tsk) and the
sp, and x19 is free for this use.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/entry.S | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index b295fb912b12..84aec600eeed 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -774,13 +774,13 @@ SYM_CODE_END(el0_error)
 SYM_CODE_START_LOCAL(ret_to_user)
 	disable_daif
 	gic_prio_kentry_setup tmp=x3
-	ldr	x1, [tsk, #TSK_TI_FLAGS]
-	and	x2, x1, #_TIF_WORK_MASK
+	ldr	x19, [tsk, #TSK_TI_FLAGS]
+	and	x2, x19, #_TIF_WORK_MASK
 	cbnz	x2, work_pending
 finish_ret_to_user:
 	/* Ignore asynchronous tag check faults in the uaccess routines */
 	clear_mte_async_tcf
-	enable_step_tsk x1, x2
+	enable_step_tsk x19, x2
 #ifdef CONFIG_GCC_PLUGIN_STACKLEAK
 	bl	stackleak_erase
 #endif
@@ -791,11 +791,12 @@ finish_ret_to_user:
  */
 work_pending:
 	mov	x0, sp				// 'regs'
+	mov	x1, x19
 	bl	do_notify_resume
 #ifdef CONFIG_TRACE_IRQFLAGS
 	bl	trace_hardirqs_on		// enabled while in userspace
 #endif
-	ldr	x1, [tsk, #TSK_TI_FLAGS]	// re-check for single-step
+	ldr	x19, [tsk, #TSK_TI_FLAGS]	// re-check for single-step
 	b	finish_ret_to_user
 SYM_CODE_END(ret_to_user)
 
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 06/11] arm64: entry: move el1 irq/nmi logic to C
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (4 preceding siblings ...)
  2020-11-26 12:35 ` [PATCH 05/11] arm64: entry: prepare ret_to_user for function call Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-26 12:35 ` [PATCH 07/11] arm64: entry: fix non-NMI user<->kernel transitions Mark Rutland
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

In preparation for reworking the EL1 irq/nmi entry code, move the
existing logic to C. We no longer need the asm_nmi_enter() and
asm_nmi_exit() wrappers, so these are removed. The new C functions are
marked noinstr, which prevents compiler instrumentation and runtime
probing.

In subsequent patches we'll want the new C helpers to be called in all
cases, so we don't bother wrapping the calls with ifdeferry. Even when
the new C functions are stubs the trivial calls are unlikely to have a
measurable impact on the IRQ or NMI paths anyway.

Prototypes are added to <asm/exception.h> as otherwise (in some
configurations) GCC will complain about the lack of a forward
declaration. We already do this for existing function, e.g.
enter_from_user_mode().

The new helpers are marked as noinstr (which prevents all
instrumentation, tracing, and kprobes). Otherwise, there should be no
functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/include/asm/exception.h |  2 ++
 arch/arm64/kernel/entry-common.c   | 16 ++++++++++++++++
 arch/arm64/kernel/entry.S          | 34 ++++------------------------------
 arch/arm64/kernel/irq.c            | 15 ---------------
 4 files changed, 22 insertions(+), 45 deletions(-)

diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h
index 99b9383cd036..d69d53dd7be7 100644
--- a/arch/arm64/include/asm/exception.h
+++ b/arch/arm64/include/asm/exception.h
@@ -31,6 +31,8 @@ static inline u32 disr_to_esr(u64 disr)
 	return esr;
 }
 
+asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs);
+asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs);
 asmlinkage void enter_from_user_mode(void);
 void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
 void do_undefinstr(struct pt_regs *regs);
diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 9a685e7686fe..920da254be1d 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -17,6 +17,22 @@
 #include <asm/mmu.h>
 #include <asm/sysreg.h>
 
+asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs)
+{
+	if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
+		nmi_enter();
+
+	trace_hardirqs_off();
+}
+
+asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs)
+{
+	if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
+		nmi_exit();
+	else
+		trace_hardirqs_on();
+}
+
 static void noinstr el1_abort(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 84aec600eeed..53e30750fc28 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -637,16 +637,8 @@ SYM_CODE_START_LOCAL_NOALIGN(el1_irq)
 	gic_prio_irq_setup pmr=x20, tmp=x1
 	enable_da_f
 
-#ifdef CONFIG_ARM64_PSEUDO_NMI
-	test_irqs_unmasked	res=x0, pmr=x20
-	cbz	x0, 1f
-	bl	asm_nmi_enter
-1:
-#endif
-
-#ifdef CONFIG_TRACE_IRQFLAGS
-	bl	trace_hardirqs_off
-#endif
+	mov	x0, sp
+	bl	enter_el1_irq_or_nmi
 
 	irq_handler
 
@@ -665,26 +657,8 @@ alternative_else_nop_endif
 1:
 #endif
 
-#ifdef CONFIG_ARM64_PSEUDO_NMI
-	/*
-	 * When using IRQ priority masking, we can get spurious interrupts while
-	 * PMR is set to GIC_PRIO_IRQOFF. An NMI might also have occurred in a
-	 * section with interrupts disabled. Skip tracing in those cases.
-	 */
-	test_irqs_unmasked	res=x0, pmr=x20
-	cbz	x0, 1f
-	bl	asm_nmi_exit
-1:
-#endif
-
-#ifdef CONFIG_TRACE_IRQFLAGS
-#ifdef CONFIG_ARM64_PSEUDO_NMI
-	test_irqs_unmasked	res=x0, pmr=x20
-	cbnz	x0, 1f
-#endif
-	bl	trace_hardirqs_on
-1:
-#endif
+	mov	x0, sp
+	bl	exit_el1_irq_or_nmi
 
 	kernel_exit 1
 SYM_CODE_END(el1_irq)
diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c
index 9cf2fb87584a..60456a62da11 100644
--- a/arch/arm64/kernel/irq.c
+++ b/arch/arm64/kernel/irq.c
@@ -67,18 +67,3 @@ void __init init_IRQ(void)
 		local_daif_restore(DAIF_PROCCTX_NOIRQ);
 	}
 }
-
-/*
- * Stubs to make nmi_enter/exit() code callable from ASM
- */
-asmlinkage void notrace asm_nmi_enter(void)
-{
-	nmi_enter();
-}
-NOKPROBE_SYMBOL(asm_nmi_enter);
-
-asmlinkage void notrace asm_nmi_exit(void)
-{
-	nmi_exit();
-}
-NOKPROBE_SYMBOL(asm_nmi_exit);
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 07/11] arm64: entry: fix non-NMI user<->kernel transitions
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (5 preceding siblings ...)
  2020-11-26 12:35 ` [PATCH 06/11] arm64: entry: move el1 irq/nmi logic to C Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-30 11:22   ` Will Deacon
  2020-11-26 12:35 ` [PATCH 08/11] arm64: ptrace: prepare for EL1 irq/rcu tracking Mark Rutland
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

When built with PROVE_LOCKING, NO_HZ_FULL, and CONTEXT_TRACKING_FORCE
will WARN() at boot time that interrupts are enabled when we call
context_tracking_user_enter(), despite the DAIF flags indicating that
IRQs are masked.

The problem is that we're not tracking IRQ flag changes accurately, and
so lockdep believes interrupts are enabled when they are not (and
vice-versa). We can shuffle things so to make this more accurate. For
kernel->user transitions there are a number of constraints we need to
consider:

1) When we call __context_tracking_user_enter() HW IRQs must be disabled
   and lockdep must be up-to-date with this.

2) Userspace should be treated as having IRQs enabled from the PoV of
   both lockdep and tracing.

3) As context_tracking_user_enter() stops RCU from watching, we cannot
   use RCU after calling it.

4) IRQ flag tracing and lockdep have state that must be manipulated
   before RCU is disabled.

... with similar constraints applying for user->kernel transitions, with
the ordering reversed.

The generic entry code has enter_from_user_mode() and
exit_to_user_mode() helpers to handle this. We can't use those directly,
so we add arm64 copies for now (without the instrumentation markers
which aren't used on arm64). These replace the existing user_exit() and
user_exit_irqoff() calls spread throughout handlers, and the exception
unmasking is left as-is.

Note that:

* The accounting for debug exceptions from userspace now happens in
  el0_dbg() and ret_to_user(), so this is removed from
  debug_exception_enter() and debug_exception_exit(). As
  user_exit_irqoff() wakes RCU, the userspace-specific check is removed.

* The accounting for syscalls now happens in el0_svc(),
  el0_svc_compat(), and ret_to_user(), so this is removed from
  el0_svc_common(). This does not adversely affect the workaround for
  erratum 1463225, as this does not depend on any of the state tracking.

* In ret_to_user() we mask interrupts with local_daif_mask(), and so we
  need to inform lockdep and tracing. Here a trace_hardirqs_off() is
  sufficient and safe as we have not yet exited kernel context and RCU
  is usable.

* As PROVE_LOCKING selects TRACE_IRQFLAGS, the ifdeferry in entry.S only
  needs to check for the latter.

* EL0 SError handling will be dealt with in a subsequent patch, as this
  needs to be treated as an NMI.

Prior to this patch, booting an appropriately-configured kernel would
result in spats as below:

| DEBUG_LOCKS_WARN_ON(lockdep_hardirqs_enabled())
| WARNING: CPU: 2 PID: 1 at kernel/locking/lockdep.c:5280 check_flags.part.54+0x1dc/0x1f0
| Modules linked in:
| CPU: 2 PID: 1 Comm: init Not tainted 5.10.0-rc3 #3
| Hardware name: linux,dummy-virt (DT)
| pstate: 804003c5 (Nzcv DAIF +PAN -UAO -TCO BTYPE=--)
| pc : check_flags.part.54+0x1dc/0x1f0
| lr : check_flags.part.54+0x1dc/0x1f0
| sp : ffff80001003bd80
| x29: ffff80001003bd80 x28: ffff66ce801e0000
| x27: 00000000ffffffff x26: 00000000000003c0
| x25: 0000000000000000 x24: ffffc31842527258
| x23: ffffc31842491368 x22: ffffc3184282d000
| x21: 0000000000000000 x20: 0000000000000001
| x19: ffffc318432ce000 x18: 0080000000000000
| x17: 0000000000000000 x16: ffffc31840f18a78
| x15: 0000000000000001 x14: ffffc3184285c810
| x13: 0000000000000001 x12: 0000000000000000
| x11: ffffc318415857a0 x10: ffffc318406614c0
| x9 : ffffc318415857a0 x8 : ffffc31841f1d000
| x7 : 647261685f706564 x6 : ffffc3183ff7c66c
| x5 : ffff66ce801e0000 x4 : 0000000000000000
| x3 : ffffc3183fe00000 x2 : ffffc31841500000
| x1 : e956dc24146b3500 x0 : 0000000000000000
| Call trace:
|  check_flags.part.54+0x1dc/0x1f0
|  lock_is_held_type+0x10c/0x188
|  rcu_read_lock_sched_held+0x70/0x98
|  __context_tracking_enter+0x310/0x350
|  context_tracking_enter.part.3+0x5c/0xc8
|  context_tracking_user_enter+0x6c/0x80
|  finish_ret_to_user+0x2c/0x13cr

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/include/asm/exception.h |  1 +
 arch/arm64/kernel/entry-common.c   | 40 +++++++++++++++++++++++++-------------
 arch/arm64/kernel/entry.S          | 35 +++++++++++++--------------------
 arch/arm64/kernel/syscall.c        |  1 -
 arch/arm64/mm/fault.c              | 22 ++++++++++-----------
 5 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h
index d69d53dd7be7..d579b2e6db7a 100644
--- a/arch/arm64/include/asm/exception.h
+++ b/arch/arm64/include/asm/exception.h
@@ -34,6 +34,7 @@ static inline u32 disr_to_esr(u64 disr)
 asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs);
 asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs);
 asmlinkage void enter_from_user_mode(void);
+asmlinkage void exit_to_user_mode(void);
 void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
 void do_undefinstr(struct pt_regs *regs);
 void do_bti(struct pt_regs *regs);
diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 920da254be1d..49d1c1dd9baf 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -119,15 +119,25 @@ asmlinkage void noinstr el1_sync_handler(struct pt_regs *regs)
 
 asmlinkage void noinstr enter_from_user_mode(void)
 {
+	lockdep_hardirqs_off(CALLER_ADDR0);
 	CT_WARN_ON(ct_state() != CONTEXT_USER);
 	user_exit_irqoff();
+	trace_hardirqs_off_finish();
+}
+
+asmlinkage void noinstr exit_to_user_mode(void)
+{
+	trace_hardirqs_on_prepare();
+	lockdep_hardirqs_on_prepare(CALLER_ADDR0);
+	user_enter_irqoff();
+	lockdep_hardirqs_on(CALLER_ADDR0);
 }
 
 static void noinstr el0_da(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	far = untagged_addr(far);
 	do_mem_abort(far, esr, regs);
@@ -145,35 +155,35 @@ static void noinstr el0_ia(struct pt_regs *regs, unsigned long esr)
 	if (!is_ttbr0_addr(far))
 		arm64_apply_bp_hardening();
 
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_mem_abort(far, esr, regs);
 }
 
 static void noinstr el0_fpsimd_acc(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_fpsimd_acc(esr, regs);
 }
 
 static void noinstr el0_sve_acc(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sve_acc(esr, regs);
 }
 
 static void noinstr el0_fpsimd_exc(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_fpsimd_exc(esr, regs);
 }
 
 static void noinstr el0_sys(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sysinstr(esr, regs);
 }
@@ -185,35 +195,35 @@ static void noinstr el0_pc(struct pt_regs *regs, unsigned long esr)
 	if (!is_ttbr0_addr(instruction_pointer(regs)))
 		arm64_apply_bp_hardening();
 
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sp_pc_abort(far, esr, regs);
 }
 
 static void noinstr el0_sp(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_sp_pc_abort(regs->sp, esr, regs);
 }
 
 static void noinstr el0_undef(struct pt_regs *regs)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_undefinstr(regs);
 }
 
 static void noinstr el0_bti(struct pt_regs *regs)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_bti(regs);
 }
 
 static void noinstr el0_inv(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	bad_el0_sync(regs, 0, esr);
 }
@@ -226,7 +236,7 @@ static void noinstr el0_dbg(struct pt_regs *regs, unsigned long esr)
 	if (system_uses_irq_prio_masking())
 		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
 
-	user_exit_irqoff();
+	enter_from_user_mode();
 	do_debug_exception(far, esr, regs);
 	local_daif_restore(DAIF_PROCCTX_NOIRQ);
 }
@@ -236,12 +246,13 @@ static void noinstr el0_svc(struct pt_regs *regs)
 	if (system_uses_irq_prio_masking())
 		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
 
+	enter_from_user_mode();
 	do_el0_svc(regs);
 }
 
 static void noinstr el0_fpac(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_ptrauth_fault(regs, esr);
 }
@@ -302,7 +313,7 @@ asmlinkage void noinstr el0_sync_handler(struct pt_regs *regs)
 #ifdef CONFIG_COMPAT
 static void noinstr el0_cp15(struct pt_regs *regs, unsigned long esr)
 {
-	user_exit_irqoff();
+	enter_from_user_mode();
 	local_daif_restore(DAIF_PROCCTX);
 	do_cp15instr(esr, regs);
 }
@@ -312,6 +323,7 @@ static void noinstr el0_svc_compat(struct pt_regs *regs)
 	if (system_uses_irq_prio_masking())
 		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
 
+	enter_from_user_mode();
 	do_el0_svc_compat(regs);
 }
 
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 53e30750fc28..d17a68c24608 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -30,18 +30,18 @@
 #include <asm/unistd.h>
 
 /*
- * Context tracking subsystem.  Used to instrument transitions
- * between user and kernel mode.
+ * Context tracking and irqflag tracing need to inrstrument transitions between
+ * user and kernel mode.
  */
-	.macro ct_user_exit_irqoff
-#ifdef CONFIG_CONTEXT_TRACKING
+	.macro user_exit_irqoff
+#if defined(CONFIG_CONTEXT_TRACKING) || defined(CONFIG_TRACE_IRQFLAGS)
 	bl	enter_from_user_mode
 #endif
 	.endm
 
-	.macro ct_user_enter
-#ifdef CONFIG_CONTEXT_TRACKING
-	bl	context_tracking_user_enter
+	.macro user_enter_irqoff
+#if defined(CONFIG_CONTEXT_TRACKING) || defined(CONFIG_TRACE_IRQFLAGS)
+	bl	exit_to_user_mode
 #endif
 	.endm
 
@@ -298,9 +298,6 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKING
 alternative_else_nop_endif
 
 	ldp	x21, x22, [sp, #S_PC]		// load ELR, SPSR
-	.if	\el == 0
-	ct_user_enter
-	.endif
 
 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
 alternative_if_not ARM64_HAS_PAN
@@ -700,21 +697,14 @@ SYM_CODE_START_LOCAL_NOALIGN(el0_irq)
 	kernel_entry 0
 el0_irq_naked:
 	gic_prio_irq_setup pmr=x20, tmp=x0
-	ct_user_exit_irqoff
+	user_exit_irqoff
 	enable_da_f
 
-#ifdef CONFIG_TRACE_IRQFLAGS
-	bl	trace_hardirqs_off
-#endif
-
 	tbz	x22, #55, 1f
 	bl	do_el0_irq_bp_hardening
 1:
 	irq_handler
 
-#ifdef CONFIG_TRACE_IRQFLAGS
-	bl	trace_hardirqs_on
-#endif
 	b	ret_to_user
 SYM_CODE_END(el0_irq)
 
@@ -733,7 +723,7 @@ SYM_CODE_START_LOCAL(el0_error)
 el0_error_naked:
 	mrs	x25, esr_el1
 	gic_prio_kentry_setup tmp=x2
-	ct_user_exit_irqoff
+	user_exit_irqoff
 	enable_dbg
 	mov	x0, sp
 	mov	x1, x25
@@ -748,10 +738,14 @@ SYM_CODE_END(el0_error)
 SYM_CODE_START_LOCAL(ret_to_user)
 	disable_daif
 	gic_prio_kentry_setup tmp=x3
+#ifdef CONFIG_TRACE_IRQFLAGS
+	bl	trace_hardirqs_off
+#endif
 	ldr	x19, [tsk, #TSK_TI_FLAGS]
 	and	x2, x19, #_TIF_WORK_MASK
 	cbnz	x2, work_pending
 finish_ret_to_user:
+	user_enter_irqoff
 	/* Ignore asynchronous tag check faults in the uaccess routines */
 	clear_mte_async_tcf
 	enable_step_tsk x19, x2
@@ -767,9 +761,6 @@ work_pending:
 	mov	x0, sp				// 'regs'
 	mov	x1, x19
 	bl	do_notify_resume
-#ifdef CONFIG_TRACE_IRQFLAGS
-	bl	trace_hardirqs_on		// enabled while in userspace
-#endif
 	ldr	x19, [tsk, #TSK_TI_FLAGS]	// re-check for single-step
 	b	finish_ret_to_user
 SYM_CODE_END(ret_to_user)
diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
index 13fe79f8e2db..f8f758e4a306 100644
--- a/arch/arm64/kernel/syscall.c
+++ b/arch/arm64/kernel/syscall.c
@@ -120,7 +120,6 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
 	 */
 
 	cortex_a76_erratum_1463225_svc_handler();
-	user_exit_irqoff();
 	local_daif_restore(DAIF_PROCCTX);
 
 	if (system_supports_mte() && (flags & _TIF_MTE_ASYNC_FAULT)) {
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 1ee94002801f..1f450b784d2c 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -789,16 +789,14 @@ void __init hook_debug_fault_code(int nr,
  */
 static void debug_exception_enter(struct pt_regs *regs)
 {
-	/*
-	 * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
-	 * already disabled to preserve the last enabled/disabled addresses.
-	 */
-	if (interrupts_enabled(regs))
-		trace_hardirqs_off();
+	if (!user_mode(regs)) {
+		/*
+		 * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
+		 * already disabled to preserve the last enabled/disabled addresses.
+		 */
+		if (interrupts_enabled(regs))
+			trace_hardirqs_off();
 
-	if (user_mode(regs)) {
-		RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
-	} else {
 		/*
 		 * We might have interrupted pretty much anything.  In
 		 * fact, if we're a debug exception, we can even interrupt
@@ -819,8 +817,10 @@ static void debug_exception_exit(struct pt_regs *regs)
 {
 	preempt_enable_no_resched();
 
-	if (!user_mode(regs))
-		rcu_nmi_exit();
+	if (user_mode(regs))
+		return;
+
+	rcu_nmi_exit();
 
 	if (interrupts_enabled(regs))
 		trace_hardirqs_on();
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 08/11] arm64: ptrace: prepare for EL1 irq/rcu tracking
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (6 preceding siblings ...)
  2020-11-26 12:35 ` [PATCH 07/11] arm64: entry: fix non-NMI user<->kernel transitions Mark Rutland
@ 2020-11-26 12:35 ` Mark Rutland
  2020-11-30 11:01   ` Will Deacon
  2020-11-26 12:36 ` [PATCH 09/11] arm64: entry: fix non-NMI kernel<->kernel transitions Mark Rutland
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

Exceptions from EL1 may be taken when RCU isn't watching (e.g. in idle
sequences), or when the lockdep hardirqs transiently out-of-sync with
the hardware state (e.g. in the middle of local_irq_enable()). To
correctly handle these cases, we'll need to save/restore this state
across some exceptions taken from EL1.

A series of subsequent patches will update EL1 exception handlers to
handle this. In preparation for this, and to avoid dependencies between
those patches, this patch adds two new fields to struct pt_regs so that
exception handlers can track this state.

Note that this is placed in pt_regs as some entry/exit sequences such as
el1_irq are invoked from assembly, which makes it very difficult to add
a separate structure as with the irqentry_state used by x86. We can
separate this once more of the exception logic is moved to C. While the
fields only need to be bool, they are both made u64 to keep pt_regs
16-bite aligned.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/include/asm/ptrace.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 997cf8c8cd52..b4a841d9511d 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -193,6 +193,13 @@ struct pt_regs {
 	/* Only valid when ARM64_HAS_IRQ_PRIO_MASKING is enabled. */
 	u64 pmr_save;
 	u64 stackframe[2];
+
+	/*
+	 * Only valid for some EL1 exceptions.
+	 * TODO: move this out of pt_regs.
+	 */
+	u64 lockdep_hardirqs;
+	u64 exit_rcu;
 };
 
 static inline bool in_syscall(struct pt_regs const *regs)
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 09/11] arm64: entry: fix non-NMI kernel<->kernel transitions
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (7 preceding siblings ...)
  2020-11-26 12:35 ` [PATCH 08/11] arm64: ptrace: prepare for EL1 irq/rcu tracking Mark Rutland
@ 2020-11-26 12:36 ` Mark Rutland
  2020-11-30 11:22   ` Will Deacon
  2020-11-26 12:36 ` [PATCH 10/11] arm64: entry: fix NMI {user, kernel}->kernel transitions Mark Rutland
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:36 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

There are periods in kernel mode when RCU is not watching and/or the
scheduler tick is disabled, but we can still take exceptions such as
interrupts. The arm64 exception handlers do not account for this, and
it's possible that RCU is not watching while an exception handler runs.

The x86/generic entry code handles this by ensuring that all (non-NMI)
kernel exception handlers call irqentry_enter() and irqentry_exit(),
which handle RCU, lockdep, and IRQ flag tracing. We can't yet move to
the generic entry code, and already hadnle the user<->kernel transitions
elsewhere, so we add new kernel<->kernel transition helpers alog the
lines of the generic entry code.

Since we now track interrupts becoming masked when an exception is
taken, local_daif_inherit() is modified to track interrupts becoming
re-enabled when the original context is inherited. To balance the
entry/exit paths, each handler masks all DAIF exceptions before
exit_to_kernel_mode().

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/include/asm/daifflags.h |  3 ++
 arch/arm64/kernel/entry-common.c   | 59 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h
index ec213b4a1650..1c26d7baa67f 100644
--- a/arch/arm64/include/asm/daifflags.h
+++ b/arch/arm64/include/asm/daifflags.h
@@ -128,6 +128,9 @@ static inline void local_daif_inherit(struct pt_regs *regs)
 {
 	unsigned long flags = regs->pstate & DAIF_MASK;
 
+	if (interrupts_enabled(regs))
+		trace_hardirqs_on();
+
 	/*
 	 * We can't use local_daif_restore(regs->pstate) here as
 	 * system_has_prio_mask_debugging() won't restore the I bit if it can
diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 49d1c1dd9baf..526e98cec86e 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -17,12 +17,50 @@
 #include <asm/mmu.h>
 #include <asm/sysreg.h>
 
+static void noinstr enter_from_kernel_mode(struct pt_regs *regs)
+{
+	regs->exit_rcu = false;
+
+	if (!IS_ENABLED(CONFIG_TINY_RCU) && is_idle_task(current)) {
+		lockdep_hardirqs_off(CALLER_ADDR0);
+		rcu_irq_enter();
+		trace_hardirqs_off_finish();
+
+		regs->exit_rcu = true;
+		return;
+	}
+
+	lockdep_hardirqs_off(CALLER_ADDR0);
+	rcu_irq_enter_check_tick();
+	trace_hardirqs_off_finish();
+}
+
+static void noinstr exit_to_kernel_mode(struct pt_regs *regs)
+{
+	lockdep_assert_irqs_disabled();
+
+	if (interrupts_enabled(regs)) {
+		if (regs->exit_rcu) {
+			trace_hardirqs_on_prepare();
+			lockdep_hardirqs_on_prepare(CALLER_ADDR0);
+			rcu_irq_exit();
+			lockdep_hardirqs_on(CALLER_ADDR0);
+			return;
+		}
+
+		trace_hardirqs_on();
+	} else {
+		if (regs->exit_rcu)
+			rcu_irq_exit();
+	}
+}
+
 asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs)
 {
 	if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
 		nmi_enter();
-
-	trace_hardirqs_off();
+	else
+		enter_from_kernel_mode(regs);
 }
 
 asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs)
@@ -30,36 +68,48 @@ asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs)
 	if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
 		nmi_exit();
 	else
-		trace_hardirqs_on();
+		exit_to_kernel_mode(regs);
 }
 
 static void noinstr el1_abort(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
+	enter_from_kernel_mode(regs);
 	local_daif_inherit(regs);
 	far = untagged_addr(far);
 	do_mem_abort(far, esr, regs);
+	local_daif_mask();
+	exit_to_kernel_mode(regs);
 }
 
 static void noinstr el1_pc(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
 
+	enter_from_kernel_mode(regs);
 	local_daif_inherit(regs);
 	do_sp_pc_abort(far, esr, regs);
+	local_daif_mask();
+	exit_to_kernel_mode(regs);
 }
 
 static void noinstr el1_undef(struct pt_regs *regs)
 {
+	enter_from_kernel_mode(regs);
 	local_daif_inherit(regs);
 	do_undefinstr(regs);
+	local_daif_mask();
+	exit_to_kernel_mode(regs);
 }
 
 static void noinstr el1_inv(struct pt_regs *regs, unsigned long esr)
 {
+	enter_from_kernel_mode(regs);
 	local_daif_inherit(regs);
 	bad_mode(regs, 0, esr);
+	local_daif_mask();
+	exit_to_kernel_mode(regs);
 }
 
 static void noinstr el1_dbg(struct pt_regs *regs, unsigned long esr)
@@ -79,8 +129,11 @@ static void noinstr el1_dbg(struct pt_regs *regs, unsigned long esr)
 
 static void noinstr el1_fpac(struct pt_regs *regs, unsigned long esr)
 {
+	enter_from_kernel_mode(regs);
 	local_daif_inherit(regs);
 	do_ptrauth_fault(regs, esr);
+	local_daif_mask();
+	exit_to_kernel_mode(regs);
 }
 
 asmlinkage void noinstr el1_sync_handler(struct pt_regs *regs)
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 10/11] arm64: entry: fix NMI {user, kernel}->kernel transitions
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (8 preceding siblings ...)
  2020-11-26 12:36 ` [PATCH 09/11] arm64: entry: fix non-NMI kernel<->kernel transitions Mark Rutland
@ 2020-11-26 12:36 ` Mark Rutland
  2020-11-26 18:41   ` [PATCH 10/11] arm64: entry: fix NMI {user,kernel}->kernel transitions Mark Rutland
  2020-11-26 12:36 ` [PATCH 11/11] arm64: entry: fix EL1 debug transitions Mark Rutland
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:36 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

Exceptions which can be taken at (almost) any time are consdiered to be
NMIs. On arm64 that includes:

* SDEI events
* GICv3 Pseudo-NMIs
* Kernel stack overflows
* Unexpected/unhandled exceptions

... but currently debug exceptions (BRKs, breakpoints, watchpoints,
single-step) are not considered NMIs.

As these can be taken at any time, kernel features (lockdep, RCU,
ftrace) may not be in a consistent kernel state. For example, we may
take an NMI from the idle code or partway through an entry/exit path.

While nmi_enter() and nmi_exit() handle most of this state, notably they
don't save/restore the lockdep state across an NMI being taken and
handled. When interrupts are enabled and an NMI is taken, lockdep may
see interrupts become disabled within the NMI code, but not see
interrupts become enabled when returning from the NMI, leaving lockdep
believing interrupts are disabled when they are actually disabled.

The x86 code handles this in idtentry_{enter,exit}_nmi(), which will
shortly be moved to the generic entry code. As we can't use either yet,
we copy the x86 approach in arm64-specific helpers. All the NMI
entrypoints are marked as noinstr to prevent any instrumentation
handling code being invoked before the state has been corrected.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/include/asm/exception.h |  2 ++
 arch/arm64/kernel/entry-common.c   | 34 ++++++++++++++++++++++++++++++++--
 arch/arm64/kernel/sdei.c           |  7 ++++---
 arch/arm64/kernel/traps.c          | 15 ++++++++++-----
 4 files changed, 48 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h
index d579b2e6db7a..0756191f44f6 100644
--- a/arch/arm64/include/asm/exception.h
+++ b/arch/arm64/include/asm/exception.h
@@ -35,6 +35,8 @@ asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs);
 asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs);
 asmlinkage void enter_from_user_mode(void);
 asmlinkage void exit_to_user_mode(void);
+void arm64_enter_nmi(struct pt_regs *regs);
+void arm64_exit_nmi(struct pt_regs *regs);
 void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
 void do_undefinstr(struct pt_regs *regs);
 void do_bti(struct pt_regs *regs);
diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 526e98cec86e..fd7c854bb10e 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -55,10 +55,40 @@ static void noinstr exit_to_kernel_mode(struct pt_regs *regs)
 	}
 }
 
+void noinstr arm64_enter_nmi(struct pt_regs *regs)
+{
+	regs->lockdep_hardirqs = lockdep_hardirqs_enabled();
+
+	__nmi_enter();
+	lockdep_hardirqs_off(CALLER_ADDR0);
+	lockdep_hardirq_enter();
+	rcu_nmi_enter();
+
+	trace_hardirqs_off_finish();
+	ftrace_nmi_enter();
+}
+
+void noinstr arm64_exit_nmi(struct pt_regs *regs)
+{
+	bool restore = regs->lockdep_hardirqs;
+
+	ftrace_nmi_exit();
+	if (restore) {
+		trace_hardirqs_on_prepare();
+		lockdep_hardirqs_on_prepare(CALLER_ADDR0);
+	}
+
+	rcu_nmi_exit();
+	lockdep_hardirq_exit();
+	if (restore)
+		lockdep_hardirqs_on(CALLER_ADDR0);
+	__nmi_exit();
+}
+
 asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs)
 {
 	if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
-		nmi_enter();
+		arm64_enter_nmi(regs);
 	else
 		enter_from_kernel_mode(regs);
 }
@@ -66,7 +96,7 @@ asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs)
 asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs)
 {
 	if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
-		nmi_exit();
+		arm64_exit_nmi(regs);
 	else
 		exit_to_kernel_mode(regs);
 }
diff --git a/arch/arm64/kernel/sdei.c b/arch/arm64/kernel/sdei.c
index 7689f2031c0c..162646f0d151 100644
--- a/arch/arm64/kernel/sdei.c
+++ b/arch/arm64/kernel/sdei.c
@@ -10,6 +10,7 @@
 #include <linux/uaccess.h>
 
 #include <asm/alternative.h>
+#include <asm/exception.h>
 #include <asm/kprobes.h>
 #include <asm/mmu.h>
 #include <asm/ptrace.h>
@@ -223,16 +224,16 @@ static __kprobes unsigned long _sdei_handler(struct pt_regs *regs,
 }
 
 
-asmlinkage __kprobes notrace unsigned long
+asmlinkage noinstr unsigned long
 __sdei_handler(struct pt_regs *regs, struct sdei_registered_event *arg)
 {
 	unsigned long ret;
 
-	nmi_enter();
+	arm64_enter_nmi();
 
 	ret = _sdei_handler(regs, arg);
 
-	nmi_exit();
+	arm64_exit_nmi();
 
 	return ret;
 }
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 580c60afc39a..2059d8f43f55 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -34,6 +34,7 @@
 #include <asm/daifflags.h>
 #include <asm/debug-monitors.h>
 #include <asm/esr.h>
+#include <asm/exception.h>
 #include <asm/extable.h>
 #include <asm/insn.h>
 #include <asm/kprobes.h>
@@ -753,8 +754,10 @@ const char *esr_get_class_string(u32 esr)
  * bad_mode handles the impossible case in the exception vector. This is always
  * fatal.
  */
-asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
+asmlinkage void notrace bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
 {
+	arm64_enter_nmi(regs);
+
 	console_verbose();
 
 	pr_crit("Bad mode in %s handler detected on CPU%d, code 0x%08x -- %s\n",
@@ -786,7 +789,7 @@ void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
 DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack)
 	__aligned(16);
 
-asmlinkage void handle_bad_stack(struct pt_regs *regs)
+asmlinkage void noinstr handle_bad_stack(struct pt_regs *regs)
 {
 	unsigned long tsk_stk = (unsigned long)current->stack;
 	unsigned long irq_stk = (unsigned long)this_cpu_read(irq_stack_ptr);
@@ -794,6 +797,8 @@ asmlinkage void handle_bad_stack(struct pt_regs *regs)
 	unsigned int esr = read_sysreg(esr_el1);
 	unsigned long far = read_sysreg(far_el1);
 
+	arm64_enter_nmi(regs);
+
 	console_verbose();
 	pr_emerg("Insufficient stack space to handle exception!");
 
@@ -865,15 +870,15 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr)
 	}
 }
 
-asmlinkage void do_serror(struct pt_regs *regs, unsigned int esr)
+asmlinkage void noinstr do_serror(struct pt_regs *regs, unsigned int esr)
 {
-	nmi_enter();
+	arm64_enter_nmi(regs);
 
 	/* non-RAS errors are not containable */
 	if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr))
 		arm64_serror_panic(regs, esr);
 
-	nmi_exit();
+	arm64_exit_nmi(regs);
 }
 
 /* GENERIC_BUG traps */
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 11/11] arm64: entry: fix EL1 debug transitions
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (9 preceding siblings ...)
  2020-11-26 12:36 ` [PATCH 10/11] arm64: entry: fix NMI {user, kernel}->kernel transitions Mark Rutland
@ 2020-11-26 12:36 ` Mark Rutland
  2020-11-30 11:23 ` [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Will Deacon
  2020-11-30 12:03 ` Marco Elver
  12 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 12:36 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, elver, paulmck, peterz, catalin.marinas,
	james.morse, will, dvyukov

In debug_exception_enter() and debug_exception_exit() we trace hardirqs
on/off while RCU isn't guaranteed to be watching, and we don't save and
restore the hardirq state, and so may return with this having changed.

Handle this appropriately with new entry/exit helpers which do the bare
minimum to ensure this is appropriately maintained, without marking
debug exceptions as NMIs. These are placed in entry-common.c with the
other entry/exit helpers.

In future we'll want to reconsider whether some debug exceptions should
be NMIs, but this will require a significant refactoring, and for now
this should prevent issues with lockdep and RCU.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marins <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/entry-common.c | 26 ++++++++++++++++++++++++++
 arch/arm64/mm/fault.c            | 25 -------------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index fd7c854bb10e..2ef9edd2f3ab 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -142,6 +142,30 @@ static void noinstr el1_inv(struct pt_regs *regs, unsigned long esr)
 	exit_to_kernel_mode(regs);
 }
 
+static void noinstr arm64_enter_el1_dbg(struct pt_regs *regs)
+{
+	regs->lockdep_hardirqs = lockdep_hardirqs_enabled();
+
+	lockdep_hardirqs_off(CALLER_ADDR0);
+	rcu_nmi_enter();
+
+	trace_hardirqs_off_finish();
+}
+
+static void noinstr arm64_exit_el1_dbg(struct pt_regs *regs)
+{
+	bool restore = regs->lockdep_hardirqs;
+
+	if (restore) {
+		trace_hardirqs_on_prepare();
+		lockdep_hardirqs_on_prepare(CALLER_ADDR0);
+	}
+
+	rcu_nmi_exit();
+	if (restore)
+		lockdep_hardirqs_on(CALLER_ADDR0);
+}
+
 static void noinstr el1_dbg(struct pt_regs *regs, unsigned long esr)
 {
 	unsigned long far = read_sysreg(far_el1);
@@ -154,7 +178,9 @@ static void noinstr el1_dbg(struct pt_regs *regs, unsigned long esr)
 	if (system_uses_irq_prio_masking())
 		gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
 
+	arm64_enter_el1_dbg(regs);
 	do_debug_exception(far, esr, regs);
+	arm64_exit_el1_dbg(regs);
 }
 
 static void noinstr el1_fpac(struct pt_regs *regs, unsigned long esr)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 1f450b784d2c..795d224f184f 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -789,23 +789,6 @@ void __init hook_debug_fault_code(int nr,
  */
 static void debug_exception_enter(struct pt_regs *regs)
 {
-	if (!user_mode(regs)) {
-		/*
-		 * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
-		 * already disabled to preserve the last enabled/disabled addresses.
-		 */
-		if (interrupts_enabled(regs))
-			trace_hardirqs_off();
-
-		/*
-		 * We might have interrupted pretty much anything.  In
-		 * fact, if we're a debug exception, we can even interrupt
-		 * NMI processing. We don't want this code makes in_nmi()
-		 * to return true, but we need to notify RCU.
-		 */
-		rcu_nmi_enter();
-	}
-
 	preempt_disable();
 
 	/* This code is a bit fragile.  Test it. */
@@ -816,14 +799,6 @@ NOKPROBE_SYMBOL(debug_exception_enter);
 static void debug_exception_exit(struct pt_regs *regs)
 {
 	preempt_enable_no_resched();
-
-	if (user_mode(regs))
-		return;
-
-	rcu_nmi_exit();
-
-	if (interrupts_enabled(regs))
-		trace_hardirqs_on();
 }
 NOKPROBE_SYMBOL(debug_exception_exit);
 
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH 10/11] arm64: entry: fix NMI {user,kernel}->kernel transitions
  2020-11-26 12:36 ` [PATCH 10/11] arm64: entry: fix NMI {user, kernel}->kernel transitions Mark Rutland
@ 2020-11-26 18:41   ` Mark Rutland
  2020-11-26 21:00     ` Will Deacon
  0 siblings, 1 reply; 21+ messages in thread
From: Mark Rutland @ 2020-11-26 18:41 UTC (permalink / raw)
  To: linux-arm-kernel, will
  Cc: elver, paulmck, peterz, catalin.marinas, james.morse, dvyukov

On Thu, Nov 26, 2020 at 12:36:01PM +0000, Mark Rutland wrote:
> diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h
> index d579b2e6db7a..0756191f44f6 100644
> --- a/arch/arm64/include/asm/exception.h
> +++ b/arch/arm64/include/asm/exception.h

> +void arm64_enter_nmi(struct pt_regs *regs);
> +void arm64_exit_nmi(struct pt_regs *regs);

[...]

> -asmlinkage __kprobes notrace unsigned long
> +asmlinkage noinstr unsigned long
>  __sdei_handler(struct pt_regs *regs, struct sdei_registered_event *arg)
>  {
>  	unsigned long ret;
>  
> -	nmi_enter();
> +	arm64_enter_nmi();
>  
>  	ret = _sdei_handler(regs, arg);
>  
> -	nmi_exit();
> +	arm64_exit_nmi();
>  
>  	return ret;
>  }

Whoops; I forgot to pass the regs here.

Will, could you please apply the fixup patch below? I've build+boot
tested with the CKI config atop rc5, and made sure I hadn't done
likewise in any of the other callers.

Thanks,
Mark

---->8----
From a055c2d9e24ddb2383b930ea36dad01d5036c801 Mon Sep 17 00:00:00 2001
From: Mark Rutland <mark.rutland@arm.com>
Date: Thu, 26 Nov 2020 18:29:13 +0000
Subject: [PATCH] arm64: sdei: fix arm64_{enter,exit}_nmi() calls

When converting __sdei_handler() to the new arm64 NMI entry/exit
helpers I missed the `regs` argument, leading to a build failure when
CONFIG_ARM_SDE_INTERFACE is selected.

Fix this by adding the missing argument to both calls. Build a boot
tested with CONFIG_ARM_SDE_INTERFACE selected.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/sdei.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/sdei.c b/arch/arm64/kernel/sdei.c
index 162646f0d151..793c46d6a447 100644
--- a/arch/arm64/kernel/sdei.c
+++ b/arch/arm64/kernel/sdei.c
@@ -229,11 +229,11 @@ __sdei_handler(struct pt_regs *regs, struct sdei_registered_event *arg)
 {
 	unsigned long ret;
 
-	arm64_enter_nmi();
+	arm64_enter_nmi(regs);
 
 	ret = _sdei_handler(regs, arg);
 
-	arm64_exit_nmi();
+	arm64_exit_nmi(regs);
 
 	return ret;
 }
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH 10/11] arm64: entry: fix NMI {user,kernel}->kernel transitions
  2020-11-26 18:41   ` [PATCH 10/11] arm64: entry: fix NMI {user,kernel}->kernel transitions Mark Rutland
@ 2020-11-26 21:00     ` Will Deacon
  0 siblings, 0 replies; 21+ messages in thread
From: Will Deacon @ 2020-11-26 21:00 UTC (permalink / raw)
  To: Mark Rutland
  Cc: elver, paulmck, peterz, catalin.marinas, james.morse,
	linux-arm-kernel, dvyukov

On Thu, Nov 26, 2020 at 06:41:59PM +0000, Mark Rutland wrote:
> On Thu, Nov 26, 2020 at 12:36:01PM +0000, Mark Rutland wrote:
> > diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h
> > index d579b2e6db7a..0756191f44f6 100644
> > --- a/arch/arm64/include/asm/exception.h
> > +++ b/arch/arm64/include/asm/exception.h
> 
> > +void arm64_enter_nmi(struct pt_regs *regs);
> > +void arm64_exit_nmi(struct pt_regs *regs);
> 
> [...]
> 
> > -asmlinkage __kprobes notrace unsigned long
> > +asmlinkage noinstr unsigned long
> >  __sdei_handler(struct pt_regs *regs, struct sdei_registered_event *arg)
> >  {
> >  	unsigned long ret;
> >  
> > -	nmi_enter();
> > +	arm64_enter_nmi();
> >  
> >  	ret = _sdei_handler(regs, arg);
> >  
> > -	nmi_exit();
> > +	arm64_exit_nmi();
> >  
> >  	return ret;
> >  }
> 
> Whoops; I forgot to pass the regs here.
> 
> Will, could you please apply the fixup patch below? I've build+boot
> tested with the CKI config atop rc5, and made sure I hadn't done
> likewise in any of the other callers.

Cheers, I've pushed that on top. Let's see how far we get this time...

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 08/11] arm64: ptrace: prepare for EL1 irq/rcu tracking
  2020-11-26 12:35 ` [PATCH 08/11] arm64: ptrace: prepare for EL1 irq/rcu tracking Mark Rutland
@ 2020-11-30 11:01   ` Will Deacon
  0 siblings, 0 replies; 21+ messages in thread
From: Will Deacon @ 2020-11-30 11:01 UTC (permalink / raw)
  To: Mark Rutland
  Cc: elver, paulmck, peterz, catalin.marinas, james.morse,
	linux-arm-kernel, dvyukov

On Thu, Nov 26, 2020 at 12:35:59PM +0000, Mark Rutland wrote:
> Exceptions from EL1 may be taken when RCU isn't watching (e.g. in idle
> sequences), or when the lockdep hardirqs transiently out-of-sync with
> the hardware state (e.g. in the middle of local_irq_enable()). To
> correctly handle these cases, we'll need to save/restore this state
> across some exceptions taken from EL1.
> 
> A series of subsequent patches will update EL1 exception handlers to
> handle this. In preparation for this, and to avoid dependencies between
> those patches, this patch adds two new fields to struct pt_regs so that
> exception handlers can track this state.
> 
> Note that this is placed in pt_regs as some entry/exit sequences such as
> el1_irq are invoked from assembly, which makes it very difficult to add
> a separate structure as with the irqentry_state used by x86. We can
> separate this once more of the exception logic is moved to C. While the
> fields only need to be bool, they are both made u64 to keep pt_regs
> 16-bite aligned.

"bite" ?!

> There should be no functional change as a result of this patch.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/include/asm/ptrace.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
> index 997cf8c8cd52..b4a841d9511d 100644
> --- a/arch/arm64/include/asm/ptrace.h
> +++ b/arch/arm64/include/asm/ptrace.h
> @@ -193,6 +193,13 @@ struct pt_regs {
>  	/* Only valid when ARM64_HAS_IRQ_PRIO_MASKING is enabled. */
>  	u64 pmr_save;
>  	u64 stackframe[2];
> +
> +	/*
> +	 * Only valid for some EL1 exceptions.
> +	 * TODO: move this out of pt_regs.

Please drop the "TODO".

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 09/11] arm64: entry: fix non-NMI kernel<->kernel transitions
  2020-11-26 12:36 ` [PATCH 09/11] arm64: entry: fix non-NMI kernel<->kernel transitions Mark Rutland
@ 2020-11-30 11:22   ` Will Deacon
  0 siblings, 0 replies; 21+ messages in thread
From: Will Deacon @ 2020-11-30 11:22 UTC (permalink / raw)
  To: Mark Rutland
  Cc: elver, paulmck, peterz, catalin.marinas, james.morse,
	linux-arm-kernel, dvyukov

On Thu, Nov 26, 2020 at 12:36:00PM +0000, Mark Rutland wrote:
> There are periods in kernel mode when RCU is not watching and/or the
> scheduler tick is disabled, but we can still take exceptions such as
> interrupts. The arm64 exception handlers do not account for this, and
> it's possible that RCU is not watching while an exception handler runs.
> 
> The x86/generic entry code handles this by ensuring that all (non-NMI)
> kernel exception handlers call irqentry_enter() and irqentry_exit(),
> which handle RCU, lockdep, and IRQ flag tracing. We can't yet move to
> the generic entry code, and already hadnle the user<->kernel transitions
> elsewhere, so we add new kernel<->kernel transition helpers alog the
> lines of the generic entry code.
> 
> Since we now track interrupts becoming masked when an exception is
> taken, local_daif_inherit() is modified to track interrupts becoming
> re-enabled when the original context is inherited. To balance the
> entry/exit paths, each handler masks all DAIF exceptions before
> exit_to_kernel_mode().
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/include/asm/daifflags.h |  3 ++
>  arch/arm64/kernel/entry-common.c   | 59 ++++++++++++++++++++++++++++++++++++--
>  2 files changed, 59 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h
> index ec213b4a1650..1c26d7baa67f 100644
> --- a/arch/arm64/include/asm/daifflags.h
> +++ b/arch/arm64/include/asm/daifflags.h
> @@ -128,6 +128,9 @@ static inline void local_daif_inherit(struct pt_regs *regs)
>  {
>  	unsigned long flags = regs->pstate & DAIF_MASK;
>  
> +	if (interrupts_enabled(regs))
> +		trace_hardirqs_on();
> +
>  	/*
>  	 * We can't use local_daif_restore(regs->pstate) here as
>  	 * system_has_prio_mask_debugging() won't restore the I bit if it can
> diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
> index 49d1c1dd9baf..526e98cec86e 100644
> --- a/arch/arm64/kernel/entry-common.c
> +++ b/arch/arm64/kernel/entry-common.c
> @@ -17,12 +17,50 @@
>  #include <asm/mmu.h>
>  #include <asm/sysreg.h>
>  
> +static void noinstr enter_from_kernel_mode(struct pt_regs *regs)
> +{
> +	regs->exit_rcu = false;
> +
> +	if (!IS_ENABLED(CONFIG_TINY_RCU) && is_idle_task(current)) {
> +		lockdep_hardirqs_off(CALLER_ADDR0);
> +		rcu_irq_enter();
> +		trace_hardirqs_off_finish();
> +
> +		regs->exit_rcu = true;
> +		return;
> +	}
> +
> +	lockdep_hardirqs_off(CALLER_ADDR0);
> +	rcu_irq_enter_check_tick();
> +	trace_hardirqs_off_finish();
> +}
> +
> +static void noinstr exit_to_kernel_mode(struct pt_regs *regs)
> +{
> +	lockdep_assert_irqs_disabled();
> +
> +	if (interrupts_enabled(regs)) {
> +		if (regs->exit_rcu) {
> +			trace_hardirqs_on_prepare();
> +			lockdep_hardirqs_on_prepare(CALLER_ADDR0);
> +			rcu_irq_exit();
> +			lockdep_hardirqs_on(CALLER_ADDR0);
> +			return;
> +		}
> +
> +		trace_hardirqs_on();
> +	} else {
> +		if (regs->exit_rcu)
> +			rcu_irq_exit();
> +	}
> +}

Hmm. I'd prefer to rework this to avoid the nested early return:

e.g:

	// exit_to_kernel_mode()
	if (!interrupts_enabled(regs)) {
		if (regs->exit_rcu)
			rcu_irq_exit()
	} else if (regs->exit_rcu) {
		trace_hardirqs_on_prepare();
		...
	} else {
		trace_hardirqs_on();
	}


but I see you're following the pattern in kernel/entry/common.c, which
makes sense given that the long-term goal should be to move over to that.

In which case, can you add a comment somewhere that this is deliberately
structured to map to the common code?

Cheers,

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 07/11] arm64: entry: fix non-NMI user<->kernel transitions
  2020-11-26 12:35 ` [PATCH 07/11] arm64: entry: fix non-NMI user<->kernel transitions Mark Rutland
@ 2020-11-30 11:22   ` Will Deacon
  0 siblings, 0 replies; 21+ messages in thread
From: Will Deacon @ 2020-11-30 11:22 UTC (permalink / raw)
  To: Mark Rutland
  Cc: elver, paulmck, peterz, catalin.marinas, james.morse,
	linux-arm-kernel, dvyukov

On Thu, Nov 26, 2020 at 12:35:58PM +0000, Mark Rutland wrote:
> When built with PROVE_LOCKING, NO_HZ_FULL, and CONTEXT_TRACKING_FORCE
> will WARN() at boot time that interrupts are enabled when we call
> context_tracking_user_enter(), despite the DAIF flags indicating that
> IRQs are masked.
> 
> The problem is that we're not tracking IRQ flag changes accurately, and
> so lockdep believes interrupts are enabled when they are not (and
> vice-versa). We can shuffle things so to make this more accurate. For
> kernel->user transitions there are a number of constraints we need to
> consider:

[...]

> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 53e30750fc28..d17a68c24608 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -30,18 +30,18 @@
>  #include <asm/unistd.h>
>  
>  /*
> - * Context tracking subsystem.  Used to instrument transitions
> - * between user and kernel mode.
> + * Context tracking and irqflag tracing need to inrstrument transitions between

Typo: "inrstrument".

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (10 preceding siblings ...)
  2020-11-26 12:36 ` [PATCH 11/11] arm64: entry: fix EL1 debug transitions Mark Rutland
@ 2020-11-30 11:23 ` Will Deacon
  2020-11-30 12:03 ` Marco Elver
  12 siblings, 0 replies; 21+ messages in thread
From: Will Deacon @ 2020-11-30 11:23 UTC (permalink / raw)
  To: Mark Rutland
  Cc: elver, paulmck, peterz, catalin.marinas, james.morse,
	linux-arm-kernel, dvyukov

Hi Mark,

Thanks for doing this.

On Thu, Nov 26, 2020 at 12:35:51PM +0000, Mark Rutland wrote:
> Dmitry and Marco both reported some weirdness with lockdep on arm64 erroneously
> reporting the hardware IRQ state, and inexplicable RCU stalls:
> 
>   https://lore.kernel.org/r/CACT4Y+aAzoJ48Mh1wNYD17pJqyEcDnrxGfApir=-j171TnQXhw@mail.gmail.com
>   https://lore.kernel.org/r/20201119193819.GA2601289@elver.google.com
> 
> Having investigated, I believe that this is largely down to the arm64 entry
> code not correctly managing RCU, lockdep, irq flag tracing, and context
> tracking. This series attempts to fix those cases, and I've Cc'd folk from the
> previous threads as a heads-up.

I've left some _minor_ comments on a few of the patches, and there was a
build failure in the SDEI code, as you know.

Please can you spin a quick v2 so that I can get this into linux-next
ASAP?

Cheers,

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes
  2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
                   ` (11 preceding siblings ...)
  2020-11-30 11:23 ` [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Will Deacon
@ 2020-11-30 12:03 ` Marco Elver
  2020-11-30 12:38   ` Mark Rutland
  12 siblings, 1 reply; 21+ messages in thread
From: Marco Elver @ 2020-11-30 12:03 UTC (permalink / raw)
  To: Mark Rutland
  Cc: paulmck, peterz, catalin.marinas, james.morse, linux-arm-kernel,
	will, dvyukov

[-- Attachment #1: Type: text/plain, Size: 2918 bytes --]

[ FYI, this series was not Cc'd to LKML. ]

On Thu, Nov 26, 2020 at 12:35PM +0000, Mark Rutland wrote:
> Hi,
> 
> Dmitry and Marco both reported some weirdness with lockdep on arm64 erroneously
> reporting the hardware IRQ state, and inexplicable RCU stalls:
> 
>   https://lore.kernel.org/r/CACT4Y+aAzoJ48Mh1wNYD17pJqyEcDnrxGfApir=-j171TnQXhw@mail.gmail.com
>   https://lore.kernel.org/r/20201119193819.GA2601289@elver.google.com
> 
> Having investigated, I believe that this is largely down to the arm64 entry
> code not correctly managing RCU, lockdep, irq flag tracing, and context
> tracking. This series attempts to fix those cases, and I've Cc'd folk from the
> previous threads as a heads-up.
> 
> Today, the arm64 entry code:
> 
> * Doesn't correctly save/restore the lockdep/tracing view of the HW IRQ
>   state, leaving this inconsistent.
> 
> * Doesn't correctly wake/sleep RCU arounds its use (e.g. by the IRQ tracing
>   functions).
> 
> * Calls the context tracking functions (which wake and sleep RCU) at the wrong
>   point w.r.t. lockdep, tracing.
> 
> Fixing all this requires reworking the entry/exit sequences along the lines of
> the generic/x86 entry code. Moving arm64 over to the generic entry code
> requires signficant changes to both arm64 and the generic code, so for now I've
> added arm64-specific helpers to achieve the same thing. There's a lot of
> cleanup we could do here as a follow-up, but for now I've tried to do the bare
> minimum to make things work as expected without making it unmaintainable.
> 
> The patches are based on v5.10-rc3, and I've pushed them out to my
> arm64/entry-fixes branch on kernel.org:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/entry-fixes
> 
> Marco was able to test a WIP version of this, which seemed to address the
> issues he was seeing. Since then I've had to alter the debug exception
> handling, but I'm not expecting problems there. In future we'll want to make
> more changes to the debug cases to align with x86, handling single-step,
> watchpoints, and breakpoints as NMIs, but this will require significant
> refactoring of the way we handle BRKs. For now I don't believe that there's a
> major problem in practice with the approach taken in this series.
> 
> This version has seen an overnight soak under Syzkaller, where all the reports
> I have so far look sound. I have been testing with additional debug patches:
>   
>   git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/entry-fixes
> 
> ... which I do not think we should merge now, but intent to respin in future
> with all the other cleanup.

So, I was hoping that this would fix all the problems I was seeing when
running the ftrace tests ... unfortunately, it didn't. :-( Perhaps the
WIP version you had only worked because it ended up disabling lockdep
early?

I've attached the log and the symbolized report.

Thanks,
-- Marco

[-- Attachment #2: dmesg-symbolized --]
[-- Type: text/plain, Size: 16169 bytes --]

Testing all events: OK
Running tests again, along with the function tracer
Running tests on all trace events:
Testing all events: 
hrtimer: interrupt took 10487664 ns
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 13s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
    in-flight: 7:do_cache_clean
pool 2: cpus=0 flags=0x4 nice=0 hung=0s workers=3 idle: 61 99
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 24s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 11s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
    pending: neigh_periodic_work
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 17s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
    in-flight: 7:neigh_periodic_work
pool 2: cpus=0 flags=0x4 nice=0 hung=9s workers=3 idle: 61 99
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x5 nice=0 active=2/256 refcnt=4
    in-flight: 7:do_cache_clean
    pending: neigh_periodic_work
pool 2: cpus=0 flags=0x5 nice=0 hung=8s workers=2 manager: 61
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 16s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
    in-flight: 106:do_cache_clean
pool 2: cpus=0 flags=0x4 nice=0 hung=8s workers=3 idle: 61 7
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
BUG: workqueue lockup - pool cpus=0 flags=0x4 nice=0 stuck for 10s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x4 nice=0 active=3/256 refcnt=5
    in-flight: 106:check_lifetime
    pending: neigh_periodic_work, do_cache_clean
pool 2: cpus=0 flags=0x4 nice=0 hung=10s workers=3 idle: 61 7
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 15s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
pool 2: cpus=0 flags=0x5 nice=0 hung=6s workers=3 manager: 7 idle: 106 61
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 12s!
BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 12s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    pending: vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x5 nice=0 active=1/256 refcnt=3
    pending: neigh_periodic_work
pool 2: cpus=0 flags=0x5 nice=0 hung=12s workers=3 manager: 7 idle: 106 61
BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 25s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x0
  pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
    in-flight: 15:vmstat_shepherd
workqueue events_power_efficient: flags=0x82
  pwq 2: cpus=0 flags=0x5 nice=0 active=3/256 refcnt=5
    pending: neigh_periodic_work, do_cache_clean, check_lifetime
pool 0: cpus=0 node=0 flags=0x0 nice=0 hung=2s workers=2 idle: 5
pool 2: cpus=0 flags=0x5 nice=0 hung=26s workers=4 manager: 7 idle: 107 106 61
rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
	(detected by 0, t=3752 jiffies, g=2329, q=2)
rcu: All QSes seen, last rcu_preempt kthread activity 3503 (4295192252-4295188749), jiffies_till_next_fqs=1, root ->qsmask 0x0
rcu: rcu_preempt kthread starved for 3503 jiffies! g2329 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0
rcu: 	Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
rcu: RCU grace-period kthread stack dump:
task:rcu_preempt     state:R  running task     stack:    0 pid:   10 ppid:     2 flags:0x00000428
Call trace:
 __switch_to+0x148/0x1f0 arch/arm64/kernel/process.c:577
 context_switch kernel/sched/core.c:4269 [inline]
 __schedule+0x2dc/0x9a0 kernel/sched/core.c:5019
 preempt_schedule_notrace+0x70/0x1c0 kernel/sched/core.c:5252
 __ftrace_ops_list_func kernel/trace/ftrace.c:6955 [inline]
 ftrace_ops_list_func+0x10c/0x218 kernel/trace/ftrace.c:6976
 ftrace_graph_call+0x0/0x4
 preempt_count_add+0x8/0x1a0 arch/arm64/include/asm/atomic.h:65
 schedule+0x44/0x100 kernel/sched/core.c:5097
 schedule_timeout+0x240/0x538 kernel/time/timer.c:1871
 rcu_gp_fqs_loop kernel/rcu/tree.c:1946 [inline]
 rcu_gp_kthread+0x618/0x1bd8 kernel/rcu/tree.c:2119
 kthread+0x13c/0x188 kernel/kthread.c:292
 ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
rcu: Stack dump where RCU GP kthread last ran:
Task dump for CPU 0:
task:event_benchmark state:R  running task     stack:    0 pid:  105 ppid:     2 flags:0x0000042a
Call trace:
 dump_backtrace+0x0/0x240 arch/arm64/kernel/stacktrace.c:100
 show_stack+0x34/0x88 arch/arm64/kernel/stacktrace.c:196
 sched_show_task kernel/sched/core.c:6948 [inline]
 sched_show_task+0x208/0x230 kernel/sched/core.c:6922
 dump_cpu_task+0x4c/0x5c kernel/sched/core.c:8986
 rcu_check_gp_kthread_starvation+0x240/0x388 kernel/rcu/tree_stall.h:480
 print_other_cpu_stall kernel/rcu/tree_stall.h:551 [inline]
 check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
 rcu_pending kernel/rcu/tree.c:3760 [inline]
 rcu_sched_clock_irq+0xc2c/0xd40 kernel/rcu/tree.c:2587
 update_process_times+0x6c/0xb8 kernel/time/timer.c:1709
 tick_sched_handle.isra.0+0x58/0x88 kernel/time/tick-sched.c:176
 tick_sched_timer+0x68/0xe0 kernel/time/tick-sched.c:1328
 __run_hrtimer kernel/time/hrtimer.c:1519 [inline]
 __hrtimer_run_queues+0x288/0x730 kernel/time/hrtimer.c:1583
 hrtimer_interrupt+0x114/0x288 kernel/time/hrtimer.c:1645
 timer_handler drivers/clocksource/arm_arch_timer.c:647 [inline]
 arch_timer_handler_virt+0x50/0x70 drivers/clocksource/arm_arch_timer.c:658
 handle_percpu_devid_irq+0x104/0x4c0 kernel/irq/chip.c:930
 generic_handle_irq_desc include/linux/irqdesc.h:152 [inline]
 generic_handle_irq+0x54/0x78 kernel/irq/irqdesc.c:650
 __handle_domain_irq+0xac/0x130 kernel/irq/irqdesc.c:687
 handle_domain_irq include/linux/irqdesc.h:170 [inline]
 gic_handle_irq+0x70/0x108 drivers/irqchip/irq-gic.c:370
 el1_irq+0xc4/0x180 arch/arm64/kernel/entry.S:640
 arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
 _raw_spin_unlock_irq+0x50/0x98 kernel/locking/spinlock.c:199
 finish_lock_switch kernel/sched/core.c:4047 [inline]
 finish_task_switch+0xb4/0x398 kernel/sched/core.c:4147
 context_switch kernel/sched/core.c:4272 [inline]
 __schedule+0x2e0/0x9a0 kernel/sched/core.c:5019
 preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
 arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
 el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
 arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
 trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
 benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
 kthread+0x13c/0x188 kernel/kthread.c:292
 ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929

================================
WARNING: inconsistent lock state
5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1 Not tainted
--------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
event_benchmark/105 [HC0[0]:SC0[0]:HE0:SE1] takes:
ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: print_other_cpu_stall kernel/rcu/tree_stall.h:512 [inline]
ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_pending kernel/rcu/tree.c:3760 [inline]
ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40 kernel/rcu/tree.c:2587
{IN-HARDIRQ-W} state was registered at:
  mark_lock kernel/locking/lockdep.c:4373 [inline]
  mark_usage kernel/locking/lockdep.c:4301 [inline]
  __lock_acquire+0xae8/0x1b00 kernel/locking/lockdep.c:4784
  lock_acquire kernel/locking/lockdep.c:5435 [inline]
  lock_acquire+0x268/0x508 kernel/locking/lockdep.c:5400
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0x78/0x14c kernel/locking/spinlock.c:159
  print_other_cpu_stall kernel/rcu/tree_stall.h:512 [inline]
  check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
  rcu_pending kernel/rcu/tree.c:3760 [inline]
  rcu_sched_clock_irq+0x428/0xd40 kernel/rcu/tree.c:2587
  update_process_times+0x6c/0xb8 kernel/time/timer.c:1709
  tick_sched_handle.isra.0+0x58/0x88 kernel/time/tick-sched.c:176
  tick_sched_timer+0x68/0xe0 kernel/time/tick-sched.c:1328
  __run_hrtimer kernel/time/hrtimer.c:1519 [inline]
  __hrtimer_run_queues+0x288/0x730 kernel/time/hrtimer.c:1583
  hrtimer_interrupt+0x114/0x288 kernel/time/hrtimer.c:1645
  timer_handler drivers/clocksource/arm_arch_timer.c:647 [inline]
  arch_timer_handler_virt+0x50/0x70 drivers/clocksource/arm_arch_timer.c:658
  handle_percpu_devid_irq+0x104/0x4c0 kernel/irq/chip.c:930
  generic_handle_irq_desc include/linux/irqdesc.h:152 [inline]
  generic_handle_irq+0x54/0x78 kernel/irq/irqdesc.c:650
  __handle_domain_irq+0xac/0x130 kernel/irq/irqdesc.c:687
  handle_domain_irq include/linux/irqdesc.h:170 [inline]
  gic_handle_irq+0x70/0x108 drivers/irqchip/irq-gic.c:370
  el1_irq+0xc4/0x180 arch/arm64/kernel/entry.S:640
  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
  __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
  _raw_spin_unlock_irq+0x50/0x98 kernel/locking/spinlock.c:199
  finish_lock_switch kernel/sched/core.c:4047 [inline]
  finish_task_switch+0xb4/0x398 kernel/sched/core.c:4147
  context_switch kernel/sched/core.c:4272 [inline]
  __schedule+0x2e0/0x9a0 kernel/sched/core.c:5019
  preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
  arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
  el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
  trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
  benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
  kthread+0x13c/0x188 kernel/kthread.c:292
  ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
irq event stamp: 67642
hardirqs last  enabled at (67641): [<ffffa17ef303ec78>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
hardirqs last  enabled at (67641): [<ffffa17ef303ec78>] _raw_spin_unlock_irq+0x48/0x98 kernel/locking/spinlock.c:199
hardirqs last disabled at (67642): [<ffffa17ef30310a8>] enter_el1_irq_or_nmi+0x20/0x30 arch/arm64/kernel/entry-common.c:93
softirqs last  enabled at (63366): [<ffffa17ef1c10b80>] __do_softirq+0x630/0x6b4 kernel/softirq.c:325
softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] do_softirq_own_stack include/linux/interrupt.h:568 [inline]
softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] invoke_softirq kernel/softirq.c:393 [inline]
softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] __irq_exit_rcu kernel/softirq.c:423 [inline]
softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] irq_exit+0x1cc/0x1e0 kernel/softirq.c:447

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(rcu_node_0);
  <Interrupt>
    lock(rcu_node_0);

 *** DEADLOCK ***

1 lock held by event_benchmark/105:
 #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: print_other_cpu_stall kernel/rcu/tree_stall.h:512 [inline]
 #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
 #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_pending kernel/rcu/tree.c:3760 [inline]
 #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40 kernel/rcu/tree.c:2587

stack backtrace:
CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x0/0x240 arch/arm64/kernel/stacktrace.c:100
 show_stack+0x34/0x88 arch/arm64/kernel/stacktrace.c:196
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x140/0x1bc lib/dump_stack.c:120
 print_usage_bug kernel/locking/lockdep.c:3738 [inline]
 print_usage_bug+0x2a0/0x2f0 kernel/locking/lockdep.c:3705
 valid_state kernel/locking/lockdep.c:3749 [inline]
 mark_lock_irq kernel/locking/lockdep.c:3952 [inline]
 mark_lock.part.0+0x438/0x4e8 kernel/locking/lockdep.c:4409
 mark_lock kernel/locking/lockdep.c:4007 [inline]
 mark_held_locks+0x54/0x90 kernel/locking/lockdep.c:4010
 __trace_hardirqs_on_caller kernel/locking/lockdep.c:4028 [inline]
 lockdep_hardirqs_on_prepare+0xe0/0x290 kernel/locking/lockdep.c:4096
 trace_hardirqs_on+0x90/0x370 kernel/trace/trace_preemptirq.c:49
 exit_to_kernel_mode.isra.0+0xf8/0x208 arch/arm64/kernel/entry-common.c:51
 exit_el1_irq_or_nmi+0x24/0x38 arch/arm64/kernel/entry-common.c:101
 el1_irq+0xe4/0x180 arch/arm64/kernel/entry.S:658
 arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
 _raw_spin_unlock_irq+0x50/0x98 kernel/locking/spinlock.c:199
 finish_lock_switch kernel/sched/core.c:4047 [inline]
 finish_task_switch+0xb4/0x398 kernel/sched/core.c:4147
 context_switch kernel/sched/core.c:4272 [inline]
 __schedule+0x2e0/0x9a0 kernel/sched/core.c:5019
 preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
 arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
 el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
 arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
 trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
 benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
 kthread+0x13c/0x188 kernel/kthread.c:292
 ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
BUG: scheduling while atomic: event_benchmark/105/0x00000002
INFO: lockdep is turned off.
Modules linked in:
Preemption disabled at:
[<ffffa17ef3037114>] preempt_schedule_irq+0x3c/0xa0 kernel/sched/core.c:5279
CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x0/0x240 arch/arm64/kernel/stacktrace.c:100
 show_stack+0x34/0x88 arch/arm64/kernel/stacktrace.c:196
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x140/0x1bc lib/dump_stack.c:120
 __schedule_bug+0xcc/0xe0 kernel/sched/core.c:4758
 schedule_debug kernel/sched/core.c:4785 [inline]
 __schedule+0x868/0x9a0 kernel/sched/core.c:4913
 preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
 arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
 el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
 arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
 trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
 benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
 kthread+0x13c/0x188 kernel/kthread.c:292
 ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929

[-- Attachment #3: vm.log --]
[-- Type: text/plain, Size: 32807 bytes --]

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
[    0.000000] Linux version 5.10.0-rc4-next-20201119-00002-gc88aca8827ce (elver@elver.muc.corp.google.com) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #1 SMP PREEMPT Mon Nov 30 12:29:39 CET 2020
[    0.000000] Machine model: linux,dummy-virt
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 32 MiB at 0x00000000be000000
[    0.000000] earlycon: pl11 at MMIO 0x0000000009000000 (options '')
[    0.000000] printk: bootconsole [pl11] enabled
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000] NUMA: NODE_DATA [mem 0xbdbf6000-0xbdbf7fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000bfffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000] On node 0 totalpages: 524288
[    0.000000]   DMA zone: 4096 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 262144 pages, LIFO batch:63
[    0.000000]   DMA32 zone: 4096 pages used for memmap
[    0.000000]   DMA32 zone: 262144 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] percpu: Embedded 49 pages/cpu s162704 r8192 d29808 u200704
[    0.000000] pcpu-alloc: s162704 r8192 d29808 u200704 alloc=49*4096
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 832075
[    0.000000] CPU features: detected: ARM erratum 834220
[    0.000000] CPU features: detected: EL2 vector hardening
[    0.000000] CPU features: kernel page table isolation forced ON by KASLR
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516096
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: console=ttyAMA0 root=/dev/sda debug earlycon earlyprintk=serial slub_debug=UZ slub_debug=- workqueue.watchdog_thresh=10
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x000000007bfff000-0x000000007ffff000] (64MB)
[    0.000000] Memory: 1903696K/2097152K available (20800K kernel code, 4024K rwdata, 8508K rodata, 8896K init, 11238K bss, 160688K reserved, 32768K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 56173 entries in 220 pages
[    0.000000] ftrace: allocated 220 pages with 5 groups
[    0.000000] Running RCU self tests
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU lockdep checking is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=1.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]
[    0.000000] random: get_random_bytes called from start_kernel+0x468/0x670 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 62.50MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
[    0.000236] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
[    0.011810] Console: colour dummy device 80x25
[    0.013175] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.013507] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.013762] ... MAX_LOCK_DEPTH:          48
[    0.014021] ... MAX_LOCKDEP_KEYS:        8192
[    0.014276] ... CLASSHASH_SIZE:          4096
[    0.014529] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.014784] ... MAX_LOCKDEP_CHAINS:      65536
[    0.015040] ... CHAINHASH_SIZE:          32768
[    0.015295]  memory used by lock dependency info: 6365 kB
[    0.015563]  memory used for stack traces: 4224 kB
[    0.015825]  per task-struct memory footprint: 1920 bytes
[    0.018643] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=250000)
[    0.019296] pid_max: default: 32768 minimum: 301
[    0.022474] LSM: Security Framework initializing
[    0.024666] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.025865] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.113064] rcu: Hierarchical SRCU implementation.
[    0.132492] EFI services will not be available.
[    0.137227] smp: Bringing up secondary CPUs ...
[    0.137657] smp: Brought up 1 node, 1 CPU
[    0.137985] SMP: Total of 1 processors activated.
[    0.138417] CPU features: detected: 32-bit EL0 Support
[    0.139154] CPU features: detected: CRC32 instructions
[    0.139529] CPU features: detected: 32-bit EL1 Support
[    0.563634] CPU: All CPU(s) started at EL1
[    0.564913] alternatives: patching kernel code
[    0.623566] devtmpfs: initialized
[    0.695671] KASLR enabled
[    0.724860] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.725586] futex hash table entries: 256 (order: 3, 32768 bytes, linear)
[    0.727427] Running postponed tracer tests:
[    0.731229] Testing tracer function: PASSED
[    8.838201] Testing dynamic ftrace: PASSED
[    9.788507] Testing dynamic ftrace ops #1: 
[   12.441107] (1 0 1 0 0) 
[   12.441603] (1 1 2 0 0) 
[   20.513697] (2 1 3 0 1132022) 
[   20.516513] (2 2 4 0 1132450) PASSED
[   24.660860] Testing dynamic ftrace ops #2: 
[   34.874589] (1 0 1 1111841 0) 
[   34.875920] (1 1 2 1112053 0) 
[   34.941152] (2 1 3 1 2837) 
[   34.942414] (2 2 4 200 3036) PASSED
[   38.187248] Testing ftrace recursion: PASSED
[   38.937602] Testing ftrace recursion safe: PASSED
[   39.684401] Testing ftrace regs: PASSED
[   40.438336] Testing tracer nop: PASSED
[   40.442591] Testing tracer irqsoff: PASSED
[   48.502343] Testing tracer preemptoff: PASSED
[   56.603251] Testing tracer preemptirqsoff: PASSED
[   64.741333] Testing tracer wakeup: PASSED
[   72.700877] Testing tracer wakeup_rt: PASSED
[   80.672483] Testing tracer wakeup_dl: PASSED
[   88.647205] Testing tracer function_graph: PASSED
[   95.311654] pinctrl core: initialized pinctrl subsystem
[   95.357604] DMI not present or invalid.
[   95.377573] NET: Registered protocol family 16
[   95.442282] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[   95.443718] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[   95.446121] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[   95.448632] audit: initializing netlink subsys (disabled)
[   95.457722] audit: type=2000 audit(83.900:1): state=initialized audit_enabled=0 res=1
[   95.495840] thermal_sys: Registered thermal governor 'step_wise'
[   95.496081] thermal_sys: Registered thermal governor 'power_allocator'
[   95.499286] cpuidle: using governor menu
[   95.505170] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[   95.506521] ASID allocator initialised with 32768 entries
[   95.541565] Serial: AMBA PL011 UART driver
[   96.469419] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 47, base_baud = 0) is a PL011 rev1
[   96.472001] printk: console [ttyAMA0] enabled
[   96.472001] printk: console [ttyAMA0] enabled
[   96.472789] printk: bootconsole [pl11] disabled
[   96.472789] printk: bootconsole [pl11] disabled
[   96.934788] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[   96.935322] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[   96.936042] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[   96.936454] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[   97.007523] cryptd: max_cpu_qlen set to 1000
[   97.143352] ACPI: Interpreter disabled.
[   97.207646] iommu: Default domain type: Translated 
[   97.216776] vgaarb: loaded
[   97.228660] SCSI subsystem initialized
[   97.234310] libata version 3.00 loaded.
[   97.243658] usbcore: registered new interface driver usbfs
[   97.245446] usbcore: registered new interface driver hub
[   97.247375] usbcore: registered new device driver usb
[   97.271932] pps_core: LinuxPPS API ver. 1 registered
[   97.272326] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[   97.273108] PTP clock support registered
[   97.278967] EDAC MC: Ver: 3.0.0
[   97.330734] FPGA manager framework
[   97.334916] Advanced Linux Sound Architecture Driver Initialized.
[   97.367534] clocksource: Switched to clocksource arch_sys_counter
[  114.521600] VFS: Disk quotas dquot_6.6.0
[  114.523765] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[  114.533650] pnp: PnP ACPI: disabled
[  114.765263] NET: Registered protocol family 2
[  114.788981] tcp_listen_portaddr_hash hash table entries: 1024 (order: 4, 81920 bytes, linear)
[  114.790064] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[  114.798325] TCP bind hash table entries: 16384 (order: 8, 1179648 bytes, linear)
[  114.806169] TCP: Hash tables configured (established 16384 bind 16384)
[  114.810413] UDP hash table entries: 1024 (order: 5, 163840 bytes, linear)
[  114.814124] UDP-Lite hash table entries: 1024 (order: 5, 163840 bytes, linear)
[  114.819502] NET: Registered protocol family 1
[  114.837488] RPC: Registered named UNIX socket transport module.
[  114.838082] RPC: Registered udp transport module.
[  114.838453] RPC: Registered tcp transport module.
[  114.838809] RPC: Registered tcp NFSv4.1 backchannel transport module.
[  114.839760] PCI: CLS 0 bytes, default 64
[  114.870930] hw perfevents: enabled with armv8_pmuv3 PMU driver, 5 counters available
[  114.873385] kvm [1]: HYP mode not available
[  115.096835] Initialise system trusted keyrings
[  115.102788] workingset: timestamp_bits=44 max_order=19 bucket_order=0
[  115.399347] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[  115.420555] NFS: Registering the id_resolver key type
[  115.422030] Key type id_resolver registered
[  115.422598] Key type id_legacy registered
[  115.426472] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[  115.434896] 9p: Installing v9fs 9p2000 file system support
[  115.521422] Key type asymmetric registered
[  115.522091] Asymmetric key parser 'x509' registered
[  115.523839] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[  115.524497] io scheduler mq-deadline registered
[  115.524989] io scheduler kyber registered
[  115.894160] pl061_gpio 9030000.pl061: PL061 GPIO chip registered
[  115.952465] pci-host-generic 4010000000.pcie: host bridge /pcie@10000000 ranges:
[  115.954473] pci-host-generic 4010000000.pcie:       IO 0x003eff0000..0x003effffff -> 0x0000000000
[  115.956630] pci-host-generic 4010000000.pcie:      MEM 0x0010000000..0x003efeffff -> 0x0010000000
[  115.957484] pci-host-generic 4010000000.pcie:      MEM 0x8000000000..0xffffffffff -> 0x8000000000
[  115.960592] pci-host-generic 4010000000.pcie: ECAM at [mem 0x4010000000-0x401fffffff] for [bus 00-ff]
[  115.965840] pci-host-generic 4010000000.pcie: PCI host bridge to bus 0000:00
[  115.966564] pci_bus 0000:00: root bus resource [bus 00-ff]
[  115.967435] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[  115.967879] pci_bus 0000:00: root bus resource [mem 0x10000000-0x3efeffff]
[  115.968308] pci_bus 0000:00: root bus resource [mem 0x8000000000-0xffffffffff]
[  115.970981] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
[  115.982358] pci 0000:00:01.0: [1af4:1009] type 00 class 0x000200
[  115.983896] pci 0000:00:01.0: reg 0x10: [io  0x0000-0x003f]
[  115.984527] pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x00000fff]
[  115.985710] pci 0000:00:01.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
[  115.993649] pci 0000:00:02.0: [1af4:1009] type 00 class 0x000200
[  115.994489] pci 0000:00:02.0: reg 0x10: [io  0x0000-0x003f]
[  115.995425] pci 0000:00:02.0: reg 0x14: [mem 0x00000000-0x00000fff]
[  115.996526] pci 0000:00:02.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
[  116.004182] pci 0000:00:03.0: [1af4:1000] type 00 class 0x020000
[  116.005039] pci 0000:00:03.0: reg 0x10: [io  0x0000-0x001f]
[  116.005630] pci 0000:00:03.0: reg 0x14: [mem 0x00000000-0x00000fff]
[  116.006717] pci 0000:00:03.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
[  116.007694] pci 0000:00:03.0: reg 0x30: [mem 0x00000000-0x0003ffff pref]
[  116.014983] pci 0000:00:04.0: [1af4:1004] type 00 class 0x010000
[  116.016150] pci 0000:00:04.0: reg 0x10: [io  0x0000-0x003f]
[  116.016744] pci 0000:00:04.0: reg 0x14: [mem 0x00000000-0x00000fff]
[  116.017823] pci 0000:00:04.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
[  116.031717] pci 0000:00:03.0: BAR 6: assigned [mem 0x10000000-0x1003ffff pref]
[  116.032501] pci 0000:00:01.0: BAR 4: assigned [mem 0x8000000000-0x8000003fff 64bit pref]
[  116.033388] pci 0000:00:02.0: BAR 4: assigned [mem 0x8000004000-0x8000007fff 64bit pref]
[  116.034240] pci 0000:00:03.0: BAR 4: assigned [mem 0x8000008000-0x800000bfff 64bit pref]
[  116.035359] pci 0000:00:04.0: BAR 4: assigned [mem 0x800000c000-0x800000ffff 64bit pref]
[  116.036108] pci 0000:00:01.0: BAR 1: assigned [mem 0x10040000-0x10040fff]
[  116.036664] pci 0000:00:02.0: BAR 1: assigned [mem 0x10041000-0x10041fff]
[  116.037196] pci 0000:00:03.0: BAR 1: assigned [mem 0x10042000-0x10042fff]
[  116.037723] pci 0000:00:04.0: BAR 1: assigned [mem 0x10043000-0x10043fff]
[  116.038274] pci 0000:00:01.0: BAR 0: assigned [io  0x1000-0x103f]
[  116.038817] pci 0000:00:02.0: BAR 0: assigned [io  0x1040-0x107f]
[  116.039686] pci 0000:00:04.0: BAR 0: assigned [io  0x1080-0x10bf]
[  116.040213] pci 0000:00:03.0: BAR 0: assigned [io  0x10c0-0x10df]
[  116.110878] EINJ: ACPI disabled.
[  116.586823] virtio-pci 0000:00:01.0: enabling device (0000 -> 0003)
[  116.601358] virtio-pci 0000:00:02.0: enabling device (0000 -> 0003)
[  116.613837] virtio-pci 0000:00:03.0: enabling device (0000 -> 0003)
[  116.624404] virtio-pci 0000:00:04.0: enabling device (0000 -> 0003)
[  116.807519] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[  116.898052] SuperH (H)SCI(F) driver initialized
[  116.916586] msm_serial: driver initialized
[  116.966160] cacheinfo: Unable to detect cache hierarchy for CPU 0
[  117.230609] loop: module loaded
[  117.261553] megasas: 07.714.04.00-rc1
[  117.299460] scsi host0: Virtio SCSI HBA
[  117.332400] scsi 0:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5
[  119.896235] random: fast init done
[  119.962094] sd 0:0:0:0: Power-on or device reset occurred
[  119.988603] sd 0:0:0:0: [sda] 524288 512-byte logical blocks: (268 MB/256 MiB)
[  119.990909] sd 0:0:0:0: [sda] Write Protect is off
[  119.991894] sd 0:0:0:0: [sda] Mode Sense: 63 00 00 08
[  120.000849] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  120.005403] sda: detected capacity change from 0 to 268435456
[  120.104701] physmap-flash 0.flash: physmap platform flash device: [mem 0x00000000-0x03ffffff]
[  120.107055] 0.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
[  120.113218] Intel/Sharp Extended Query Table at 0x0031
[  120.114867] Using buffer write method
[  120.125192] erase region 0: offset=0x0,size=0x40000,blocks=256
[  120.126226] physmap-flash 0.flash: physmap platform flash device: [mem 0x04000000-0x07ffffff]
[  120.127789] 0.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
[  120.128353] Intel/Sharp Extended Query Table at 0x0031
[  120.129355] Using buffer write method
[  120.129810] erase region 0: offset=0x0,size=0x40000,blocks=256
[  120.130313] Concatenating MTD devices:
[  120.130686] (0): "0.flash"
[  120.135876] (1): "0.flash"
[  120.136225] into device "0.flash"
[  120.192278] sda: detected capacity change from 0 to 268435456
[  120.193045] sd 0:0:0:0: [sda] Attached SCSI disk
[  120.387475] libphy: Fixed MDIO Bus: probed
[  120.432985] tun: Universal TUN/TAP device driver, 1.6
[  120.489130] thunder_xcv, ver 1.0
[  120.490797] thunder_bgx, ver 1.0
[  120.492770] nicpf, ver 1.0
[  120.537316] hclge is initializing
[  120.538538] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[  120.538958] hns3: Copyright (c) 2017 Huawei Corporation.
[  120.541156] e1000: Intel(R) PRO/1000 Network Driver
[  120.541528] e1000: Copyright (c) 1999-2006 Intel Corporation.
[  120.543589] e1000e: Intel(R) PRO/1000 Network Driver
[  120.543956] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[  120.545789] igb: Intel(R) Gigabit Ethernet Network Driver
[  120.546176] igb: Copyright (c) 2007-2014 Intel Corporation.
[  120.547883] igbvf: Intel(R) Gigabit Virtual Function Network Driver
[  120.548276] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[  120.562052] sky2: driver version 1.30
[  120.597519] VFIO - User Level meta-driver version: 0.3
[  120.658110] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[  120.658597] ehci-pci: EHCI PCI platform driver
[  120.660406] ehci-platform: EHCI generic platform driver
[  120.664987] ehci-orion: EHCI orion driver
[  120.669400] ehci-exynos: EHCI Exynos driver
[  120.673747] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[  120.674701] ohci-pci: OHCI PCI platform driver
[  120.676572] ohci-platform: OHCI generic platform driver
[  120.681095] ohci-exynos: OHCI Exynos driver
[  120.697532] usbcore: registered new interface driver usb-storage
[  120.806431] rtc-pl031 9010000.pl031: registered as rtc0
[  120.808336] rtc-pl031 9010000.pl031: setting system clock to 2020-11-30T11:37:20 UTC (1606736240)
[  120.831534] i2c /dev entries driver
[  121.067859] sdhci: Secure Digital Host Controller Interface driver
[  121.068255] sdhci: Copyright(c) Pierre Ossman
[  121.084261] Synopsys Designware Multimedia Card Interface Driver
[  121.122438] sdhci-pltfm: SDHCI platform and OF driver helper
[  121.176067] ledtrig-cpu: registered to indicate activity on CPUs
[  121.237585] usbcore: registered new interface driver usbhid
[  121.237987] usbhid: USB HID core driver
[  121.414229] drop_monitor: Initializing network drop monitor service
[  121.418007] NET: Registered protocol family 17
[  121.424102] 9pnet: Installing 9P2000 support
[  121.443895] Key type dns_resolver registered
[  121.451895] registered taskstats version 1
[  121.453581] Running tests on all trace events:
[  121.453937] Testing all events: OK
[  180.314804] Running tests again, along with the function tracer
[  180.334448] Running tests on all trace events:
[  180.346904] Testing all events: 
[  186.731798] hrtimer: interrupt took 10487664 ns
[  219.711287] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 13s!
[  219.875132] Showing busy workqueues and worker pools:
[  219.910747] workqueue events: flags=0x0
[  219.939591]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  219.951310]     pending: vmstat_shepherd
[  219.963073] workqueue events_power_efficient: flags=0x82
[  219.999935]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
[  220.009975]     in-flight: 7:do_cache_clean
[  220.030092] pool 2: cpus=0 flags=0x4 nice=0 hung=0s workers=3 idle: 61 99
[  230.303201] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 24s!
[  230.410755] Showing busy workqueues and worker pools:
[  230.427157] workqueue events: flags=0x0
[  230.443262]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  230.454087]     pending: vmstat_shepherd
[  351.797552] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 11s!
[  351.843185] Showing busy workqueues and worker pools:
[  351.875356] workqueue events: flags=0x0
[  351.906690]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  351.917412]     pending: vmstat_shepherd
[  351.938890] workqueue events_power_efficient: flags=0x82
[  351.970790]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
[  351.979994]     pending: neigh_periodic_work
[  389.525557] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 17s!
[  389.600725] Showing busy workqueues and worker pools:
[  389.617453] workqueue events: flags=0x0
[  389.623272]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  389.634046]     pending: vmstat_shepherd
[  389.650704] workqueue events_power_efficient: flags=0x82
[  389.671328]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
[  389.680463]     in-flight: 7:neigh_periodic_work
[  389.704734] pool 2: cpus=0 flags=0x4 nice=0 hung=9s workers=3 idle: 61 99
[  453.731592] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
[  453.790537] Showing busy workqueues and worker pools:
[  453.796398] workqueue events: flags=0x0
[  453.823200]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  453.833529]     pending: vmstat_shepherd
[  453.852558] workqueue events_power_efficient: flags=0x82
[  453.858588]   pwq 2: cpus=0 flags=0x5 nice=0 active=2/256 refcnt=4
[  453.867424]     in-flight: 7:do_cache_clean
[  453.874323]     pending: neigh_periodic_work
[  453.894345] pool 2: cpus=0 flags=0x5 nice=0 hung=8s workers=2 manager: 61
[  598.019250] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 16s!
[  598.131254] Showing busy workqueues and worker pools:
[  598.200541] workqueue events: flags=0x0
[  598.217960]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  598.228669]     pending: vmstat_shepherd
[  598.246863] workqueue events_power_efficient: flags=0x82
[  598.279406]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
[  598.288499]     in-flight: 106:do_cache_clean
[  598.319372] pool 2: cpus=0 flags=0x4 nice=0 hung=8s workers=3 idle: 61 7
[  795.287162] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
[  795.311095] BUG: workqueue lockup - pool cpus=0 flags=0x4 nice=0 stuck for 10s!
[  795.334433] Showing busy workqueues and worker pools:
[  795.343043] workqueue events: flags=0x0
[  795.354006]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  795.361092]     pending: vmstat_shepherd
[  795.370452] workqueue events_power_efficient: flags=0x82
[  795.379095]   pwq 2: cpus=0 flags=0x4 nice=0 active=3/256 refcnt=5
[  795.385173]     in-flight: 106:check_lifetime
[  795.389953]     pending: neigh_periodic_work, do_cache_clean
[  795.401803] pool 2: cpus=0 flags=0x4 nice=0 hung=10s workers=3 idle: 61 7
[  840.280588] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 15s!
[  840.370856] Showing busy workqueues and worker pools:
[  840.400495] workqueue events: flags=0x0
[  840.417468]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  840.427827]     pending: vmstat_shepherd
[  840.473295] pool 2: cpus=0 flags=0x5 nice=0 hung=6s workers=3 manager: 7 idle: 106 61
[  889.716728] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 12s!
[  889.787233] BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 12s!
[  889.936565] Showing busy workqueues and worker pools:
[  889.953557] workqueue events: flags=0x0
[  889.959094]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  889.969435]     pending: vmstat_shepherd
[  889.990858] workqueue events_power_efficient: flags=0x82
[  890.022774]   pwq 2: cpus=0 flags=0x5 nice=0 active=1/256 refcnt=3
[  890.031587]     pending: neigh_periodic_work
[  890.059229] pool 2: cpus=0 flags=0x5 nice=0 hung=12s workers=3 manager: 7 idle: 106 61
[  903.560770] BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 25s!
[  903.610830] Showing busy workqueues and worker pools:
[  903.616897] workqueue events: flags=0x0
[  903.633819]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
[  903.644574]     in-flight: 15:vmstat_shepherd
[  903.662870] workqueue events_power_efficient: flags=0x82
[  903.726795]   pwq 2: cpus=0 flags=0x5 nice=0 active=3/256 refcnt=5
[  903.736114]     pending: neigh_periodic_work, do_cache_clean, check_lifetime
[  903.758987] pool 0: cpus=0 node=0 flags=0x0 nice=0 hung=2s workers=2 idle: 5
[  903.785300] pool 2: cpus=0 flags=0x5 nice=0 hung=26s workers=4 manager: 7 idle: 107 106 61
[ 1211.521119] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 1211.527302] 	(detected by 0, t=3752 jiffies, g=2329, q=2)
[ 1211.529303] rcu: All QSes seen, last rcu_preempt kthread activity 3503 (4295192252-4295188749), jiffies_till_next_fqs=1, root ->qsmask 0x0
[ 1211.540472] rcu: rcu_preempt kthread starved for 3503 jiffies! g2329 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0
[ 1211.546502] rcu: 	Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
[ 1211.552234] rcu: RCU grace-period kthread stack dump:
[ 1211.556893] task:rcu_preempt     state:R  running task     stack:    0 pid:   10 ppid:     2 flags:0x00000428
[ 1211.566196] Call trace:
[ 1211.570036]  __switch_to+0x148/0x1f0
[ 1211.574189]  __schedule+0x2dc/0x9a0
[ 1211.578355]  preempt_schedule_notrace+0x70/0x1c0
[ 1211.582822]  ftrace_ops_list_func+0x10c/0x218
[ 1211.587212]  ftrace_graph_call+0x0/0x4
[ 1211.591434]  preempt_count_add+0x8/0x1a0
[ 1211.595716]  schedule+0x44/0x100
[ 1211.599779]  schedule_timeout+0x240/0x538
[ 1211.604098]  rcu_gp_kthread+0x618/0x1bd8
[ 1211.608398]  kthread+0x13c/0x188
[ 1211.612480]  ret_from_fork+0x10/0x34
[ 1211.616726] rcu: Stack dump where RCU GP kthread last ran:
[ 1211.621458] Task dump for CPU 0:
[ 1211.625472] task:event_benchmark state:R  running task     stack:    0 pid:  105 ppid:     2 flags:0x0000042a
[ 1211.634526] Call trace:
[ 1211.638364]  dump_backtrace+0x0/0x240
[ 1211.642586]  show_stack+0x34/0x88
[ 1211.646715]  sched_show_task+0x208/0x230
[ 1211.650995]  dump_cpu_task+0x4c/0x5c
[ 1211.655215]  rcu_check_gp_kthread_starvation+0x240/0x388
[ 1211.659949]  rcu_sched_clock_irq+0xc2c/0xd40
[ 1211.664331]  update_process_times+0x6c/0xb8
[ 1211.668703]  tick_sched_handle.isra.0+0x58/0x88
[ 1211.673168]  tick_sched_timer+0x68/0xe0
[ 1211.677459]  __hrtimer_run_queues+0x288/0x730
[ 1211.681873]  hrtimer_interrupt+0x114/0x288
[ 1211.686235]  arch_timer_handler_virt+0x50/0x70
[ 1211.690664]  handle_percpu_devid_irq+0x104/0x4c0
[ 1211.695127]  generic_handle_irq+0x54/0x78
[ 1211.699396]  __handle_domain_irq+0xac/0x130
[ 1211.703736]  gic_handle_irq+0x70/0x108
[ 1211.707949]  el1_irq+0xc4/0x180
[ 1211.711937]  _raw_spin_unlock_irq+0x50/0x98
[ 1211.716304]  finish_task_switch+0xb4/0x398
[ 1211.720649]  __schedule+0x2e0/0x9a0
[ 1211.724815]  preempt_schedule_irq+0x4c/0xa0
[ 1211.729191]  arm64_preempt_schedule_irq+0xd0/0x118
[ 1211.733737]  el1_irq+0xdc/0x180
[ 1211.737771]  benchmark_event_kthread+0x144/0x4b0
[ 1211.742255]  kthread+0x13c/0x188
[ 1211.746320]  ret_from_fork+0x10/0x34
[ 1211.755343] 
[ 1211.757649] ================================
[ 1211.760669] WARNING: inconsistent lock state
[ 1211.763880] 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1 Not tainted
[ 1211.767588] --------------------------------
[ 1211.770630] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[ 1211.774224] event_benchmark/105 [HC0[0]:SC0[0]:HE0:SE1] takes:
[ 1211.777779] ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40
[ 1211.785746] {IN-HARDIRQ-W} state was registered at:
[ 1211.789124]   __lock_acquire+0xae8/0x1b00
[ 1211.792183]   lock_acquire+0x268/0x508
[ 1211.795161]   _raw_spin_lock_irqsave+0x78/0x14c
[ 1211.798335]   rcu_sched_clock_irq+0x428/0xd40
[ 1211.801476]   update_process_times+0x6c/0xb8
[ 1211.804567]   tick_sched_handle.isra.0+0x58/0x88
[ 1211.807746]   tick_sched_timer+0x68/0xe0
[ 1211.810778]   __hrtimer_run_queues+0x288/0x730
[ 1211.813963]   hrtimer_interrupt+0x114/0x288
[ 1211.817035]   arch_timer_handler_virt+0x50/0x70
[ 1211.820187]   handle_percpu_devid_irq+0x104/0x4c0
[ 1211.823434]   generic_handle_irq+0x54/0x78
[ 1211.826498]   __handle_domain_irq+0xac/0x130
[ 1211.829584]   gic_handle_irq+0x70/0x108
[ 1211.832555]   el1_irq+0xc4/0x180
[ 1211.835370]   _raw_spin_unlock_irq+0x50/0x98
[ 1211.838473]   finish_task_switch+0xb4/0x398
[ 1211.841540]   __schedule+0x2e0/0x9a0
[ 1211.844477]   preempt_schedule_irq+0x4c/0xa0
[ 1211.847590]   arm64_preempt_schedule_irq+0xd0/0x118
[ 1211.850859]   el1_irq+0xdc/0x180
[ 1211.853636]   benchmark_event_kthread+0x144/0x4b0
[ 1211.856906]   kthread+0x13c/0x188
[ 1211.859729]   ret_from_fork+0x10/0x34
[ 1211.862686] irq event stamp: 67642
[ 1211.865588] hardirqs last  enabled at (67641): [<ffffa17ef303ec78>] _raw_spin_unlock_irq+0x48/0x98
[ 1211.870078] hardirqs last disabled at (67642): [<ffffa17ef30310a8>] enter_el1_irq_or_nmi+0x20/0x30
[ 1211.874532] softirqs last  enabled at (63366): [<ffffa17ef1c10b80>] __do_softirq+0x630/0x6b4
[ 1211.878770] softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] irq_exit+0x1cc/0x1e0
[ 1211.882828] 
[ 1211.882828] other info that might help us debug this:
[ 1211.886512]  Possible unsafe locking scenario:
[ 1211.886512] 
[ 1211.889961]        CPU0
[ 1211.892451]        ----
[ 1211.894935]   lock(rcu_node_0);
[ 1211.899732]   <Interrupt>
[ 1211.902272]     lock(rcu_node_0);
[ 1211.906707] 
[ 1211.906707]  *** DEADLOCK ***
[ 1211.906707] 
[ 1211.910237] 1 lock held by event_benchmark/105:
[ 1211.913352]  #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40
[ 1211.922068] 
[ 1211.922068] stack backtrace:
[ 1211.925381] CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
[ 1211.930018] Hardware name: linux,dummy-virt (DT)
[ 1211.933192] Call trace:
[ 1211.935795]  dump_backtrace+0x0/0x240
[ 1211.938733]  show_stack+0x34/0x88
[ 1211.941539]  dump_stack+0x140/0x1bc
[ 1211.944421]  print_usage_bug+0x2a0/0x2f0
[ 1211.947405]  mark_lock.part.0+0x438/0x4e8
[ 1211.950420]  mark_held_locks+0x54/0x90
[ 1211.953393]  lockdep_hardirqs_on_prepare+0xe0/0x290
[ 1211.956665]  trace_hardirqs_on+0x90/0x370
[ 1211.959701]  exit_to_kernel_mode.isra.0+0xf8/0x208
[ 1211.962948]  exit_el1_irq_or_nmi+0x24/0x38
[ 1211.965971]  el1_irq+0xe4/0x180
[ 1211.968779]  _raw_spin_unlock_irq+0x50/0x98
[ 1211.971832]  finish_task_switch+0xb4/0x398
[ 1211.974885]  __schedule+0x2e0/0x9a0
[ 1211.977744]  preempt_schedule_irq+0x4c/0xa0
[ 1211.980856]  arm64_preempt_schedule_irq+0xd0/0x118
[ 1211.984101]  el1_irq+0xdc/0x180
[ 1211.986889]  benchmark_event_kthread+0x144/0x4b0
[ 1211.990118]  kthread+0x13c/0x188
[ 1211.992910]  ret_from_fork+0x10/0x34
[ 1211.998610] BUG: scheduling while atomic: event_benchmark/105/0x00000002
[ 1212.010060] INFO: lockdep is turned off.
[ 1212.018261] Modules linked in:
[ 1212.030227] Preemption disabled at:
[ 1212.034171] [<ffffa17ef3037114>] preempt_schedule_irq+0x3c/0xa0
[ 1212.049696] CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
[ 1212.054368] Hardware name: linux,dummy-virt (DT)
[ 1212.057507] Call trace:
[ 1212.060101]  dump_backtrace+0x0/0x240
[ 1212.063052]  show_stack+0x34/0x88
[ 1212.065890]  dump_stack+0x140/0x1bc
[ 1212.068791]  __schedule_bug+0xcc/0xe0
[ 1212.071729]  __schedule+0x868/0x9a0
[ 1212.074625]  preempt_schedule_irq+0x4c/0xa0
[ 1212.077714]  arm64_preempt_schedule_irq+0xd0/0x118
[ 1212.080945]  el1_irq+0xdc/0x180
[ 1212.083732]  benchmark_event_kthread+0x144/0x4b0
[ 1212.086931]  kthread+0x13c/0x188
[ 1212.089704]  ret_from_fork+0x10/0x34

[-- Attachment #4: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes
  2020-11-30 12:03 ` Marco Elver
@ 2020-11-30 12:38   ` Mark Rutland
       [not found]     ` <20201130133245.GA1307615@elver.google.com>
  0 siblings, 1 reply; 21+ messages in thread
From: Mark Rutland @ 2020-11-30 12:38 UTC (permalink / raw)
  To: Marco Elver
  Cc: paulmck, peterz, catalin.marinas, james.morse, linux-arm-kernel,
	will, dvyukov

Hi Marco,

On Mon, Nov 30, 2020 at 01:03:05PM +0100, Marco Elver wrote:
> [ FYI, this series was not Cc'd to LKML. ]

Yes -- I had assumed LAKML was sufficient for this, though I'm happy to
CC LKML in future if people would like me to.

BTW, I've just sent a v2 (which should not functionally differ from v1
other than when building SDEI):

  https://lore.kernel.org/r/20201130115950.22492-1-mark.rutland@arm.com
  
> On Thu, Nov 26, 2020 at 12:35PM +0000, Mark Rutland wrote:
> > Dmitry and Marco both reported some weirdness with lockdep on arm64 erroneously
> > reporting the hardware IRQ state, and inexplicable RCU stalls:
> > 
> >   https://lore.kernel.org/r/CACT4Y+aAzoJ48Mh1wNYD17pJqyEcDnrxGfApir=-j171TnQXhw@mail.gmail.com
> >   https://lore.kernel.org/r/20201119193819.GA2601289@elver.google.com
> > 
> > Having investigated, I believe that this is largely down to the arm64 entry
> > code not correctly managing RCU, lockdep, irq flag tracing, and context
> > tracking. This series attempts to fix those cases, and I've Cc'd folk from the
> > previous threads as a heads-up.

[...]

> So, I was hoping that this would fix all the problems I was seeing when
> running the ftrace tests ... unfortunately, it didn't. :-( Perhaps the
> WIP version you had only worked because it ended up disabling lockdep
> early?

Possibly, yes. Either that or the way we do / do-not treat debug
exceptions as true NMIs. Either way this appears to be a latent issue
rather than something introduced by this series.

From the log below I see you're using:

  5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1 Not tainted

... and it's possible that the issue you're seeing now is a delta
between v5.10-rc3 and what's queued in linux-next -- I've been running
the ftrace tests locally without issue atop v5.10-rc3 and v5.10-rc5.

Are you able to reproduce this on my branch alone? If so that gives us a
stable tree to investigate, and if not that gives us a stable base for a
bisect against linux-next.

This area is really sensitive to config options, so if you can reproduce
this on a stable base, could you share youir exact config?

> I've attached the log and the symbolized report.

Thanks for all this. I'll see if I can tickle this locally while waiting
for the above. If you could share your config from this time around
that'd be a great head-start!

Thanks,
Mark.

> Testing all events: OK
> Running tests again, along with the function tracer
> Running tests on all trace events:
> Testing all events: 
> hrtimer: interrupt took 10487664 ns
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 13s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
>     in-flight: 7:do_cache_clean
> pool 2: cpus=0 flags=0x4 nice=0 hung=0s workers=3 idle: 61 99
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 24s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 11s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
>     pending: neigh_periodic_work
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 17s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
>     in-flight: 7:neigh_periodic_work
> pool 2: cpus=0 flags=0x4 nice=0 hung=9s workers=3 idle: 61 99
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x5 nice=0 active=2/256 refcnt=4
>     in-flight: 7:do_cache_clean
>     pending: neigh_periodic_work
> pool 2: cpus=0 flags=0x5 nice=0 hung=8s workers=2 manager: 61
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 16s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
>     in-flight: 106:do_cache_clean
> pool 2: cpus=0 flags=0x4 nice=0 hung=8s workers=3 idle: 61 7
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
> BUG: workqueue lockup - pool cpus=0 flags=0x4 nice=0 stuck for 10s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x4 nice=0 active=3/256 refcnt=5
>     in-flight: 106:check_lifetime
>     pending: neigh_periodic_work, do_cache_clean
> pool 2: cpus=0 flags=0x4 nice=0 hung=10s workers=3 idle: 61 7
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 15s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> pool 2: cpus=0 flags=0x5 nice=0 hung=6s workers=3 manager: 7 idle: 106 61
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 12s!
> BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 12s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     pending: vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x5 nice=0 active=1/256 refcnt=3
>     pending: neigh_periodic_work
> pool 2: cpus=0 flags=0x5 nice=0 hung=12s workers=3 manager: 7 idle: 106 61
> BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 25s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x0
>   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
>     in-flight: 15:vmstat_shepherd
> workqueue events_power_efficient: flags=0x82
>   pwq 2: cpus=0 flags=0x5 nice=0 active=3/256 refcnt=5
>     pending: neigh_periodic_work, do_cache_clean, check_lifetime
> pool 0: cpus=0 node=0 flags=0x0 nice=0 hung=2s workers=2 idle: 5
> pool 2: cpus=0 flags=0x5 nice=0 hung=26s workers=4 manager: 7 idle: 107 106 61
> rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> 	(detected by 0, t=3752 jiffies, g=2329, q=2)
> rcu: All QSes seen, last rcu_preempt kthread activity 3503 (4295192252-4295188749), jiffies_till_next_fqs=1, root ->qsmask 0x0
> rcu: rcu_preempt kthread starved for 3503 jiffies! g2329 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0
> rcu: 	Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
> rcu: RCU grace-period kthread stack dump:
> task:rcu_preempt     state:R  running task     stack:    0 pid:   10 ppid:     2 flags:0x00000428
> Call trace:
>  __switch_to+0x148/0x1f0 arch/arm64/kernel/process.c:577
>  context_switch kernel/sched/core.c:4269 [inline]
>  __schedule+0x2dc/0x9a0 kernel/sched/core.c:5019
>  preempt_schedule_notrace+0x70/0x1c0 kernel/sched/core.c:5252
>  __ftrace_ops_list_func kernel/trace/ftrace.c:6955 [inline]
>  ftrace_ops_list_func+0x10c/0x218 kernel/trace/ftrace.c:6976
>  ftrace_graph_call+0x0/0x4
>  preempt_count_add+0x8/0x1a0 arch/arm64/include/asm/atomic.h:65
>  schedule+0x44/0x100 kernel/sched/core.c:5097
>  schedule_timeout+0x240/0x538 kernel/time/timer.c:1871
>  rcu_gp_fqs_loop kernel/rcu/tree.c:1946 [inline]
>  rcu_gp_kthread+0x618/0x1bd8 kernel/rcu/tree.c:2119
>  kthread+0x13c/0x188 kernel/kthread.c:292
>  ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
> rcu: Stack dump where RCU GP kthread last ran:
> Task dump for CPU 0:
> task:event_benchmark state:R  running task     stack:    0 pid:  105 ppid:     2 flags:0x0000042a
> Call trace:
>  dump_backtrace+0x0/0x240 arch/arm64/kernel/stacktrace.c:100
>  show_stack+0x34/0x88 arch/arm64/kernel/stacktrace.c:196
>  sched_show_task kernel/sched/core.c:6948 [inline]
>  sched_show_task+0x208/0x230 kernel/sched/core.c:6922
>  dump_cpu_task+0x4c/0x5c kernel/sched/core.c:8986
>  rcu_check_gp_kthread_starvation+0x240/0x388 kernel/rcu/tree_stall.h:480
>  print_other_cpu_stall kernel/rcu/tree_stall.h:551 [inline]
>  check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
>  rcu_pending kernel/rcu/tree.c:3760 [inline]
>  rcu_sched_clock_irq+0xc2c/0xd40 kernel/rcu/tree.c:2587
>  update_process_times+0x6c/0xb8 kernel/time/timer.c:1709
>  tick_sched_handle.isra.0+0x58/0x88 kernel/time/tick-sched.c:176
>  tick_sched_timer+0x68/0xe0 kernel/time/tick-sched.c:1328
>  __run_hrtimer kernel/time/hrtimer.c:1519 [inline]
>  __hrtimer_run_queues+0x288/0x730 kernel/time/hrtimer.c:1583
>  hrtimer_interrupt+0x114/0x288 kernel/time/hrtimer.c:1645
>  timer_handler drivers/clocksource/arm_arch_timer.c:647 [inline]
>  arch_timer_handler_virt+0x50/0x70 drivers/clocksource/arm_arch_timer.c:658
>  handle_percpu_devid_irq+0x104/0x4c0 kernel/irq/chip.c:930
>  generic_handle_irq_desc include/linux/irqdesc.h:152 [inline]
>  generic_handle_irq+0x54/0x78 kernel/irq/irqdesc.c:650
>  __handle_domain_irq+0xac/0x130 kernel/irq/irqdesc.c:687
>  handle_domain_irq include/linux/irqdesc.h:170 [inline]
>  gic_handle_irq+0x70/0x108 drivers/irqchip/irq-gic.c:370
>  el1_irq+0xc4/0x180 arch/arm64/kernel/entry.S:640
>  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>  __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
>  _raw_spin_unlock_irq+0x50/0x98 kernel/locking/spinlock.c:199
>  finish_lock_switch kernel/sched/core.c:4047 [inline]
>  finish_task_switch+0xb4/0x398 kernel/sched/core.c:4147
>  context_switch kernel/sched/core.c:4272 [inline]
>  __schedule+0x2e0/0x9a0 kernel/sched/core.c:5019
>  preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
>  arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
>  el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
>  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>  trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
>  benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
>  kthread+0x13c/0x188 kernel/kthread.c:292
>  ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
> 
> ================================
> WARNING: inconsistent lock state
> 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1 Not tainted
> --------------------------------
> inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
> event_benchmark/105 [HC0[0]:SC0[0]:HE0:SE1] takes:
> ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: print_other_cpu_stall kernel/rcu/tree_stall.h:512 [inline]
> ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
> ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_pending kernel/rcu/tree.c:3760 [inline]
> ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40 kernel/rcu/tree.c:2587
> {IN-HARDIRQ-W} state was registered at:
>   mark_lock kernel/locking/lockdep.c:4373 [inline]
>   mark_usage kernel/locking/lockdep.c:4301 [inline]
>   __lock_acquire+0xae8/0x1b00 kernel/locking/lockdep.c:4784
>   lock_acquire kernel/locking/lockdep.c:5435 [inline]
>   lock_acquire+0x268/0x508 kernel/locking/lockdep.c:5400
>   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
>   _raw_spin_lock_irqsave+0x78/0x14c kernel/locking/spinlock.c:159
>   print_other_cpu_stall kernel/rcu/tree_stall.h:512 [inline]
>   check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
>   rcu_pending kernel/rcu/tree.c:3760 [inline]
>   rcu_sched_clock_irq+0x428/0xd40 kernel/rcu/tree.c:2587
>   update_process_times+0x6c/0xb8 kernel/time/timer.c:1709
>   tick_sched_handle.isra.0+0x58/0x88 kernel/time/tick-sched.c:176
>   tick_sched_timer+0x68/0xe0 kernel/time/tick-sched.c:1328
>   __run_hrtimer kernel/time/hrtimer.c:1519 [inline]
>   __hrtimer_run_queues+0x288/0x730 kernel/time/hrtimer.c:1583
>   hrtimer_interrupt+0x114/0x288 kernel/time/hrtimer.c:1645
>   timer_handler drivers/clocksource/arm_arch_timer.c:647 [inline]
>   arch_timer_handler_virt+0x50/0x70 drivers/clocksource/arm_arch_timer.c:658
>   handle_percpu_devid_irq+0x104/0x4c0 kernel/irq/chip.c:930
>   generic_handle_irq_desc include/linux/irqdesc.h:152 [inline]
>   generic_handle_irq+0x54/0x78 kernel/irq/irqdesc.c:650
>   __handle_domain_irq+0xac/0x130 kernel/irq/irqdesc.c:687
>   handle_domain_irq include/linux/irqdesc.h:170 [inline]
>   gic_handle_irq+0x70/0x108 drivers/irqchip/irq-gic.c:370
>   el1_irq+0xc4/0x180 arch/arm64/kernel/entry.S:640
>   arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>   __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
>   _raw_spin_unlock_irq+0x50/0x98 kernel/locking/spinlock.c:199
>   finish_lock_switch kernel/sched/core.c:4047 [inline]
>   finish_task_switch+0xb4/0x398 kernel/sched/core.c:4147
>   context_switch kernel/sched/core.c:4272 [inline]
>   __schedule+0x2e0/0x9a0 kernel/sched/core.c:5019
>   preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
>   arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
>   el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
>   arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>   trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
>   benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
>   kthread+0x13c/0x188 kernel/kthread.c:292
>   ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
> irq event stamp: 67642
> hardirqs last  enabled at (67641): [<ffffa17ef303ec78>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
> hardirqs last  enabled at (67641): [<ffffa17ef303ec78>] _raw_spin_unlock_irq+0x48/0x98 kernel/locking/spinlock.c:199
> hardirqs last disabled at (67642): [<ffffa17ef30310a8>] enter_el1_irq_or_nmi+0x20/0x30 arch/arm64/kernel/entry-common.c:93
> softirqs last  enabled at (63366): [<ffffa17ef1c10b80>] __do_softirq+0x630/0x6b4 kernel/softirq.c:325
> softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] do_softirq_own_stack include/linux/interrupt.h:568 [inline]
> softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] invoke_softirq kernel/softirq.c:393 [inline]
> softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] __irq_exit_rcu kernel/softirq.c:423 [inline]
> softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] irq_exit+0x1cc/0x1e0 kernel/softirq.c:447
> 
> other info that might help us debug this:
>  Possible unsafe locking scenario:
> 
>        CPU0
>        ----
>   lock(rcu_node_0);
>   <Interrupt>
>     lock(rcu_node_0);
> 
>  *** DEADLOCK ***
> 
> 1 lock held by event_benchmark/105:
>  #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: print_other_cpu_stall kernel/rcu/tree_stall.h:512 [inline]
>  #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: check_cpu_stall kernel/rcu/tree_stall.h:671 [inline]
>  #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_pending kernel/rcu/tree.c:3760 [inline]
>  #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40 kernel/rcu/tree.c:2587
> 
> stack backtrace:
> CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
> Hardware name: linux,dummy-virt (DT)
> Call trace:
>  dump_backtrace+0x0/0x240 arch/arm64/kernel/stacktrace.c:100
>  show_stack+0x34/0x88 arch/arm64/kernel/stacktrace.c:196
>  __dump_stack lib/dump_stack.c:79 [inline]
>  dump_stack+0x140/0x1bc lib/dump_stack.c:120
>  print_usage_bug kernel/locking/lockdep.c:3738 [inline]
>  print_usage_bug+0x2a0/0x2f0 kernel/locking/lockdep.c:3705
>  valid_state kernel/locking/lockdep.c:3749 [inline]
>  mark_lock_irq kernel/locking/lockdep.c:3952 [inline]
>  mark_lock.part.0+0x438/0x4e8 kernel/locking/lockdep.c:4409
>  mark_lock kernel/locking/lockdep.c:4007 [inline]
>  mark_held_locks+0x54/0x90 kernel/locking/lockdep.c:4010
>  __trace_hardirqs_on_caller kernel/locking/lockdep.c:4028 [inline]
>  lockdep_hardirqs_on_prepare+0xe0/0x290 kernel/locking/lockdep.c:4096
>  trace_hardirqs_on+0x90/0x370 kernel/trace/trace_preemptirq.c:49
>  exit_to_kernel_mode.isra.0+0xf8/0x208 arch/arm64/kernel/entry-common.c:51
>  exit_el1_irq_or_nmi+0x24/0x38 arch/arm64/kernel/entry-common.c:101
>  el1_irq+0xe4/0x180 arch/arm64/kernel/entry.S:658
>  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>  __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
>  _raw_spin_unlock_irq+0x50/0x98 kernel/locking/spinlock.c:199
>  finish_lock_switch kernel/sched/core.c:4047 [inline]
>  finish_task_switch+0xb4/0x398 kernel/sched/core.c:4147
>  context_switch kernel/sched/core.c:4272 [inline]
>  __schedule+0x2e0/0x9a0 kernel/sched/core.c:5019
>  preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
>  arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
>  el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
>  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>  trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
>  benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
>  kthread+0x13c/0x188 kernel/kthread.c:292
>  ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929
> BUG: scheduling while atomic: event_benchmark/105/0x00000002
> INFO: lockdep is turned off.
> Modules linked in:
> Preemption disabled at:
> [<ffffa17ef3037114>] preempt_schedule_irq+0x3c/0xa0 kernel/sched/core.c:5279
> CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
> Hardware name: linux,dummy-virt (DT)
> Call trace:
>  dump_backtrace+0x0/0x240 arch/arm64/kernel/stacktrace.c:100
>  show_stack+0x34/0x88 arch/arm64/kernel/stacktrace.c:196
>  __dump_stack lib/dump_stack.c:79 [inline]
>  dump_stack+0x140/0x1bc lib/dump_stack.c:120
>  __schedule_bug+0xcc/0xe0 kernel/sched/core.c:4758
>  schedule_debug kernel/sched/core.c:4785 [inline]
>  __schedule+0x868/0x9a0 kernel/sched/core.c:4913
>  preempt_schedule_irq+0x4c/0xa0 kernel/sched/core.c:5281
>  arm64_preempt_schedule_irq+0xd0/0x118 arch/arm64/kernel/process.c:725
>  el1_irq+0xdc/0x180 arch/arm64/kernel/entry.S:653
>  arch_local_irq_enable arch/arm64/include/asm/irqflags.h:37 [inline]
>  trace_do_benchmark kernel/trace/trace_benchmark.c:56 [inline]
>  benchmark_event_kthread+0x144/0x4b0 kernel/trace/trace_benchmark.c:154
>  kthread+0x13c/0x188 kernel/kthread.c:292
>  ret_from_fork+0x10/0x34 arch/arm64/kernel/entry.S:929

> [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
> [    0.000000] Linux version 5.10.0-rc4-next-20201119-00002-gc88aca8827ce (elver@elver.muc.corp.google.com) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #1 SMP PREEMPT Mon Nov 30 12:29:39 CET 2020
> [    0.000000] Machine model: linux,dummy-virt
> [    0.000000] efi: UEFI not found.
> [    0.000000] cma: Reserved 32 MiB at 0x00000000be000000
> [    0.000000] earlycon: pl11 at MMIO 0x0000000009000000 (options '')
> [    0.000000] printk: bootconsole [pl11] enabled
> [    0.000000] NUMA: No NUMA configuration found
> [    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bfffffff]
> [    0.000000] NUMA: NODE_DATA [mem 0xbdbf6000-0xbdbf7fff]
> [    0.000000] Zone ranges:
> [    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
> [    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000bfffffff]
> [    0.000000]   Normal   empty
> [    0.000000] Movable zone start for each node
> [    0.000000] Early memory node ranges
> [    0.000000]   node   0: [mem 0x0000000040000000-0x00000000bfffffff]
> [    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
> [    0.000000] On node 0 totalpages: 524288
> [    0.000000]   DMA zone: 4096 pages used for memmap
> [    0.000000]   DMA zone: 0 pages reserved
> [    0.000000]   DMA zone: 262144 pages, LIFO batch:63
> [    0.000000]   DMA32 zone: 4096 pages used for memmap
> [    0.000000]   DMA32 zone: 262144 pages, LIFO batch:63
> [    0.000000] psci: probing for conduit method from DT.
> [    0.000000] psci: PSCIv0.2 detected in firmware.
> [    0.000000] psci: Using standard PSCI v0.2 function IDs
> [    0.000000] psci: Trusted OS migration not required
> [    0.000000] percpu: Embedded 49 pages/cpu s162704 r8192 d29808 u200704
> [    0.000000] pcpu-alloc: s162704 r8192 d29808 u200704 alloc=49*4096
> [    0.000000] pcpu-alloc: [0] 0 
> [    0.000000] Detected PIPT I-cache on CPU0
> [    0.000000] CPU features: detected: ARM erratum 832075
> [    0.000000] CPU features: detected: ARM erratum 834220
> [    0.000000] CPU features: detected: EL2 vector hardening
> [    0.000000] CPU features: kernel page table isolation forced ON by KASLR
> [    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
> [    0.000000] CPU features: detected: Spectre-v2
> [    0.000000] CPU features: detected: Spectre-v4
> [    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
> [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516096
> [    0.000000] Policy zone: DMA32
> [    0.000000] Kernel command line: console=ttyAMA0 root=/dev/sda debug earlycon earlyprintk=serial slub_debug=UZ slub_debug=- workqueue.watchdog_thresh=10
> [    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
> [    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
> [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
> [    0.000000] software IO TLB: mapped [mem 0x000000007bfff000-0x000000007ffff000] (64MB)
> [    0.000000] Memory: 1903696K/2097152K available (20800K kernel code, 4024K rwdata, 8508K rodata, 8896K init, 11238K bss, 160688K reserved, 32768K cma-reserved)
> [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
> [    0.000000] ftrace: allocating 56173 entries in 220 pages
> [    0.000000] ftrace: allocated 220 pages with 5 groups
> [    0.000000] Running RCU self tests
> [    0.000000] rcu: Preemptible hierarchical RCU implementation.
> [    0.000000] rcu: 	RCU event tracing is enabled.
> [    0.000000] rcu: 	RCU lockdep checking is enabled.
> [    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=1.
> [    0.000000] 	Trampoline variant of Tasks RCU enabled.
> [    0.000000] 	Rude variant of Tasks RCU enabled.
> [    0.000000] 	Tracing variant of Tasks RCU enabled.
> [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
> [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
> [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
> [    0.000000] GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]
> [    0.000000] random: get_random_bytes called from start_kernel+0x468/0x670 with crng_init=0
> [    0.000000] arch_timer: cp15 timer(s) running at 62.50MHz (virt).
> [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
> [    0.000236] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
> [    0.011810] Console: colour dummy device 80x25
> [    0.013175] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
> [    0.013507] ... MAX_LOCKDEP_SUBCLASSES:  8
> [    0.013762] ... MAX_LOCK_DEPTH:          48
> [    0.014021] ... MAX_LOCKDEP_KEYS:        8192
> [    0.014276] ... CLASSHASH_SIZE:          4096
> [    0.014529] ... MAX_LOCKDEP_ENTRIES:     32768
> [    0.014784] ... MAX_LOCKDEP_CHAINS:      65536
> [    0.015040] ... CHAINHASH_SIZE:          32768
> [    0.015295]  memory used by lock dependency info: 6365 kB
> [    0.015563]  memory used for stack traces: 4224 kB
> [    0.015825]  per task-struct memory footprint: 1920 bytes
> [    0.018643] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=250000)
> [    0.019296] pid_max: default: 32768 minimum: 301
> [    0.022474] LSM: Security Framework initializing
> [    0.024666] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
> [    0.025865] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
> [    0.113064] rcu: Hierarchical SRCU implementation.
> [    0.132492] EFI services will not be available.
> [    0.137227] smp: Bringing up secondary CPUs ...
> [    0.137657] smp: Brought up 1 node, 1 CPU
> [    0.137985] SMP: Total of 1 processors activated.
> [    0.138417] CPU features: detected: 32-bit EL0 Support
> [    0.139154] CPU features: detected: CRC32 instructions
> [    0.139529] CPU features: detected: 32-bit EL1 Support
> [    0.563634] CPU: All CPU(s) started at EL1
> [    0.564913] alternatives: patching kernel code
> [    0.623566] devtmpfs: initialized
> [    0.695671] KASLR enabled
> [    0.724860] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
> [    0.725586] futex hash table entries: 256 (order: 3, 32768 bytes, linear)
> [    0.727427] Running postponed tracer tests:
> [    0.731229] Testing tracer function: PASSED
> [    8.838201] Testing dynamic ftrace: PASSED
> [    9.788507] Testing dynamic ftrace ops #1: 
> [   12.441107] (1 0 1 0 0) 
> [   12.441603] (1 1 2 0 0) 
> [   20.513697] (2 1 3 0 1132022) 
> [   20.516513] (2 2 4 0 1132450) PASSED
> [   24.660860] Testing dynamic ftrace ops #2: 
> [   34.874589] (1 0 1 1111841 0) 
> [   34.875920] (1 1 2 1112053 0) 
> [   34.941152] (2 1 3 1 2837) 
> [   34.942414] (2 2 4 200 3036) PASSED
> [   38.187248] Testing ftrace recursion: PASSED
> [   38.937602] Testing ftrace recursion safe: PASSED
> [   39.684401] Testing ftrace regs: PASSED
> [   40.438336] Testing tracer nop: PASSED
> [   40.442591] Testing tracer irqsoff: PASSED
> [   48.502343] Testing tracer preemptoff: PASSED
> [   56.603251] Testing tracer preemptirqsoff: PASSED
> [   64.741333] Testing tracer wakeup: PASSED
> [   72.700877] Testing tracer wakeup_rt: PASSED
> [   80.672483] Testing tracer wakeup_dl: PASSED
> [   88.647205] Testing tracer function_graph: PASSED
> [   95.311654] pinctrl core: initialized pinctrl subsystem
> [   95.357604] DMI not present or invalid.
> [   95.377573] NET: Registered protocol family 16
> [   95.442282] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
> [   95.443718] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
> [   95.446121] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
> [   95.448632] audit: initializing netlink subsys (disabled)
> [   95.457722] audit: type=2000 audit(83.900:1): state=initialized audit_enabled=0 res=1
> [   95.495840] thermal_sys: Registered thermal governor 'step_wise'
> [   95.496081] thermal_sys: Registered thermal governor 'power_allocator'
> [   95.499286] cpuidle: using governor menu
> [   95.505170] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
> [   95.506521] ASID allocator initialised with 32768 entries
> [   95.541565] Serial: AMBA PL011 UART driver
> [   96.469419] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 47, base_baud = 0) is a PL011 rev1
> [   96.472001] printk: console [ttyAMA0] enabled
> [   96.472001] printk: console [ttyAMA0] enabled
> [   96.472789] printk: bootconsole [pl11] disabled
> [   96.472789] printk: bootconsole [pl11] disabled
> [   96.934788] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
> [   96.935322] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
> [   96.936042] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
> [   96.936454] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
> [   97.007523] cryptd: max_cpu_qlen set to 1000
> [   97.143352] ACPI: Interpreter disabled.
> [   97.207646] iommu: Default domain type: Translated 
> [   97.216776] vgaarb: loaded
> [   97.228660] SCSI subsystem initialized
> [   97.234310] libata version 3.00 loaded.
> [   97.243658] usbcore: registered new interface driver usbfs
> [   97.245446] usbcore: registered new interface driver hub
> [   97.247375] usbcore: registered new device driver usb
> [   97.271932] pps_core: LinuxPPS API ver. 1 registered
> [   97.272326] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
> [   97.273108] PTP clock support registered
> [   97.278967] EDAC MC: Ver: 3.0.0
> [   97.330734] FPGA manager framework
> [   97.334916] Advanced Linux Sound Architecture Driver Initialized.
> [   97.367534] clocksource: Switched to clocksource arch_sys_counter
> [  114.521600] VFS: Disk quotas dquot_6.6.0
> [  114.523765] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
> [  114.533650] pnp: PnP ACPI: disabled
> [  114.765263] NET: Registered protocol family 2
> [  114.788981] tcp_listen_portaddr_hash hash table entries: 1024 (order: 4, 81920 bytes, linear)
> [  114.790064] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
> [  114.798325] TCP bind hash table entries: 16384 (order: 8, 1179648 bytes, linear)
> [  114.806169] TCP: Hash tables configured (established 16384 bind 16384)
> [  114.810413] UDP hash table entries: 1024 (order: 5, 163840 bytes, linear)
> [  114.814124] UDP-Lite hash table entries: 1024 (order: 5, 163840 bytes, linear)
> [  114.819502] NET: Registered protocol family 1
> [  114.837488] RPC: Registered named UNIX socket transport module.
> [  114.838082] RPC: Registered udp transport module.
> [  114.838453] RPC: Registered tcp transport module.
> [  114.838809] RPC: Registered tcp NFSv4.1 backchannel transport module.
> [  114.839760] PCI: CLS 0 bytes, default 64
> [  114.870930] hw perfevents: enabled with armv8_pmuv3 PMU driver, 5 counters available
> [  114.873385] kvm [1]: HYP mode not available
> [  115.096835] Initialise system trusted keyrings
> [  115.102788] workingset: timestamp_bits=44 max_order=19 bucket_order=0
> [  115.399347] squashfs: version 4.0 (2009/01/31) Phillip Lougher
> [  115.420555] NFS: Registering the id_resolver key type
> [  115.422030] Key type id_resolver registered
> [  115.422598] Key type id_legacy registered
> [  115.426472] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
> [  115.434896] 9p: Installing v9fs 9p2000 file system support
> [  115.521422] Key type asymmetric registered
> [  115.522091] Asymmetric key parser 'x509' registered
> [  115.523839] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
> [  115.524497] io scheduler mq-deadline registered
> [  115.524989] io scheduler kyber registered
> [  115.894160] pl061_gpio 9030000.pl061: PL061 GPIO chip registered
> [  115.952465] pci-host-generic 4010000000.pcie: host bridge /pcie@10000000 ranges:
> [  115.954473] pci-host-generic 4010000000.pcie:       IO 0x003eff0000..0x003effffff -> 0x0000000000
> [  115.956630] pci-host-generic 4010000000.pcie:      MEM 0x0010000000..0x003efeffff -> 0x0010000000
> [  115.957484] pci-host-generic 4010000000.pcie:      MEM 0x8000000000..0xffffffffff -> 0x8000000000
> [  115.960592] pci-host-generic 4010000000.pcie: ECAM at [mem 0x4010000000-0x401fffffff] for [bus 00-ff]
> [  115.965840] pci-host-generic 4010000000.pcie: PCI host bridge to bus 0000:00
> [  115.966564] pci_bus 0000:00: root bus resource [bus 00-ff]
> [  115.967435] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
> [  115.967879] pci_bus 0000:00: root bus resource [mem 0x10000000-0x3efeffff]
> [  115.968308] pci_bus 0000:00: root bus resource [mem 0x8000000000-0xffffffffff]
> [  115.970981] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
> [  115.982358] pci 0000:00:01.0: [1af4:1009] type 00 class 0x000200
> [  115.983896] pci 0000:00:01.0: reg 0x10: [io  0x0000-0x003f]
> [  115.984527] pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x00000fff]
> [  115.985710] pci 0000:00:01.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
> [  115.993649] pci 0000:00:02.0: [1af4:1009] type 00 class 0x000200
> [  115.994489] pci 0000:00:02.0: reg 0x10: [io  0x0000-0x003f]
> [  115.995425] pci 0000:00:02.0: reg 0x14: [mem 0x00000000-0x00000fff]
> [  115.996526] pci 0000:00:02.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
> [  116.004182] pci 0000:00:03.0: [1af4:1000] type 00 class 0x020000
> [  116.005039] pci 0000:00:03.0: reg 0x10: [io  0x0000-0x001f]
> [  116.005630] pci 0000:00:03.0: reg 0x14: [mem 0x00000000-0x00000fff]
> [  116.006717] pci 0000:00:03.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
> [  116.007694] pci 0000:00:03.0: reg 0x30: [mem 0x00000000-0x0003ffff pref]
> [  116.014983] pci 0000:00:04.0: [1af4:1004] type 00 class 0x010000
> [  116.016150] pci 0000:00:04.0: reg 0x10: [io  0x0000-0x003f]
> [  116.016744] pci 0000:00:04.0: reg 0x14: [mem 0x00000000-0x00000fff]
> [  116.017823] pci 0000:00:04.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
> [  116.031717] pci 0000:00:03.0: BAR 6: assigned [mem 0x10000000-0x1003ffff pref]
> [  116.032501] pci 0000:00:01.0: BAR 4: assigned [mem 0x8000000000-0x8000003fff 64bit pref]
> [  116.033388] pci 0000:00:02.0: BAR 4: assigned [mem 0x8000004000-0x8000007fff 64bit pref]
> [  116.034240] pci 0000:00:03.0: BAR 4: assigned [mem 0x8000008000-0x800000bfff 64bit pref]
> [  116.035359] pci 0000:00:04.0: BAR 4: assigned [mem 0x800000c000-0x800000ffff 64bit pref]
> [  116.036108] pci 0000:00:01.0: BAR 1: assigned [mem 0x10040000-0x10040fff]
> [  116.036664] pci 0000:00:02.0: BAR 1: assigned [mem 0x10041000-0x10041fff]
> [  116.037196] pci 0000:00:03.0: BAR 1: assigned [mem 0x10042000-0x10042fff]
> [  116.037723] pci 0000:00:04.0: BAR 1: assigned [mem 0x10043000-0x10043fff]
> [  116.038274] pci 0000:00:01.0: BAR 0: assigned [io  0x1000-0x103f]
> [  116.038817] pci 0000:00:02.0: BAR 0: assigned [io  0x1040-0x107f]
> [  116.039686] pci 0000:00:04.0: BAR 0: assigned [io  0x1080-0x10bf]
> [  116.040213] pci 0000:00:03.0: BAR 0: assigned [io  0x10c0-0x10df]
> [  116.110878] EINJ: ACPI disabled.
> [  116.586823] virtio-pci 0000:00:01.0: enabling device (0000 -> 0003)
> [  116.601358] virtio-pci 0000:00:02.0: enabling device (0000 -> 0003)
> [  116.613837] virtio-pci 0000:00:03.0: enabling device (0000 -> 0003)
> [  116.624404] virtio-pci 0000:00:04.0: enabling device (0000 -> 0003)
> [  116.807519] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> [  116.898052] SuperH (H)SCI(F) driver initialized
> [  116.916586] msm_serial: driver initialized
> [  116.966160] cacheinfo: Unable to detect cache hierarchy for CPU 0
> [  117.230609] loop: module loaded
> [  117.261553] megasas: 07.714.04.00-rc1
> [  117.299460] scsi host0: Virtio SCSI HBA
> [  117.332400] scsi 0:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5
> [  119.896235] random: fast init done
> [  119.962094] sd 0:0:0:0: Power-on or device reset occurred
> [  119.988603] sd 0:0:0:0: [sda] 524288 512-byte logical blocks: (268 MB/256 MiB)
> [  119.990909] sd 0:0:0:0: [sda] Write Protect is off
> [  119.991894] sd 0:0:0:0: [sda] Mode Sense: 63 00 00 08
> [  120.000849] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
> [  120.005403] sda: detected capacity change from 0 to 268435456
> [  120.104701] physmap-flash 0.flash: physmap platform flash device: [mem 0x00000000-0x03ffffff]
> [  120.107055] 0.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
> [  120.113218] Intel/Sharp Extended Query Table at 0x0031
> [  120.114867] Using buffer write method
> [  120.125192] erase region 0: offset=0x0,size=0x40000,blocks=256
> [  120.126226] physmap-flash 0.flash: physmap platform flash device: [mem 0x04000000-0x07ffffff]
> [  120.127789] 0.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
> [  120.128353] Intel/Sharp Extended Query Table at 0x0031
> [  120.129355] Using buffer write method
> [  120.129810] erase region 0: offset=0x0,size=0x40000,blocks=256
> [  120.130313] Concatenating MTD devices:
> [  120.130686] (0): "0.flash"
> [  120.135876] (1): "0.flash"
> [  120.136225] into device "0.flash"
> [  120.192278] sda: detected capacity change from 0 to 268435456
> [  120.193045] sd 0:0:0:0: [sda] Attached SCSI disk
> [  120.387475] libphy: Fixed MDIO Bus: probed
> [  120.432985] tun: Universal TUN/TAP device driver, 1.6
> [  120.489130] thunder_xcv, ver 1.0
> [  120.490797] thunder_bgx, ver 1.0
> [  120.492770] nicpf, ver 1.0
> [  120.537316] hclge is initializing
> [  120.538538] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
> [  120.538958] hns3: Copyright (c) 2017 Huawei Corporation.
> [  120.541156] e1000: Intel(R) PRO/1000 Network Driver
> [  120.541528] e1000: Copyright (c) 1999-2006 Intel Corporation.
> [  120.543589] e1000e: Intel(R) PRO/1000 Network Driver
> [  120.543956] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
> [  120.545789] igb: Intel(R) Gigabit Ethernet Network Driver
> [  120.546176] igb: Copyright (c) 2007-2014 Intel Corporation.
> [  120.547883] igbvf: Intel(R) Gigabit Virtual Function Network Driver
> [  120.548276] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
> [  120.562052] sky2: driver version 1.30
> [  120.597519] VFIO - User Level meta-driver version: 0.3
> [  120.658110] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [  120.658597] ehci-pci: EHCI PCI platform driver
> [  120.660406] ehci-platform: EHCI generic platform driver
> [  120.664987] ehci-orion: EHCI orion driver
> [  120.669400] ehci-exynos: EHCI Exynos driver
> [  120.673747] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> [  120.674701] ohci-pci: OHCI PCI platform driver
> [  120.676572] ohci-platform: OHCI generic platform driver
> [  120.681095] ohci-exynos: OHCI Exynos driver
> [  120.697532] usbcore: registered new interface driver usb-storage
> [  120.806431] rtc-pl031 9010000.pl031: registered as rtc0
> [  120.808336] rtc-pl031 9010000.pl031: setting system clock to 2020-11-30T11:37:20 UTC (1606736240)
> [  120.831534] i2c /dev entries driver
> [  121.067859] sdhci: Secure Digital Host Controller Interface driver
> [  121.068255] sdhci: Copyright(c) Pierre Ossman
> [  121.084261] Synopsys Designware Multimedia Card Interface Driver
> [  121.122438] sdhci-pltfm: SDHCI platform and OF driver helper
> [  121.176067] ledtrig-cpu: registered to indicate activity on CPUs
> [  121.237585] usbcore: registered new interface driver usbhid
> [  121.237987] usbhid: USB HID core driver
> [  121.414229] drop_monitor: Initializing network drop monitor service
> [  121.418007] NET: Registered protocol family 17
> [  121.424102] 9pnet: Installing 9P2000 support
> [  121.443895] Key type dns_resolver registered
> [  121.451895] registered taskstats version 1
> [  121.453581] Running tests on all trace events:
> [  121.453937] Testing all events: OK
> [  180.314804] Running tests again, along with the function tracer
> [  180.334448] Running tests on all trace events:
> [  180.346904] Testing all events: 
> [  186.731798] hrtimer: interrupt took 10487664 ns
> [  219.711287] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 13s!
> [  219.875132] Showing busy workqueues and worker pools:
> [  219.910747] workqueue events: flags=0x0
> [  219.939591]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  219.951310]     pending: vmstat_shepherd
> [  219.963073] workqueue events_power_efficient: flags=0x82
> [  219.999935]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
> [  220.009975]     in-flight: 7:do_cache_clean
> [  220.030092] pool 2: cpus=0 flags=0x4 nice=0 hung=0s workers=3 idle: 61 99
> [  230.303201] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 24s!
> [  230.410755] Showing busy workqueues and worker pools:
> [  230.427157] workqueue events: flags=0x0
> [  230.443262]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  230.454087]     pending: vmstat_shepherd
> [  351.797552] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 11s!
> [  351.843185] Showing busy workqueues and worker pools:
> [  351.875356] workqueue events: flags=0x0
> [  351.906690]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  351.917412]     pending: vmstat_shepherd
> [  351.938890] workqueue events_power_efficient: flags=0x82
> [  351.970790]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
> [  351.979994]     pending: neigh_periodic_work
> [  389.525557] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 17s!
> [  389.600725] Showing busy workqueues and worker pools:
> [  389.617453] workqueue events: flags=0x0
> [  389.623272]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  389.634046]     pending: vmstat_shepherd
> [  389.650704] workqueue events_power_efficient: flags=0x82
> [  389.671328]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
> [  389.680463]     in-flight: 7:neigh_periodic_work
> [  389.704734] pool 2: cpus=0 flags=0x4 nice=0 hung=9s workers=3 idle: 61 99
> [  453.731592] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
> [  453.790537] Showing busy workqueues and worker pools:
> [  453.796398] workqueue events: flags=0x0
> [  453.823200]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  453.833529]     pending: vmstat_shepherd
> [  453.852558] workqueue events_power_efficient: flags=0x82
> [  453.858588]   pwq 2: cpus=0 flags=0x5 nice=0 active=2/256 refcnt=4
> [  453.867424]     in-flight: 7:do_cache_clean
> [  453.874323]     pending: neigh_periodic_work
> [  453.894345] pool 2: cpus=0 flags=0x5 nice=0 hung=8s workers=2 manager: 61
> [  598.019250] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 16s!
> [  598.131254] Showing busy workqueues and worker pools:
> [  598.200541] workqueue events: flags=0x0
> [  598.217960]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  598.228669]     pending: vmstat_shepherd
> [  598.246863] workqueue events_power_efficient: flags=0x82
> [  598.279406]   pwq 2: cpus=0 flags=0x4 nice=0 active=1/256 refcnt=3
> [  598.288499]     in-flight: 106:do_cache_clean
> [  598.319372] pool 2: cpus=0 flags=0x4 nice=0 hung=8s workers=3 idle: 61 7
> [  795.287162] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 10s!
> [  795.311095] BUG: workqueue lockup - pool cpus=0 flags=0x4 nice=0 stuck for 10s!
> [  795.334433] Showing busy workqueues and worker pools:
> [  795.343043] workqueue events: flags=0x0
> [  795.354006]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  795.361092]     pending: vmstat_shepherd
> [  795.370452] workqueue events_power_efficient: flags=0x82
> [  795.379095]   pwq 2: cpus=0 flags=0x4 nice=0 active=3/256 refcnt=5
> [  795.385173]     in-flight: 106:check_lifetime
> [  795.389953]     pending: neigh_periodic_work, do_cache_clean
> [  795.401803] pool 2: cpus=0 flags=0x4 nice=0 hung=10s workers=3 idle: 61 7
> [  840.280588] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 15s!
> [  840.370856] Showing busy workqueues and worker pools:
> [  840.400495] workqueue events: flags=0x0
> [  840.417468]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  840.427827]     pending: vmstat_shepherd
> [  840.473295] pool 2: cpus=0 flags=0x5 nice=0 hung=6s workers=3 manager: 7 idle: 106 61
> [  889.716728] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 12s!
> [  889.787233] BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 12s!
> [  889.936565] Showing busy workqueues and worker pools:
> [  889.953557] workqueue events: flags=0x0
> [  889.959094]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  889.969435]     pending: vmstat_shepherd
> [  889.990858] workqueue events_power_efficient: flags=0x82
> [  890.022774]   pwq 2: cpus=0 flags=0x5 nice=0 active=1/256 refcnt=3
> [  890.031587]     pending: neigh_periodic_work
> [  890.059229] pool 2: cpus=0 flags=0x5 nice=0 hung=12s workers=3 manager: 7 idle: 106 61
> [  903.560770] BUG: workqueue lockup - pool cpus=0 flags=0x5 nice=0 stuck for 25s!
> [  903.610830] Showing busy workqueues and worker pools:
> [  903.616897] workqueue events: flags=0x0
> [  903.633819]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2
> [  903.644574]     in-flight: 15:vmstat_shepherd
> [  903.662870] workqueue events_power_efficient: flags=0x82
> [  903.726795]   pwq 2: cpus=0 flags=0x5 nice=0 active=3/256 refcnt=5
> [  903.736114]     pending: neigh_periodic_work, do_cache_clean, check_lifetime
> [  903.758987] pool 0: cpus=0 node=0 flags=0x0 nice=0 hung=2s workers=2 idle: 5
> [  903.785300] pool 2: cpus=0 flags=0x5 nice=0 hung=26s workers=4 manager: 7 idle: 107 106 61
> [ 1211.521119] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> [ 1211.527302] 	(detected by 0, t=3752 jiffies, g=2329, q=2)
> [ 1211.529303] rcu: All QSes seen, last rcu_preempt kthread activity 3503 (4295192252-4295188749), jiffies_till_next_fqs=1, root ->qsmask 0x0
> [ 1211.540472] rcu: rcu_preempt kthread starved for 3503 jiffies! g2329 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0
> [ 1211.546502] rcu: 	Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
> [ 1211.552234] rcu: RCU grace-period kthread stack dump:
> [ 1211.556893] task:rcu_preempt     state:R  running task     stack:    0 pid:   10 ppid:     2 flags:0x00000428
> [ 1211.566196] Call trace:
> [ 1211.570036]  __switch_to+0x148/0x1f0
> [ 1211.574189]  __schedule+0x2dc/0x9a0
> [ 1211.578355]  preempt_schedule_notrace+0x70/0x1c0
> [ 1211.582822]  ftrace_ops_list_func+0x10c/0x218
> [ 1211.587212]  ftrace_graph_call+0x0/0x4
> [ 1211.591434]  preempt_count_add+0x8/0x1a0
> [ 1211.595716]  schedule+0x44/0x100
> [ 1211.599779]  schedule_timeout+0x240/0x538
> [ 1211.604098]  rcu_gp_kthread+0x618/0x1bd8
> [ 1211.608398]  kthread+0x13c/0x188
> [ 1211.612480]  ret_from_fork+0x10/0x34
> [ 1211.616726] rcu: Stack dump where RCU GP kthread last ran:
> [ 1211.621458] Task dump for CPU 0:
> [ 1211.625472] task:event_benchmark state:R  running task     stack:    0 pid:  105 ppid:     2 flags:0x0000042a
> [ 1211.634526] Call trace:
> [ 1211.638364]  dump_backtrace+0x0/0x240
> [ 1211.642586]  show_stack+0x34/0x88
> [ 1211.646715]  sched_show_task+0x208/0x230
> [ 1211.650995]  dump_cpu_task+0x4c/0x5c
> [ 1211.655215]  rcu_check_gp_kthread_starvation+0x240/0x388
> [ 1211.659949]  rcu_sched_clock_irq+0xc2c/0xd40
> [ 1211.664331]  update_process_times+0x6c/0xb8
> [ 1211.668703]  tick_sched_handle.isra.0+0x58/0x88
> [ 1211.673168]  tick_sched_timer+0x68/0xe0
> [ 1211.677459]  __hrtimer_run_queues+0x288/0x730
> [ 1211.681873]  hrtimer_interrupt+0x114/0x288
> [ 1211.686235]  arch_timer_handler_virt+0x50/0x70
> [ 1211.690664]  handle_percpu_devid_irq+0x104/0x4c0
> [ 1211.695127]  generic_handle_irq+0x54/0x78
> [ 1211.699396]  __handle_domain_irq+0xac/0x130
> [ 1211.703736]  gic_handle_irq+0x70/0x108
> [ 1211.707949]  el1_irq+0xc4/0x180
> [ 1211.711937]  _raw_spin_unlock_irq+0x50/0x98
> [ 1211.716304]  finish_task_switch+0xb4/0x398
> [ 1211.720649]  __schedule+0x2e0/0x9a0
> [ 1211.724815]  preempt_schedule_irq+0x4c/0xa0
> [ 1211.729191]  arm64_preempt_schedule_irq+0xd0/0x118
> [ 1211.733737]  el1_irq+0xdc/0x180
> [ 1211.737771]  benchmark_event_kthread+0x144/0x4b0
> [ 1211.742255]  kthread+0x13c/0x188
> [ 1211.746320]  ret_from_fork+0x10/0x34
> [ 1211.755343] 
> [ 1211.757649] ================================
> [ 1211.760669] WARNING: inconsistent lock state
> [ 1211.763880] 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1 Not tainted
> [ 1211.767588] --------------------------------
> [ 1211.770630] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
> [ 1211.774224] event_benchmark/105 [HC0[0]:SC0[0]:HE0:SE1] takes:
> [ 1211.777779] ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40
> [ 1211.785746] {IN-HARDIRQ-W} state was registered at:
> [ 1211.789124]   __lock_acquire+0xae8/0x1b00
> [ 1211.792183]   lock_acquire+0x268/0x508
> [ 1211.795161]   _raw_spin_lock_irqsave+0x78/0x14c
> [ 1211.798335]   rcu_sched_clock_irq+0x428/0xd40
> [ 1211.801476]   update_process_times+0x6c/0xb8
> [ 1211.804567]   tick_sched_handle.isra.0+0x58/0x88
> [ 1211.807746]   tick_sched_timer+0x68/0xe0
> [ 1211.810778]   __hrtimer_run_queues+0x288/0x730
> [ 1211.813963]   hrtimer_interrupt+0x114/0x288
> [ 1211.817035]   arch_timer_handler_virt+0x50/0x70
> [ 1211.820187]   handle_percpu_devid_irq+0x104/0x4c0
> [ 1211.823434]   generic_handle_irq+0x54/0x78
> [ 1211.826498]   __handle_domain_irq+0xac/0x130
> [ 1211.829584]   gic_handle_irq+0x70/0x108
> [ 1211.832555]   el1_irq+0xc4/0x180
> [ 1211.835370]   _raw_spin_unlock_irq+0x50/0x98
> [ 1211.838473]   finish_task_switch+0xb4/0x398
> [ 1211.841540]   __schedule+0x2e0/0x9a0
> [ 1211.844477]   preempt_schedule_irq+0x4c/0xa0
> [ 1211.847590]   arm64_preempt_schedule_irq+0xd0/0x118
> [ 1211.850859]   el1_irq+0xdc/0x180
> [ 1211.853636]   benchmark_event_kthread+0x144/0x4b0
> [ 1211.856906]   kthread+0x13c/0x188
> [ 1211.859729]   ret_from_fork+0x10/0x34
> [ 1211.862686] irq event stamp: 67642
> [ 1211.865588] hardirqs last  enabled at (67641): [<ffffa17ef303ec78>] _raw_spin_unlock_irq+0x48/0x98
> [ 1211.870078] hardirqs last disabled at (67642): [<ffffa17ef30310a8>] enter_el1_irq_or_nmi+0x20/0x30
> [ 1211.874532] softirqs last  enabled at (63366): [<ffffa17ef1c10b80>] __do_softirq+0x630/0x6b4
> [ 1211.878770] softirqs last disabled at (63347): [<ffffa17ef1cc5c74>] irq_exit+0x1cc/0x1e0
> [ 1211.882828] 
> [ 1211.882828] other info that might help us debug this:
> [ 1211.886512]  Possible unsafe locking scenario:
> [ 1211.886512] 
> [ 1211.889961]        CPU0
> [ 1211.892451]        ----
> [ 1211.894935]   lock(rcu_node_0);
> [ 1211.899732]   <Interrupt>
> [ 1211.902272]     lock(rcu_node_0);
> [ 1211.906707] 
> [ 1211.906707]  *** DEADLOCK ***
> [ 1211.906707] 
> [ 1211.910237] 1 lock held by event_benchmark/105:
> [ 1211.913352]  #0: ffffa17ef42247d8 (rcu_node_0){?.-.}-{2:2}, at: rcu_sched_clock_irq+0x428/0xd40
> [ 1211.922068] 
> [ 1211.922068] stack backtrace:
> [ 1211.925381] CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
> [ 1211.930018] Hardware name: linux,dummy-virt (DT)
> [ 1211.933192] Call trace:
> [ 1211.935795]  dump_backtrace+0x0/0x240
> [ 1211.938733]  show_stack+0x34/0x88
> [ 1211.941539]  dump_stack+0x140/0x1bc
> [ 1211.944421]  print_usage_bug+0x2a0/0x2f0
> [ 1211.947405]  mark_lock.part.0+0x438/0x4e8
> [ 1211.950420]  mark_held_locks+0x54/0x90
> [ 1211.953393]  lockdep_hardirqs_on_prepare+0xe0/0x290
> [ 1211.956665]  trace_hardirqs_on+0x90/0x370
> [ 1211.959701]  exit_to_kernel_mode.isra.0+0xf8/0x208
> [ 1211.962948]  exit_el1_irq_or_nmi+0x24/0x38
> [ 1211.965971]  el1_irq+0xe4/0x180
> [ 1211.968779]  _raw_spin_unlock_irq+0x50/0x98
> [ 1211.971832]  finish_task_switch+0xb4/0x398
> [ 1211.974885]  __schedule+0x2e0/0x9a0
> [ 1211.977744]  preempt_schedule_irq+0x4c/0xa0
> [ 1211.980856]  arm64_preempt_schedule_irq+0xd0/0x118
> [ 1211.984101]  el1_irq+0xdc/0x180
> [ 1211.986889]  benchmark_event_kthread+0x144/0x4b0
> [ 1211.990118]  kthread+0x13c/0x188
> [ 1211.992910]  ret_from_fork+0x10/0x34
> [ 1211.998610] BUG: scheduling while atomic: event_benchmark/105/0x00000002
> [ 1212.010060] INFO: lockdep is turned off.
> [ 1212.018261] Modules linked in:
> [ 1212.030227] Preemption disabled at:
> [ 1212.034171] [<ffffa17ef3037114>] preempt_schedule_irq+0x3c/0xa0
> [ 1212.049696] CPU: 0 PID: 105 Comm: event_benchmark Not tainted 5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1
> [ 1212.054368] Hardware name: linux,dummy-virt (DT)
> [ 1212.057507] Call trace:
> [ 1212.060101]  dump_backtrace+0x0/0x240
> [ 1212.063052]  show_stack+0x34/0x88
> [ 1212.065890]  dump_stack+0x140/0x1bc
> [ 1212.068791]  __schedule_bug+0xcc/0xe0
> [ 1212.071729]  __schedule+0x868/0x9a0
> [ 1212.074625]  preempt_schedule_irq+0x4c/0xa0
> [ 1212.077714]  arm64_preempt_schedule_irq+0xd0/0x118
> [ 1212.080945]  el1_irq+0xdc/0x180
> [ 1212.083732]  benchmark_event_kthread+0x144/0x4b0
> [ 1212.086931]  kthread+0x13c/0x188
> [ 1212.089704]  ret_from_fork+0x10/0x34


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes
       [not found]     ` <20201130133245.GA1307615@elver.google.com>
@ 2020-11-30 16:54       ` Mark Rutland
  0 siblings, 0 replies; 21+ messages in thread
From: Mark Rutland @ 2020-11-30 16:54 UTC (permalink / raw)
  To: Marco Elver
  Cc: paulmck, peterz, catalin.marinas, james.morse, linux-arm-kernel,
	will, dvyukov

On Mon, Nov 30, 2020 at 02:32:45PM +0100, Marco Elver wrote:
> On Mon, Nov 30, 2020 at 12:38PM +0000, Mark Rutland wrote:
> > On Mon, Nov 30, 2020 at 01:03:05PM +0100, Marco Elver wrote:

> > > So, I was hoping that this would fix all the problems I was seeing when
> > > running the ftrace tests ... unfortunately, it didn't. :-( Perhaps the
> > > WIP version you had only worked because it ended up disabling lockdep
> > > early?
> > 
> > Possibly, yes. Either that or the way we do / do-not treat debug
> > exceptions as true NMIs. Either way this appears to be a latent issue
> > rather than something introduced by this series.
> > 
> > From the log below I see you're using:
> > 
> >   5.10.0-rc4-next-20201119-00002-gc88aca8827ce #1 Not tainted
> > 
> > ... and it's possible that the issue you're seeing now is a delta
> > between v5.10-rc3 and what's queued in linux-next -- I've been running
> > the ftrace tests locally without issue atop v5.10-rc3 and v5.10-rc5.
> > 
> > Are you able to reproduce this on my branch alone? If so that gives us a
> > stable tree to investigate, and if not that gives us a stable base for a
> > bisect against linux-next.
> 
> It's the same problem as before and that I've been reporting in the
> other thread [1]. We know mainline is fine, however, -next is broken. We
> also know that next-20201105 was still fine, and next-202010 started
> breaking:
> 
> 	https://lkml.kernel.org/r/20201111133813.GA81547@elver.google.com
> 
> The recent tests have been on next-20201119 (including the logs from
> previous email).
>
> I tried bisection, but results are never conclusive (the closest I got
> was a -rcu merge commit). As discussed in the thread at [1] (and its
> ancestors) we never really got anywhere and really exhausted all options
> (several bisection attempts, etc.).

Ah; I'd lost track and missed that you'd already identified this was
introduced in linux-next, and that bisection wasn't getting anywhere.
Thanks for bearing with me! :)

> > This area is really sensitive to config options, so if you can reproduce
> > this on a stable base, could you share youir exact config?
> 
> No, it's not reproducible on mainline.
> 
> Which might also mean that it's something else in -next and your work is
> unrelated.
> 
> But I was surprised your WIP series fixed the problems on next-20201119
> (or so it seemed). So, given all the confusion in [1], I was really
> hoping this would be it...

The major difference between that and the version upstreamed is the way
debug exceptions (including BRKs) got handled as true NMIs, which hints
that there could be a subtle interaction in that area (or that the
lockdep disable calls in the NMI paths simply masked the problem).

One simple thing to try would be to hack the debug exception cases to
enter/exit as true NMIs and see whether that hides the issue again. If
so, we can start teasing that apart to narrow it down.

> > > I've attached the log and the symbolized report.
> > 
> > Thanks for all this. I'll see if I can tickle this locally while waiting
> > for the above. If you could share your config from this time around
> > that'd be a great head-start!
> 
> It's the same as I've been using for the work in
> 
> 	[1] https://lore.kernel.org/r/20201119193819.GA2601289@elver.google.com
> 
> In summary, to repro:
> 
> 	1. Switch to next-20201119 (possibly even latest, but I haven't tested)
> 
> 	2. Apply provoke-bug.diff
> 
> 	3. Use the attached .config
> 
> 	4. Run with 
> 
> 	   qemu-system-aarch64 -kernel $KERNEL_WORKTREE/arch/arm64/boot/Image \
> 		-append "console=ttyAMA0 root=/dev/sda debug earlycon earlyprintk=serial workqueue.watchdog_thresh=10" \
> 		-nographic -smp 1 -machine virt -cpu cortex-a57 -m 2G

Thanks for the comprehensive repro information!

I note that you're using QEMU in TCG mode, whereas I've been testing
with KVM acceleration. Those differ in speed by ordered of magnitude, so
I wonder if the stalls you see are down to TCG simply being slow, and my
patches just happened to shuffle where that slowness was felt.

I gave the above a go, but I wasn't able to reproduce the issue under
either TCG or KVM acceleration after a few attempts. I'm not sure
whether this is intermittent and I'm just getting lucky, or if something
is different between our setups that's causing me to not hit this.

FWIW I'm testing on a ThunderX2 workstation running Debian 10.6, using
the packaged GCC 8.3.0-6, and a locally-built QEMU 5.1.50
(v5.1.0-2347-g1f3081f6de). The QEMU has a couple of test patches atop
upstream commit ba2a9a9e6318bfd93a2306dec40137e198205b86.

> The tests I ran on your WIP series and just now were applied on top of
> next-20201119+provoke-bug.diff. Your WIP series seemed to fix whatever
> it was we were debugging in [1] (but with some new warnings), but this
> latest series shows no difference and behaviour is unchanged again.
> 
> I also want to emphasize it is really hard to say if your series here is
> related or the fact that the WIP series worked was some other
> side-effect we don't understand.

Sure; I think we're aligned on that understanding. There are a
sufficient number of moving parts here that the WIP might have been
masking a problem, or might have unintentionally solved a problem we
haven't realised exists.

> So I leave it to your judgement to decide to what extent this series
> could possibly help, because I wouldn't want to make you go down a
> rabbit hole that doesn't lead anywhere (as I had already done to
> somehow debug the problem in [1]).

I think as you say it's not at all clear, but I'd hope this series at
least removes a number of potential problems from the search space.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-11-30 16:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 12:35 [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Mark Rutland
2020-11-26 12:35 ` [PATCH 01/11] arm64: syscall: exit userspace before unmasking exceptions Mark Rutland
2020-11-26 12:35 ` [PATCH 02/11] arm64: mark idle code as noinstr Mark Rutland
2020-11-26 12:35 ` [PATCH 03/11] arm64: entry: mark entry " Mark Rutland
2020-11-26 12:35 ` [PATCH 04/11] arm64: entry: move enter_from_user_mode to entry-common.c Mark Rutland
2020-11-26 12:35 ` [PATCH 05/11] arm64: entry: prepare ret_to_user for function call Mark Rutland
2020-11-26 12:35 ` [PATCH 06/11] arm64: entry: move el1 irq/nmi logic to C Mark Rutland
2020-11-26 12:35 ` [PATCH 07/11] arm64: entry: fix non-NMI user<->kernel transitions Mark Rutland
2020-11-30 11:22   ` Will Deacon
2020-11-26 12:35 ` [PATCH 08/11] arm64: ptrace: prepare for EL1 irq/rcu tracking Mark Rutland
2020-11-30 11:01   ` Will Deacon
2020-11-26 12:36 ` [PATCH 09/11] arm64: entry: fix non-NMI kernel<->kernel transitions Mark Rutland
2020-11-30 11:22   ` Will Deacon
2020-11-26 12:36 ` [PATCH 10/11] arm64: entry: fix NMI {user, kernel}->kernel transitions Mark Rutland
2020-11-26 18:41   ` [PATCH 10/11] arm64: entry: fix NMI {user,kernel}->kernel transitions Mark Rutland
2020-11-26 21:00     ` Will Deacon
2020-11-26 12:36 ` [PATCH 11/11] arm64: entry: fix EL1 debug transitions Mark Rutland
2020-11-30 11:23 ` [PATCH 00/11] arm64: entry lockdep/rcu/tracing fixes Will Deacon
2020-11-30 12:03 ` Marco Elver
2020-11-30 12:38   ` Mark Rutland
     [not found]     ` <20201130133245.GA1307615@elver.google.com>
2020-11-30 16:54       ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).