From patchwork Thu Nov 16 16:00:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 838646 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yd5j76Mxdz9s74 for ; Fri, 17 Nov 2017 03:06:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jodInKsD"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yd5j74w2zzDrJ8 for ; Fri, 17 Nov 2017 03:06:51 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jodInKsD"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::244; helo=mail-pf0-x244.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jodInKsD"; dkim-atps=neutral Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yd5Zb5MvlzDr42 for ; Fri, 17 Nov 2017 03:01:11 +1100 (AEDT) Received: by mail-pf0-x244.google.com with SMTP id i15so9592389pfa.3 for ; Thu, 16 Nov 2017 08:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V7LcJ4NtXKwweH/jjlOGywKLV8Ve9UZkHDnXM0GWZ3g=; b=jodInKsDjefm702A9Ijn/tJXg1DF8Cu02NG6lIy4IkNhrzsdm6xj6vLLEaMvCCN8Oh 4Nq49J03ssRGcVLbvVoUz4n6OQkm3wJ4MwrhrOI7rHAGwckY2GWto1fWN9mTjUXGW8Cf 3xhYt7f7vKQIDyFtu4EwXtLFiz9G1VNv3jg+NTeMHqyr1se+D06oS2rBjwWDxX670cAk PX+qLLeohZD+Acn5V9TklH9WGSOCWbdvPAGSlBoe4r/lEhIEpo2vIIKhZ17wyVY62/1T aRRpF98s8Tr2YEtGU45yzvKsisWPa8OpSPO3du608JmMat8XKwfgH7TEPVJWu2CS/5K6 TuLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V7LcJ4NtXKwweH/jjlOGywKLV8Ve9UZkHDnXM0GWZ3g=; b=LnJBKcQFNmCsmcOeKrwKnJT7idqk5Nx6l4PBKaly/fWDKUrBYKct06Nxrvlq6WGPpT Yvcc8Rrqf1SPNKemdBKTrzRE+IjWShzIYS/79Za18hG/FDWDpgEPUl1yxalBdzxzRgOV y4e4AuKj0o2m4R4OT24V8m0ntwRATnbjd13eGSCeYcWNHeRoT0o/woOrx1nrgOBht7HC F7TMADzxA9na2nprqN+x+lltXSpsJOuOOqize/DvubkIE7h4BGdwd9eVGKtJUIwczWrX T5bbg6gCix6ejBvmhf068JmFr/b+PTJOMZ+kfeYsFO1lJB4W6aSVUP/NYTJ3s9zTvSq5 zQKw== X-Gm-Message-State: AJaThX7CVif/KBy5p6Uz5HAlC7slNA21jEbNiZi+G3B9b9lsfH83e5/M jDgj+EDQvECEF3cy29XETrnpUw== X-Google-Smtp-Source: AGs4zMafD7gpAIVOIPTxiuRlzEALDl0SsEkNWqcST1drDlLPdH/Z53xPYUWVEArzxf4vQhUEmIzSig== X-Received: by 10.99.157.3 with SMTP id i3mr2067294pgd.165.1510848069064; Thu, 16 Nov 2017 08:01:09 -0800 (PST) Received: from roar.au.ibm.com (27-33-241-2.tpgi.com.au. [27.33.241.2]) by smtp.gmail.com with ESMTPSA id b10sm3081273pfj.20.2017.11.16.08.01.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2017 08:01:07 -0800 (PST) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/4] powerpc/64: do not trace irqs-off at interrupt return to soft-disabled context Date: Fri, 17 Nov 2017 02:00:50 +1000 Message-Id: <20171116160052.18672-3-npiggin@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171116160052.18672-1-npiggin@gmail.com> References: <20171116160052.18672-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_64.S | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 3320bcac7192..36878b6ee8b8 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -911,9 +911,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 /*