From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 516FDC76188 for ; Fri, 19 Jul 2019 04:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2042121882 for ; Fri, 19 Jul 2019 04:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508802; bh=mWdzKEp5R3wS3vPnZOnkPe4kvnA6JaJWp1Wgrs2lz9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2o1asaj1hHjnLrPjYA2uNZ5/jP0e6HMJ0h7YN/VIT3xgjULpdbPeWWsdeppG4zK2r /qxyYxPzgx0a5pW2IaG6IjdgNpt/1NhWkau0c/XYEGozH5odg9HDugUFQwH4/V5gC4 L+4pp/nji8lRDnCdXBrrYIiF1gqzWBQxaUjFHSS4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725777AbfGSEAB (ORCPT ); Fri, 19 Jul 2019 00:00:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:59730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728956AbfGSD75 (ORCPT ); Thu, 18 Jul 2019 23:59:57 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6070921852; Fri, 19 Jul 2019 03:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508796; bh=mWdzKEp5R3wS3vPnZOnkPe4kvnA6JaJWp1Wgrs2lz9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BDE2HxIr2zrjHtbUhPTZ+ctsUcy4z3LwYebQ2GGSwp+TbmBe1v2gNRwojb6xBpNV5 oUF7DoiDBv78WXXFnz1s183PUksSiPY84P1U1kN0mbQI4IwyvfgaCyEg2oB7TsUpgP iAsPuztTgfKiXPaJyflA1g9JtCodt70E1gnzZCKY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Naveen N. Rao" , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.2 093/171] powerpc/xmon: Fix disabling tracing while in xmon Date: Thu, 18 Jul 2019 23:55:24 -0400 Message-Id: <20190719035643.14300-93-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Naveen N. Rao" [ Upstream commit aaf06665f7ea3ee9f9754e16c1a507a89f1de5b1 ] Commit ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering xmon") added code to disable recording trace entries while in xmon. The commit introduced a variable 'tracing_enabled' to record if tracing was enabled on xmon entry, and used this to conditionally enable tracing during exit from xmon. However, we are not checking the value of 'fromipi' variable in xmon_core() when setting 'tracing_enabled'. Due to this, when secondary cpus enter xmon, they will see tracing as being disabled already and tracing won't be re-enabled on exit. Fix the same. Fixes: ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering xmon") Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/xmon/xmon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index d0620d762a5a..4a721fd62406 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -465,8 +465,10 @@ static int xmon_core(struct pt_regs *regs, int fromipi) local_irq_save(flags); hard_irq_disable(); - tracing_enabled = tracing_is_on(); - tracing_off(); + if (!fromipi) { + tracing_enabled = tracing_is_on(); + tracing_off(); + } bp = in_breakpoint_table(regs->nip, &offset); if (bp != NULL) { -- 2.20.1