Received: by 10.213.65.68 with SMTP id h4csp475203imn; Fri, 16 Mar 2018 08:53:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELsyGC9ps0YPuuweQsABy2w3YwY0x3RqFLdI9QDqYxSXSWLzxCe4iAps+K5Fz71tCineXa/7 X-Received: by 10.99.120.196 with SMTP id t187mr1861690pgc.149.1521215621594; Fri, 16 Mar 2018 08:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521215621; cv=none; d=google.com; s=arc-20160816; b=g54fTp3PxN4NqaYmkGd0jqHWEMC6Uk6R2VcGrGMsTydCRRLQWSVTfimxoIMDQnOlyV 8DU0drjGQifvmnyg5STbWDpiXGSswaxwnUbocqClINcfN9zqZAY+FH20Wx3+2pSUwQz6 Oo7dTL9myRCiNvVTtK6PyuKHvHMK1EAEyG3iEfsk1idIuuAIhtgRwCIV69wixZ+uX00E +ckuJW4l0XW/iHalxSx6zL8FypmG53Jes0zY3XXgOEYkCQ6Z/IErW6M6kGshz8+SEROR WRjh2f79eZeA3GfyXCnQP4azTTqyb6HGkic/ZTZT7BIVkwei004r9BeaZLj/YW5ohVWN kpUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=q56fqQirj/EjTXBckbsDXNtO8wEZqL+uNYq5i0b2Amk=; b=cMmQTGm3y7bHoq94ZxkwgqJNxZ+2YFoQRqVMq7OgMtRSgx47cKVvlF+Np7tOo1bAT+ fohhVaAY0it5WQPjm/BkiUCetXwV1KRKYYyGw8O1Jys7i358Sq1cXnSAiNjreEloJJ7y acMa78EKy8tKAm+ywuQy1vg5ZEkd1JE8rU7JOCwltyOjdzJ82x9j8bdtbUYUoElEw2Tv s4qicX/28FJj5gtFSgruQWTqabNg9Xf+iXi05rSUlb22qkkdfIx9rxKnW41sujwMkie1 iiMmEVVloUOAM8+Hv5SxlyqUQ5nlXVyaP8U9xEgIsblRTQ4X4UFcygzUAvuZxrF+HJhW 9Svg== 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 70-v6si6492724ple.372.2018.03.16.08.53.27; Fri, 16 Mar 2018 08:53:41 -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 S934543AbeCPPo1 (ORCPT + 99 others); Fri, 16 Mar 2018 11:44:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45930 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964834AbeCPPoX (ORCPT ); Fri, 16 Mar 2018 11:44:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5EE79D8E; Fri, 16 Mar 2018 15:44:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Michael Ellerman , Sasha Levin Subject: [PATCH 4.15 113/128] powerpc/64: Dont trace irqs-off at interrupt return to soft-disabled context Date: Fri, 16 Mar 2018 16:24:14 +0100 Message-Id: <20180316152342.149010619@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Piggin [ Upstream commit acb1feab320e38588fccc568e3767761f494976f ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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 @@ -939,9 +939,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) 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 .Ldo_restore /*