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=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 03E68C43460 for ; Wed, 21 Apr 2021 13:56:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD96A61445 for ; Wed, 21 Apr 2021 13:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243067AbhDUN5T (ORCPT ); Wed, 21 Apr 2021 09:57:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:33508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243034AbhDUN4w (ORCPT ); Wed, 21 Apr 2021 09:56:52 -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 1F5366144B; Wed, 21 Apr 2021 13:56:19 +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 1lZDKy-008hhW-W1; Wed, 21 Apr 2021 14:56:17 +0100 Date: Wed, 21 Apr 2021 14:56:16 +0100 Message-ID: <87y2dbpwqn.wl-maz@kernel.org> From: Marc Zyngier To: Arnd Bergmann Cc: Catalin Marinas , Will Deacon , Arnd Bergmann , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Andrew Scull , David Brazdil , Quentin Perret , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: build perf support only when enabled In-Reply-To: <20210421134922.3309033-1-arnd@kernel.org> References: <20210421134922.3309033-1-arnd@kernel.org> 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: arnd@kernel.org, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, tabba@google.com, ascull@google.com, dbrazdil@google.com, qperret@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org 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 Wed, 21 Apr 2021 14:49:01 +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > The perf_num_counters() function is only defined when CONFIG_PERF_EVENTS > is enabled: > > arch/arm64/kvm/perf.c: In function 'kvm_perf_init': > arch/arm64/kvm/perf.c:58:43: 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 > | ^~~~~~~~~~~~~~~~~ > > Use conditional compilation to disable this feature entirely when > CONFIG_PERF_EVENTS is disabled in the host. > > Fixes: 6b5b368fccd7 ("KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key") > Signed-off-by: Arnd Bergmann > --- > Not sure if this is the correct symbol to check for, but this is > one way to avoid the build failure. I think a better way is to get rid of perf_num_counters() entirely, see [1]. If someone acks the second and last patches, I'll even take the whole series in (nudge nudge...). Thanks, M. [1] https://lore.kernel.org/r/20210414134409.1266357-1-maz@kernel.org -- Without deviation from the norm, progress is not possible.