Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp976817imm; Tue, 3 Jul 2018 03:25:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK+n3rIBL8er7iC3bf7ZUiK0Ul4dgDA9+i7omQQYx4k3qKVVmRplpF+dnJE5lI7ViW+d1d8 X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr29089333plc.241.1530613542060; Tue, 03 Jul 2018 03:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530613542; cv=none; d=google.com; s=arc-20160816; b=sMXJdY1tEpZi+uDvd/PIrHWMxIh4RtQxmXx2iUa0JanvhBOqG4qfg57uBwVCfk2JSn R/MWvNP9Pkib0zjK0pDcYMjvw01syX/OHwuUF6Ov4NtJx2kePE7whTb8ZR7cfgjgS4Vg dtYONSBi4Q5kNtVZIvtUGiqyTaDIIMa8KXLLoTfGMH5qQhxkSEYfsu1QCNamT4+eUVxE nWLDL2wN3Kkj4eZV2sSAxVR3l3Htq6nfyHIWM5mziU/s4OKEZU5RuPzZiUcfwGxqG8rs EoN+wlzLoZDkrYCKYTpS6wi/HY56D2kAIzKxPwTUmOfmjYTZwsIWidQ6WqeQ0S8ToJ2P 5LbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :references:cc:to:subject:from:arc-authentication-results; bh=2mPJXO2X8LPAwzBJe37XGJBEkGvFaNYnzchtoVeLHvk=; b=i61d3QuyueMrCwDRoqvccOTwmyouy9X6+7WiJQOpGdFusYbkNc9oESV5UH8yn0/nwX nxmiHVhzo/zNKJ5pkHvNpHa63UF5IhwAIWOQCEw2IK9uPbOsNIS8ESYmydkLBLg14nVY elVj68N0trkZruLP5L8nj0qNie/TQkfoZIN9pQ7U2p2fMk0Zsf7LV9RyDS5PFMDoJvHX uSS9hBdrncdTG6Lq0JKHqkol5Rb2UIfbE93eCHUR0SnKNnJvTW5dSZeb0p79j7iml7GD 3JSsAJpQTXn1LbwrrviyVW5bjKYXJhH1C0/9ooTjqvX7K/m0n6nzwrjUwzxcDcml620k cX0g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e88-v6si861838pfb.185.2018.07.03.03.25.27; Tue, 03 Jul 2018 03:25:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754789AbeGCKYa (ORCPT + 99 others); Tue, 3 Jul 2018 06:24:30 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36638 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754757AbeGCKY3 (ORCPT ); Tue, 3 Jul 2018 06:24:29 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w63AONqw134129 for ; Tue, 3 Jul 2018 06:24:28 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k067fk24m-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Jul 2018 06:24:28 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jul 2018 11:24:26 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 3 Jul 2018 11:24:21 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w63AOKiJ37027938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Jul 2018 10:24:20 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4CA6AE053; Tue, 3 Jul 2018 13:24:22 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 667D8AE058; Tue, 3 Jul 2018 13:24:20 +0100 (BST) Received: from [9.124.31.159] (unknown [9.124.31.159]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 3 Jul 2018 13:24:20 +0100 (BST) From: Ravi Bangoria Subject: Re: [RFC 2/4] perf: Pass pmu pointer to perf_paranoid_* helpers To: Tvrtko Ursulin Cc: linux-kernel@vger.kernel.org, Tvrtko Ursulin , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Madhavan Srinivasan , Andi Kleen , Alexey Budankov , x86@kernel.org, Ravi Bangoria References: <20180626153642.5587-1-tvrtko.ursulin@linux.intel.com> <20180626153642.5587-3-tvrtko.ursulin@linux.intel.com> Date: Tue, 3 Jul 2018 15:54:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180626153642.5587-3-tvrtko.ursulin@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18070310-0028-0000-0000-000002D7ACED X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070310-0029-0000-0000-0000238F2D6D Message-Id: <5b618e5f-0dcd-5acb-96a0-a0560815c0d7@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-03_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=789 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807030120 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tvrtko, > @@ -199,7 +199,7 @@ static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp) > if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid) > *addrp = mfspr(SPRN_SDAR); > > - if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) && > + if (perf_paranoid_kernel(ppmu) && !capable(CAP_SYS_ADMIN) && > is_kernel_addr(mfspr(SPRN_SDAR))) > *addrp = 0; > } This patch fails for me on powerpc: arch/powerpc/perf/core-book3s.c: In function ‘perf_get_data_addr’: arch/powerpc/perf/core-book3s.c:202:27: error: passing argument 1 of ‘perf_paranoid_kernel’ from incompatible pointer type [-Werror=incompatible-pointer-types] if (perf_paranoid_kernel(ppmu) && !capable(CAP_SYS_ADMIN) && ^~~~ In file included from arch/powerpc/perf/core-book3s.c:13:0: ./include/linux/perf_event.h:1191:20: note: expected ‘const struct pmu *’ but argument is of type ‘struct power_pmu *’ static inline bool perf_paranoid_kernel(const struct pmu *pmu) ^~~~~~~~~~~~~~~~~~~~ arch/powerpc/perf/core-book3s.c: In function ‘power_pmu_bhrb_read’: arch/powerpc/perf/core-book3s.c:470:8: error: too few arguments to function ‘perf_paranoid_kernel’ if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) && ^~~~~~~~~~~~~~~~~~~~ In file included from arch/powerpc/perf/core-book3s.c:13:0: ./include/linux/perf_event.h:1191:20: note: declared here static inline bool perf_paranoid_kernel(const struct pmu *pmu) ^~~~~~~~~~~~~~~~~~~~ CC net/ipv6/route.o