Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2276300imm; Thu, 7 Jun 2018 08:04:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL7JVHSgdEPkNh53sGwY/olFtGCgiiGqdUfDQ+ulNUOVpzmuVDpwLwTO51aoLSPZZR7FuI5 X-Received: by 2002:a65:60ce:: with SMTP id r14-v6mr1923377pgv.41.1528383892399; Thu, 07 Jun 2018 08:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528383892; cv=none; d=google.com; s=arc-20160816; b=dBZ4n+UqiYyWOP+TEgKKEZ8/YeXTR9C6lyrT+uRolp0IxXZeeSNYzBI3CBwS58fWEO 9Gdbb0KsyX36CQBCgEv6W7Jw0LfAF41WTOc/Z4v259x6IOiIsG023+gWvYELFqBmAHSF 16Wk1PXSU7n6Rstmsu61+3lR+ABJlU1GZcC2g/wAyCjo7kNG2jybfwc9nu68a3/CGmni jgiUoKTg9nwsbzUPVnx7E7hTMXElFs9oWnWebZiNV5FpTBh2vltQ+prY7XOPA7ca2sAs jGdOAt61bRddU9O5M/sA6FdDRVn/8xf4ncKjiyUuq/n3OsogrqWLS0GgorvOcy82jMkP tqyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=Lq+Q5PUWp08xDX5rgFWglDMXn0cg8jzi0YcywbQxXSg=; b=rNCTrrfKmo8AI2tS7fHCITc904eDK3PwPrr8QtaPciBzNcf54emfzrK+SyPZAYH057 Tnve9sFv9vboX3mUSbgSuvT81RvvGOG3qggY4ukT7j5I+DOF1lDVbpZ3BhJvAVNkjfvq 7EtDNby9rfQRJG4QM4hKFFQ9+tRf9P9dOcDXF+RvRN8njHe5rd5pS0avJ+lhvwD6ejnM CFKXa/ZNy7Q4/NhW2Tau1z+ZSmkTd/Sj6UqflZlAON433rk2JSy5imiQs+Cqaib2zZcP wRswegLMfFLrmCtOwPqbFrrbYXf5PHidk1YsX7T1fYp3o8JGfsUOHZE0M+cdR9kLtvUW Ct3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17-v6si28014444pgb.465.2018.06.07.08.04.36; Thu, 07 Jun 2018 08:04:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965009AbeFGPDE (ORCPT + 99 others); Thu, 7 Jun 2018 11:03:04 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41470 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964993AbeFGPC7 (ORCPT ); Thu, 7 Jun 2018 11:02:59 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbu-0005Zv-4a; Thu, 07 Jun 2018 15:09:54 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb0-0002nL-EI; Thu, 07 Jun 2018 15:08:58 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Nicholas Piggin" , "Michael Ellerman" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 078/410] powerpc/64: Don't trace irqs-off at interrupt return to soft-disabled context In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Piggin commit acb1feab320e38588fccc568e3767761f494976f upstream. When an interrupt is returning to a soft-disabled context (which can happen for non-maskable interrupts or synchronous interrupts), it goes through the motions of soft-disabling again, including calling TRACE_DISABLE_INTS (i.e., trace_hardirqs_off()). This is not necessary, because we must already be soft-disabled in the interrupt context, it also may be causing crashes in the irq tracing code to re-enter as an nmi. Replace it with a warning to ensure that soft-interrupts are still disabled. Fixes: 7c0482e3d055 ("powerpc/irq: Fix another case of lazy IRQ state getting out of sync") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- arch/powerpc/kernel/entry_64.S | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -885,9 +885,13 @@ restore_irq_off: beq 1f rlwinm r7,r7,0,~PACA_IRQ_HARD_DIS stb r7,PACAIRQHAPPENED(r13) -1: li r0,0 - stb r0,PACASOFTIRQEN(r13); - TRACE_DISABLE_INTS +1: +#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_BUG) + /* The interrupt should not have soft enabled. */ + lbz r7,PACASOFTIRQEN(r13) +1: tdnei r7,0 + EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,BUGFLAG_WARNING +#endif b do_restore /*