Received: by 10.213.65.68 with SMTP id h4csp498583imn; Fri, 16 Mar 2018 09:34:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELsXj+pz+KktDQytvquO8Qfisr/i2tvDKoOgN1TgxpDSY/ACKLU8o2AMMHsqbp++c7WySNx6 X-Received: by 2002:a17:902:8bc2:: with SMTP id r2-v6mr2801700plo.213.1521218068225; Fri, 16 Mar 2018 09:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218068; cv=none; d=google.com; s=arc-20160816; b=klTpjx+aqGZssENbn/lJqWrxsGp2KLgynfZdMG9nBiuwGSlQ9e70QU8MrN63I+RiMj eCmXLH/aQswv9SHzsrqNndoK9IxTEjYahvgE4s2Egm7AwyMJFlI1bJkbqxflhdFiRkj2 0v0qUVPU1NPfWju2cD2YPt1UB/OpI84MX5+qHhe6Bbag1ViW1Wi+LApHc8vJCRd3q+0J uE5CSamr2IZIV+OF9VRdbfxjeBdaGITS8BXKqFtOlGoHclq7R0sbHCAmbqVjjtRreNfM 7vsB46OX5rPgty8i4C1NqaTF6XCwU3LSGBqz24oF2jARLUaj996mM8jgQ8THGwEDjmLR 7CEQ== 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=KEgIYKDexd1wTh0pkBQzTSiBkhtHLTIO/B4/R0Ocpmw=; b=Gg+ncc8ZMHd151HL7QijiRI5TglRRNTYUc+lQlXqdlGHzMq6p+Nuken9plmGQmIxWX N8UUqgPWn1W0PGG5BKY9+haqdrsIA+h4ILgI9V3I3Fw2diX7zVLQCgMRKs6N6LY9LhAz HQPn5454jh6Y4Gc2U7Io7e0XA18JoHfJftvgjjaQ8MlBqD05eJFTrg7wxo40Bf1W0Mux w4tLDC10V4+xn7+rCk7i4tlyqj16ZZGo4EYATXDzCkPw3auNtlmPRVnMszuSi+IcMlwA AsZJOrK5oLSvUd2apUM+WC4phcZOO/pDO1MckBZpT1fpukDb/nUCF+rzVfPlEW7RmnKx 5REw== 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 e28si5201322pgn.464.2018.03.16.09.34.13; Fri, 16 Mar 2018 09:34:28 -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 S1754498AbeCPPiR (ORCPT + 99 others); Fri, 16 Mar 2018 11:38:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42164 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbeCPPiM (ORCPT ); Fri, 16 Mar 2018 11:38:12 -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 8D0A71241; Fri, 16 Mar 2018 15:38:11 +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.14 094/109] powerpc/64: Dont trace irqs-off at interrupt return to soft-disabled context Date: Fri, 16 Mar 2018 16:24:03 +0100 Message-Id: <20180316152335.018699164@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@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.14-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 /*