powerpc/powernv: Fix kexec crashes caused by tlbie tracing
commita3961f824cdbe7eb431254dc7d8f6f6767f474aa
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Wed, 22 Nov 2017 17:32:07 +0000 (22 23:02 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Nov 2017 12:10:14 +0000 (23 23:10 +1100)
treeb41f24ddf8cffa0b0a4f7fdd78d8f3bacc959ae5
parent12841f87b7a8ceb3d54f171660f72a86941bfcb3
powerpc/powernv: Fix kexec crashes caused by tlbie tracing

Rebooting into a new kernel with kexec fails in trace_tlbie() which is
called from native_hpte_clear(). This happens if the running kernel
has CONFIG_LOCKDEP enabled. With lockdep enabled, the tracepoints
always execute few RCU checks regardless of whether tracing is on or
off. We are already in the last phase of kexec sequence in real mode
with HILE_BE set. At this point the RCU check ends up in
RCU_LOCKDEP_WARN and causes kexec to fail.

Fix this by not calling trace_tlbie() from native_hpte_clear().

mpe: It's not safe to call trace points at this point in the kexec
path, even if we could avoid the RCU checks/warnings. The only
solution is to not call them.

Fixes: 0428491cba92 ("powerpc/mm: Trace tlbie(l) instructions")
Cc: stable@vger.kernel.org # v4.13+
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/hash_native_64.c