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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79804EB64D7 for ; Thu, 22 Jun 2023 01:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J1ZlitkNhAhT6Dojw2U+8WPmMDc8lCIOlfV6e6r/ArE=; b=eBGaU0d2mpwA/d pfY8mBAZRf7T0NhAqPeHRUuyZOt62Fwl7/Ff7ua1qJUHdzOVVpEBU5NpHOo9ewvx1hgeyY+PhyW39 MruqIuZS4L8EmX/xRe7VzzhpuleBBQmCpHT0nEW9VuqDweuenEuoH+9WQYvAlNFw0WciaUoYG8O9f /MOypNfIxIXT16VL7Mi4pomUIc8d0a2Zx9eMDSu42hgvQARmsllzDlQzkWLkcELnjGfzg+lmLs6ox O8Sq0L3bWREWf+Y70xJ/j2QsGi0M2ZWUmtgqIk7m+GvQR+cKbK2W3d9TYo/wbLba4vOnFjZTtsaLL bnp2VSNA6PnlNcH785Vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qC9VO-00GS8P-0m; Thu, 22 Jun 2023 01:53:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qC9VK-00GS3v-1P for linux-arm-kernel@lists.infradead.org; Thu, 22 Jun 2023 01:53:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9257A1063; Wed, 21 Jun 2023 18:53:29 -0700 (PDT) Received: from [10.162.40.20] (unknown [10.162.40.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 491493F64C; Wed, 21 Jun 2023 18:52:40 -0700 (PDT) Message-ID: <6302d09f-0332-b8dc-cb91-8958a9bb9713@arm.com> Date: Thu, 22 Jun 2023 07:22:37 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH V12 05/10] arm64/perf: Add branch stack support in ARMV8 PMU To: Marc Zyngier Cc: Catalin Marinas , kernel test robot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, mark.rutland@arm.com, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Mark Brown , James Clark , Rob Herring , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org References: <20230615133239.442736-6-anshuman.khandual@arm.com> <202306160706.Uei5XDoi-lkp@intel.com> <883f2a20-fe20-4d43-86cf-7847d59e2169@arm.com> <87wmzzq0p4.wl-maz@kernel.org> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <87wmzzq0p4.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_185258_604316_A28C0C35 X-CRM114-Status: GOOD ( 31.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/19/23 14:38, Marc Zyngier wrote: > On Mon, 19 Jun 2023 06:45:07 +0100, > Anshuman Khandual wrote: >> >> >> >> On 6/16/23 14:51, Catalin Marinas wrote: >>> On Fri, Jun 16, 2023 at 06:57:52AM +0530, Anshuman Khandual wrote: >>>> On 6/16/23 05:12, kernel test robot wrote: >>>>> kernel test robot noticed the following build errors: >>>>> >>>>> [auto build test ERROR on arm64/for-next/core] >>>>> [also build test ERROR on tip/perf/core acme/perf/core linus/master v6.4-rc6 next-20230615] >>>>> [If your patch is applied to the wrong git tree, kindly drop us a note. >>>>> And when submitting patch, we suggest to use '--base' as documented in >>>>> https://git-scm.com/docs/git-format-patch#_base_tree_information] >>>>> >>>>> url: https://github.com/intel-lab-lkp/linux/commits/Anshuman-Khandual/drivers-perf-arm_pmu-Add-new-sched_task-callback/20230615-223352 >>>>> base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core >>>>> patch link: https://lore.kernel.org/r/20230615133239.442736-6-anshuman.khandual%40arm.com >>>>> patch subject: [PATCH V12 05/10] arm64/perf: Add branch stack support in ARMV8 PMU >>>>> config: arm-randconfig-r004-20230615 (https://download.01.org/0day-ci/archive/20230616/202306160706.Uei5XDoi-lkp@intel.com/config) >>>>> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a) >>>>> reproduce (this is a W=1 build): >>>>> mkdir -p ~/bin >>>>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >>>>> chmod +x ~/bin/make.cross >>>>> # install arm cross compiling tool for clang build >>>>> # apt-get install binutils-arm-linux-gnueabi >>>>> git remote add arm64 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git >>>>> git fetch arm64 for-next/core >>>>> git checkout arm64/for-next/core >>>>> b4 shazam https://lore.kernel.org/r/20230615133239.442736-6-anshuman.khandual@arm.com >>>>> # save the config file >>>>> mkdir build_dir && cp config build_dir/.config >>>>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=arm olddefconfig >>>>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/perf/ >>>> >>>> I am unable to reproduce this on mainline 6.4-rc6 via default cross compiler >>>> on a W=1 build. Looking at all other problems reported on the file, it seems >>>> something is not right here. Reported build problems around these callbacks, >>>> i.e armv8pmu_branch_XXXX() do not make sense as they are available via config >>>> CONFIG_PERF_EVENTS which is also enabled along with CONFIG_ARM_PMUV3 in this >>>> test config. >>> >>> Have you tried applying this series on top of the arm64 for-next/core >>> branch? That's what the robot it testing (in the absence of a --base >>> option when generating the patches). >> >> Right, it turned out to be a build problem on arm (32 bit) platform instead. >> After arm_pmuv3.c moved into common ./drivers/perf from ./arch/arm64/kernel/, >> it can no longer access arch/arm64/include/asm/perf_event.h defined functions >> without breaking arm (32) bit. The following code block needs to be moved out >> from arch/arm64/include/asm/perf_event.h into include/linux/perf/arm_pmuv3.h >> (which is preferred as all call sites are inside drivers/perf/arm_pmuv3.c) or >> may be arm_pmu.h (which is one step higher in the abstraction). > > No, that's the wrong approach. The 32bit backend must have its own > stubs for the stuff it implements or not. Okay. > > Just add something like the patch below, and please *test* that a > 32bit VM using PMUv3 doesn't have any regression. Sure. > > Thanks, > > M. > >>>From 017362ca518e6d6ac3262514d1f7f27e73232799 Mon Sep 17 00:00:00 2001 > From: Marc Zyngier > Date: Mon, 19 Jun 2023 10:05:52 +0100 > Subject: [PATCH] 32bit hack > > Signed-off-by: Marc Zyngier > --- > arch/arm/include/asm/arm_pmuv3.h | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/arm/include/asm/arm_pmuv3.h b/arch/arm/include/asm/arm_pmuv3.h > index f4db3e75d75f..c4bcb7a18267 100644 > --- a/arch/arm/include/asm/arm_pmuv3.h > +++ b/arch/arm/include/asm/arm_pmuv3.h > @@ -244,4 +244,22 @@ static inline bool is_pmuv3p5(int pmuver) > return pmuver >= ARMV8_PMU_DFR_VER_V3P5; > } > > +/* BRBE stubs */ These stubs also need to be wrapped around with #ifdef CONFIG_PERF_EVENTS > +static inline void armv8pmu_branch_enable(struct perf_event *event) { } > +static inline void armv8pmu_branch_disable(struct perf_event *event) { } > +static inline void armv8pmu_branch_read(struct pmu_hw_events * cpuc, > + struct perf_event *event) { } > +static inline void armv8pmu_branch_save(struct arm_pmu *armpmu, void *ctx) {} > +static inline void armv8pmu_branch_reset(void) {} > +static inline bool armv8pmu_branch_attr_valid(struct perf_event *event) > +{ > + return false; > +} > +static inline void armv8pmu_branch_probe(struct arm_pmu *armpmu) {} > +static inline int armv8pmu_task_ctx_cache_alloc(struct arm_pmu *armpmu) > +{ > + return 0; > +} > +static inline void armv8pmu_task_ctx_cache_free(struct arm_pmu *armpmu) {} > + > #endif Sure, will make all the necessary changes. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel