Received: by 10.213.65.68 with SMTP id h4csp2114035imn; Sun, 8 Apr 2018 20:04:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx49wP57baf8EJuLklkuC2NuX2LULYE4ndieMxijQu1jJIbGCh7ODtRGMV1RsPmXKCw0AdUMC X-Received: by 10.99.114.21 with SMTP id n21mr19527608pgc.142.1523243050217; Sun, 08 Apr 2018 20:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243050; cv=none; d=google.com; s=arc-20160816; b=r4T59LnK9wk8WAnosMHcUSdrNoWUnVKXuN8onWopQPsZD+3/2ZHXiypTMjBUe1Dl6r V/dje7b1M8ilh7uSPdb94g5l9r1FILFtkTEiuVVNuGtH3tbtlb9/V0Vr9ZteGA2eODvy in6WaV5S2DLc87XDzUpR21Hpguhp9R11rOTw67Watc6VqaEH3isMI2JXZSLSBkg3rSjh eaw9+3aPI3RoslwBODdNa9VIqCa9HE8DKx4mje/476pzDbmoSgatxcwBujJyMJ3I+xFq eGhxO1wNowtWJF5q0ZJn5bpF2fgOUCR4CXZgLzUQX/yUvL7ekOD1T1d+XIqYcHNDvOuw XgCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=wt8z4+LLP6Rwrv6xXzPF9QR2XFjkQu3rNv27JG+n20k=; b=cPF+IOChZh2HQzHCQhjkPDzbWDGTvWznnIbh6Y8Lu1vZvSFVz5kcMU3Q6Nau+l6BhF 0gPRbQEeSbyF6g5TmQRG5jVThTQfz8fT0MJcG8OqdoT8ugld7v3ZCIFKTIvDZ6vyFjWP T05abQxLFUIo3A4cOKHAxYWm5cOGzNhOc2FG4bDkZ65D1TGoHsYdoW/N41ouynHShXDD wjCo73pMbyBW8OP+dYLrTbvzKLTfbFjNY3QuFSdgp1n96LUR58A/5utlLAYV3FkIYd0i Xe/umqI1h6dDzBW7S97fKsALhO1h7lJow4K85SuPwfb0OtlAIM+kNT3Dz3ZKr6jFFdDp Lh6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=QwrPOxSg; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b60-v6si10732146plc.610.2018.04.08.20.03.33; Sun, 08 Apr 2018 20:04:10 -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=@microsoft.com header.s=selector1 header.b=QwrPOxSg; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756433AbeDIAcJ (ORCPT + 99 others); Sun, 8 Apr 2018 20:32:09 -0400 Received: from mail-sn1nam01on0103.outbound.protection.outlook.com ([104.47.32.103]:45281 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756356AbeDIAcG (ORCPT ); Sun, 8 Apr 2018 20:32:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wt8z4+LLP6Rwrv6xXzPF9QR2XFjkQu3rNv27JG+n20k=; b=QwrPOxSgwTEEPQh5dm/rHotzEPLptdwfOVt3E1HAFGImZNWK5EVrPda9Z2dCkL3JSUsR4SpUgoGMZRFnC7o4ASODOISw2AnlQj88HYa91+IZtO7IkldT3B4GUTim3mcEX8brCGKvTOW8NSJYWEgk4Cf22/WC41yO+ZOuYemrDdg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0870.namprd21.prod.outlook.com (10.167.110.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:32:04 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:32:04 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Thiago Jung Bauermann , Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 194/293] powerpc/perf/hv-24x7: Fix passing of catalog version number Thread-Topic: [PATCH AUTOSEL for 4.9 194/293] powerpc/perf/hv-24x7: Fix passing of catalog version number Thread-Index: AQHTz5lBL+PB01qmb0SkDjGtYUxSeA== Date: Mon, 9 Apr 2018 00:25:25 +0000 Message-ID: <20180409002239.163177-194-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0870;7:gQaSv4cyEhAJoEijPsiwXsZIf3Fx8MejGDB2gAYzdUeIx4A4j+lMKAx6RO7x0XZmQPvRUGbqI3sY3uGmSLdqS1n0hvfx0Qaqdp3TACQyCCFNcgVSOpJkDOXVI1gdpPvMts0wsaVVet91o3Yr+ag2PVLtmQCuSYn6WW9IMoK+Ie5OH1C8s9m4UIiZPE1k/AinBQLt6I/r37Wcmy2A0Cyy0q5WOlMyip/BQ4ti/uoXic5kbc+3xoAZvzNP0ZNLP2oX;20:qIyfkCBL/kJu6n+cOXCwL9zb9q2om2JlWZB9bRWN6HGUQVtHp2/5jrVL1t87au2vz0ooJSZPO96rByuXOP4NMCMwQ5/B9mWu1rYz9AGe7lsGz6OYS6b8+kQdt1iOF5qCiVoKW6JXBE57ozC8eJpthI3MXu2RMEA1EoAvpaPr/d8= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: a8f011e5-1a8c-4e71-7ed2-08d59db15163 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0870; x-ms-traffictypediagnostic: DM5PR2101MB0870: 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)(104084551191319); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0870;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0870; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(366004)(396003)(39380400002)(376002)(199004)(189003)(53936002)(2906002)(6512007)(102836004)(2616005)(76176011)(14454004)(446003)(10090500001)(11346002)(476003)(486006)(107886003)(2900100001)(97736004)(66066001)(6506007)(6436002)(106356001)(99286004)(105586002)(3660700001)(6116002)(86612001)(3280700002)(6666003)(2501003)(10290500003)(26005)(8676002)(8936002)(478600001)(68736007)(5250100002)(5660300001)(316002)(4326008)(72206003)(186003)(110136005)(6486002)(7736002)(25786009)(3846002)(86362001)(36756003)(22452003)(81156014)(81166006)(305945005)(54906003)(1076002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0870;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Oj8gIOUuqIk23dTNXIv4jbF2GXfJfSeXhVsFR9Ib8F3Phh5pcIjMAxNSOfqqy3x58Y9SHvM+qgFz0utW8k4TyPU34fGUpMGJmaZ0zR70XUj3Aw3Aw/hgsPYoWDP7/UGGIYQb6aC9+zI23DIzWPGYAQ99L/MCvj1+6kvNJLEh+2MGUhEiUEoCdoAeryNwf/RZebsxu3h1vBW5wxpX5mEKaMUoMcvk5JturBgql2MMdGdA0Qq8eSNX6W4PH86Hs1M06RvR/WyoE4RTPYtqOT4kANf4WJ3CanV3t0ESp/YXt+Qa9FftxMZJab8wcH/6jACBh+7ZGwsjjMaATBtNjBR9M+17tfNRWWWEqFx05voeReMYqfKmSretUDrJJmjidjRV/OPAkIIK/DvaJJRvRpXZrD/kIQ4n7p4wLqeAURYvYUU= 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: a8f011e5-1a8c-4e71-7ed2-08d59db15163 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:25.9564 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0870 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thiago Jung Bauermann [ Upstream commit 12bf85a71000af7419b19b5e90910919f36f336c ] H_GET_24X7_CATALOG_PAGE needs to be passed the version number obtained from the first catalog page obtained previously. This is a 64 bit number, but create_events_from_catalog truncates it to 32-bit. This worked on POWER8, but POWER9 actually uses the upper bits so the call fails with H_P3 because the hypervisor doesn't recognize the version. This patch also adds the hcall return code to the error message, which is helpful when debugging the problem. Fixes: 5c5cd7b50259 ("powerpc/perf/hv-24x7: parse catalog and populate sysf= s with events") Reviewed-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/perf/hv-24x7.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 991c6a517ddc..13cea4e8c56d 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c @@ -670,7 +670,7 @@ static int create_events_from_catalog(struct attribute = ***events_, event_data_bytes, junk_events, event_idx, event_attr_ct, i, attr_max, event_idx_last, desc_ct, long_desc_ct; ssize_t ct, ev_len; - uint32_t catalog_version_num; + uint64_t catalog_version_num; struct attribute **events, **event_descs, **event_long_descs; struct hv_24x7_catalog_page_0 *page_0 =3D kmem_cache_alloc(hv_page_cache, GFP_KERNEL); @@ -706,8 +706,8 @@ static int create_events_from_catalog(struct attribute = ***events_, event_data_offs =3D be16_to_cpu(page_0->event_data_offs); event_data_len =3D be16_to_cpu(page_0->event_data_len); =20 - pr_devel("cv %zu cl %zu eec %zu edo %zu edl %zu\n", - (size_t)catalog_version_num, catalog_len, + pr_devel("cv %llu cl %zu eec %zu edo %zu edl %zu\n", + catalog_version_num, catalog_len, event_entry_count, event_data_offs, event_data_len); =20 if ((MAX_4K < event_data_len) @@ -761,8 +761,8 @@ static int create_events_from_catalog(struct attribute = ***events_, catalog_version_num, i + event_data_offs); if (hret) { - pr_err("failed to get event data in page %zu\n", - i + event_data_offs); + pr_err("Failed to get event data in page %zu: rc=3D%ld\n", + i + event_data_offs, hret); ret =3D -EIO; goto e_event_data; } --=20 2.15.1