From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-1372482-1517180003-2-13319031977173443929 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.001, RCVD_IN_DNSWL_HI -5, T_RP_MATCHES_RCVD -0.01, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='209.132.180.67', Host='vger.kernel.org', Country='US', FromHeader='com', MailFrom='org', XOriginatingCountry='US' X-Spam-charsets: plain='iso-8859-1' X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: stable-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1517180002; b=Wj3sHFwO8k3aZ6oNYRxXzWSLir/rLeEov4nZ8tWDWwI1+Gg b6SoT1/g9A2WuIIu5rJk1rUmz6HhmoikMJV5Z+BnxF+DMzTUaqy0Z8UnpWOv4L13 9sgr8pIH75FH4+VjrRSU8ZdAPrQOaaF/Ls5DYfHIqVGM2RE49oC9i68z+u0H/2BZ ygeT6ROJfMqLk0+AmuhqzHKb9ubSe1WWELxAgJ/OiNBepHd3Xl/H0f6xOqXl4d+6 6yvChjvps2YflCLLMzZgr34o17WdbOPGoIy3iIewhy4fpzA2j5/ay/YIiZ5MLIVD rA8oFWbu3/MgdffCOUcJR1TsWAL6L5Ll5g8M93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:date:message-id :references:in-reply-to:content-type:content-transfer-encoding :mime-version:sender:list-id; s=arctest; t=1517180002; bh=3Za3Ad RJQYLczxQqvUhPG5J9G5ZQm35Nj36sVsHwz4o=; b=kf4FpjTfU/B+0laIfeGSJn vOdQsTC+aFC3EgohSxtL3m34qrWhSvdjlN5WnZ/rSh1bAqgw0L/VOWRs5QJ5Eyse 2EeMpvyoJ/frTiRWKkJgzBwZpV4TztpfmeWJCPH1APRfktAwO8hqZMNzSXdKCtN/ K47H1ovjOWOyeuwXZNQbIe5U7zQT0QAVl2w8nmEaSb5OJFbOCmYojMEQOCRnC8/6 6f/wo+eVXcEG9Zp6XF6YJuBMXHay/4Uz+ML/HvbIkWUIoCQvjqZg+3O+X3ACV81l yvMgHJvUFlVPhoGEvHwj9xIxdPQp9/BnwWcPyqGmNwyZXljbixxYzvq4qHLy0yTg == ARC-Authentication-Results: i=1; mx4.messagingengine.com; arc=none (no signatures found); dkim=pass (1024-bit rsa key sha256) header.d=microsoft.com header.i=@microsoft.com header.b=EL3Kuyu3 x-bits=1024 x-keytype=rsa x-algorithm=sha256 x-selector=selector1; dmarc=pass (p=reject,has-list-id=yes,d=none) header.from=microsoft.com; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=stable-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=microsoft.com header.result=pass header_is_org_domain=yes Authentication-Results: mx4.messagingengine.com; arc=none (no signatures found); dkim=pass (1024-bit rsa key sha256) header.d=microsoft.com header.i=@microsoft.com header.b=EL3Kuyu3 x-bits=1024 x-keytype=rsa x-algorithm=sha256 x-selector=selector1; dmarc=pass (p=reject,has-list-id=yes,d=none) header.from=microsoft.com; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=stable-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=microsoft.com header.result=pass header_is_org_domain=yes Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753695AbeA1W2e (ORCPT ); Sun, 28 Jan 2018 17:28:34 -0500 Received: from mail-by2nam03on0130.outbound.protection.outlook.com ([104.47.42.130]:20166 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932070AbeA1W2Y (ORCPT ); Sun, 28 Jan 2018 17:28:24 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Anju T Sudhakar , Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 099/100] powerpc/perf/imc: Fix nest-imc cpuhotplug callback failure Thread-Topic: [PATCH AUTOSEL for 4.14 099/100] powerpc/perf/imc: Fix nest-imc cpuhotplug callback failure Thread-Index: AQHTmIcgu2u1wo8jkEqg8Yrns3oAFg== Date: Sun, 28 Jan 2018 22:27:05 +0000 Message-ID: <20180128222547.7398-99-alexander.levin@microsoft.com> References: <20180128222547.7398-1-alexander.levin@microsoft.com> In-Reply-To: <20180128222547.7398-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MW2PR2101MB1017;7:efkxsi/dDo+14ZjPlQHSgPiyWt9gsmRIdtvbVsZABUQUNcy1kzxMQQNEKfkrvsfWVWLSgIzmZoQvxolVYWphTsLp6KxxfeG03/rCy5VbeKSYCzWvBe79C2DNd5nA3cE2F4xw7/xq4dXH0e55O8XBYXWElUEr6M5Ad1Hnfvh2yZ2bKYwj8sdv6hboxYe0nHGYCGDWoxPwx7+SjCI+0vS0SWQzIvfymglLKJgiHkAUgC+3vibA+Cy2tl8JtxjJIxnr x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c6e21273-a73b-4183-a917-08d5669e6f10 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:MW2PR2101MB1017; x-ms-traffictypediagnostic: MW2PR2101MB1017: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(209352067349851)(104084551191319); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231101)(944501161)(3002001)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:MW2PR2101MB1017;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1017; x-forefront-prvs: 05669A7924 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(39380400002)(366004)(346002)(376002)(189003)(199004)(59450400001)(81156014)(6666003)(305945005)(2900100001)(76176011)(68736007)(86612001)(3660700001)(8676002)(3280700002)(6506007)(102836004)(6116002)(105586002)(7736002)(2950100002)(3846002)(1076002)(106356001)(36756003)(5660300001)(2906002)(8936002)(66066001)(10090500001)(6486002)(6512007)(25786009)(53936002)(186003)(316002)(6436002)(86362001)(575784001)(14454004)(478600001)(2501003)(5250100002)(72206003)(99286004)(97736004)(107886003)(4326008)(54906003)(81166006)(110136005)(26005)(10290500003)(22452003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1017;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-microsoft-antispam-message-info: 4i5y4rESEHnBwdlRdkC89XT0pqDSfzL2n6fvPKgqAgbZu2f8taBeGgdl3osPFUQvMMwRhgyUutsGNrcO1tT6gw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6e21273-a73b-4183-a917-08d5669e6f10 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2018 22:27:05.3103 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1017 Sender: stable-owner@vger.kernel.org X-Mailing-List: stable@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: From: Anju T Sudhakar [ Upstream commit ad2b6e01024ef23bddc3ce0bcb115ecd8c520b7e ] Oops is observed during boot: Faulting instruction address: 0xc000000000248340 cpu 0x0: Vector: 380 (Data Access Out of Range) at [c000000ff66fb850] pc: c000000000248340: event_function_call+0x50/0x1f0 lr: c00000000024878c: perf_remove_from_context+0x3c/0x100 sp: c000000ff66fbad0 msr: 9000000000009033 dar: 7d20e2a6f92d03c0 pid =3D 14, comm =3D cpuhp/0 While registering the cpuhotplug callbacks for nest-imc, if we fail in the cpuhotplug online path for any random node in a multi node system (because the opal call to stop nest-imc counters fails for that node), ppc_nest_imc_cpu_offline() will get invoked for other nodes who successfully returned from cpuhotplug online path. This call trace is generated since in the ppc_nest_imc_cpu_offline() path we are trying to migrate the event context, when nest-imc counters are not even initialized. Patch to add a check to ensure that nest-imc is registered before migrating the event context. Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support") Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/perf/imc-pmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index cf64e16f92c2..da6ba9ba73ed 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -309,6 +309,19 @@ static int ppc_nest_imc_cpu_offline(unsigned int cpu) return 0; =20 /* + * Check whether nest_imc is registered. We could end up here if the + * cpuhotplug callback registration fails. i.e, callback invokes the + * offline path for all successfully registered nodes. At this stage, + * nest_imc pmu will not be registered and we should return here. + * + * We return with a zero since this is not an offline failure. And + * cpuhp_setup_state() returns the actual failure reason to the caller, + * which in turn will call the cleanup routine. + */ + if (!nest_pmus) + return 0; + + /* * Now that this cpu is one of the designated, * find a next cpu a) which is online and b) in same chip. */ --=20 2.11.0