Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3131492ybi; Thu, 18 Jul 2019 21:38:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHrQGEOzRvv/dsFkn+BES5G8WkWg50vBqujekdcDNflFv7WuAfpBobDuJ8sNm74mvA7KIp X-Received: by 2002:a17:902:549:: with SMTP id 67mr54289875plf.86.1563511120229; Thu, 18 Jul 2019 21:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511120; cv=none; d=google.com; s=arc-20160816; b=r790/mY8SCu5TlklfI0tTWiihPc8lmHZHb/P/woV897auWTeAuD7A8xJLENf4ArTmk 0hB1ENNHpiZlR10kzM5RJNPIQs3SFppixap+1LFu5z9BVk+x96d7tXHkH7b1K/JfiqEu jgEy3Fgm85OImS7a3La/BY+MyA8pjiCtTy0tqJ61FoKq4qGdHRe9E7ISXRXzMrRazM6s gYHpRPqljCEK9cQNLCqM609vdoLuVrMS0TQyKfOWoBbzqlQfU/45NLaGx6EMlUQGLvHm 34ehQ3/xpz7vuI29UcS9O+9tvynRJkopIExHd4oXCipaE6tbHbTdB513AH80MdlIMvPJ RGfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X1REzNSi3UboSsbQPY3xBfGcg7WcGJsMwpfI50kwHcE=; b=PnBgbj9I+wFbKhxWlupG/DfC7RaKpaTHpD6x/hZuMlTQENtSCAcMUKn9d1Gw0U/iAP xazQsPFywvOCe4K+XUVccDGAfreM8Iin2e572/OzynUCeVt/YBqjpUMysp8/oQB/k3Ml NwZw4sadqdmIirGv9xJOgvQQont9dAuBgC+2DOT8RMkq72s6VXE77chWCagwUrA9Cf5d 7Uvgw6TPDQC1tBbZ8Zx6lJbvpFHU0Yab4Fl1LjMvoYY0GybGVv9EC3fxlXt4NARe767z dl9kKSUjDltzGG4ZEDOtiQuvUOXJiVZowm5tjdwcl+86koemrFKn+3PTCbAYWulNWUa/ prFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BDE2HxIr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si355419pgh.316.2019.07.18.21.38.25; Thu, 18 Jul 2019 21:38:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=BDE2HxIr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728977AbfGSEAB (ORCPT + 99 others); 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