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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 35F5EC433ED for ; Wed, 14 Apr 2021 10:12:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D56F6128E for ; Wed, 14 Apr 2021 10:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232250AbhDNKNB (ORCPT ); Wed, 14 Apr 2021 06:13:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:51968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbhDNKMv (ORCPT ); Wed, 14 Apr 2021 06:12:51 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75A1261158; Wed, 14 Apr 2021 10:12:29 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lWcVX-007PT2-8L; Wed, 14 Apr 2021 11:12:27 +0100 Date: Wed, 14 Apr 2021 11:12:26 +0100 Message-ID: <87o8ehmayd.wl-maz@kernel.org> From: Marc Zyngier To: Nathan Chancellor Cc: kernel test robot , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, Paolo Bonzini , Alexandru Elisei Subject: Re: arch/arm64/kvm/perf.c:58:36: error: implicit declaration of function 'perf_num_counters' In-Reply-To: <20210413200057.ankb4e26ytgal7ev@archlinux-ax161> References: <202103262006.nHFq086E-lkp@intel.com> <20210413200057.ankb4e26ytgal7ev@archlinux-ax161> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: nathan@kernel.org, lkp@intel.com, kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, pbonzini@redhat.com, alexandru.elisei@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Apr 2021 21:00:57 +0100, Nathan Chancellor wrote: [...] > I just ran into this again. It is not a clang specific issue, it > reproduces quite easily with arm64 defconfig minus CONFIG_PERF_EVENTS > and gcc 10.3.0: > > arch/arm64/kvm/perf.c: In function 'kvm_perf_init': > arch/arm64/kvm/perf.c:58:36: error: implicit declaration of function > 'perf_num_counters'; did you mean 'dec_mm_counter'? > [-Werror=implicit-function-declaration] > 58 | if (IS_ENABLED(CONFIG_ARM_PMU) && perf_num_counters() > 0) > | ^~~~~~~~~~~~~~~~~ > | dec_mm_counter > cc1: some warnings being treated as errors > > I am not sure what the cleanest solution would be for providing a static > inline version of perf_num_counters() would be, as only arm64 actually > uses it (sh and s390 define it but it does not appear to be used) but it > is only available through CONFIG_ARM_PMU instead of just > CONFIG_PERF_EVENTS like the other two architectures mentioned above. As you point out, KVM/arm64 is the only user of perf_num_counters() across the whole kernel. The whole oprofile subsystem has been removed, so maybe a a bigger cleanup is in order. I'll post something shortly. Thanks, M. -- Without deviation from the norm, progress is not possible.