All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
@ 2023-03-28  8:01 kernel test robot
  2023-03-28 12:21 ` Will Deacon
  0 siblings, 1 reply; 8+ messages in thread
From: kernel test robot @ 2023-03-28  8:01 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Will Deacon,
	Zaid Al-Bassam

Hi Marc,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   a6faf7ea9fcb7267d06116d4188947f26e00e57e
commit: 3b16f6268e660f15aed0bb97aefe87e893eb8882 [6577/7309] ARM: mach-virt: Select PMUv3 driver by default
config: arm-randconfig-r024-20230326 (https://download.01.org/0day-ci/archive/20230328/202303281539.zzI4vpw1-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
reproduce (this is a W=1 build):
        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
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3b16f6268e660f15aed0bb97aefe87e893eb8882
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 3b16f6268e660f15aed0bb97aefe87e893eb8882
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/perf/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303281539.zzI4vpw1-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
           PERF_MAP_ALL_UNSUPPORTED,
           ^
>> drivers/perf/arm_pmuv3.c:59:2: error: use of undeclared identifier 'PERF_CACHE_MAP_ALL_UNSUPPORTED'
           PERF_CACHE_MAP_ALL_UNSUPPORTED,
           ^
>> drivers/perf/arm_pmuv3.c:61:3: error: call to undeclared function 'C'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           [C(L1D)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1D_CACHE,
            ^
>> drivers/perf/arm_pmuv3.c:61:5: error: use of undeclared identifier 'L1D'
           [C(L1D)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1D_CACHE,
              ^
>> drivers/perf/arm_pmuv3.c:61:13: error: use of undeclared identifier 'OP_READ'
           [C(L1D)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1D_CACHE,
                      ^
>> drivers/perf/arm_pmuv3.c:61:25: error: use of undeclared identifier 'RESULT_ACCESS'
           [C(L1D)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1D_CACHE,
                                  ^
   drivers/perf/arm_pmuv3.c:62:5: error: use of undeclared identifier 'L1D'
           [C(L1D)][C(OP_READ)][C(RESULT_MISS)]    = ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL,
              ^
   drivers/perf/arm_pmuv3.c:62:13: error: use of undeclared identifier 'OP_READ'
           [C(L1D)][C(OP_READ)][C(RESULT_MISS)]    = ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL,
                      ^
>> drivers/perf/arm_pmuv3.c:62:25: error: use of undeclared identifier 'RESULT_MISS'
           [C(L1D)][C(OP_READ)][C(RESULT_MISS)]    = ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL,
                                  ^
>> drivers/perf/arm_pmuv3.c:64:5: error: use of undeclared identifier 'L1I'
           [C(L1I)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1I_CACHE,
              ^
   drivers/perf/arm_pmuv3.c:64:13: error: use of undeclared identifier 'OP_READ'
           [C(L1I)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1I_CACHE,
                      ^
   drivers/perf/arm_pmuv3.c:64:25: error: use of undeclared identifier 'RESULT_ACCESS'
           [C(L1I)][C(OP_READ)][C(RESULT_ACCESS)]  = ARMV8_PMUV3_PERFCTR_L1I_CACHE,
                                  ^
   drivers/perf/arm_pmuv3.c:65:5: error: use of undeclared identifier 'L1I'
           [C(L1I)][C(OP_READ)][C(RESULT_MISS)]    = ARMV8_PMUV3_PERFCTR_L1I_CACHE_REFILL,
              ^
   drivers/perf/arm_pmuv3.c:65:13: error: use of undeclared identifier 'OP_READ'
           [C(L1I)][C(OP_READ)][C(RESULT_MISS)]    = ARMV8_PMUV3_PERFCTR_L1I_CACHE_REFILL,
                      ^
   drivers/perf/arm_pmuv3.c:65:25: error: use of undeclared identifier 'RESULT_MISS'
           [C(L1I)][C(OP_READ)][C(RESULT_MISS)]    = ARMV8_PMUV3_PERFCTR_L1I_CACHE_REFILL,
                                  ^
>> drivers/perf/arm_pmuv3.c:67:5: error: use of undeclared identifier 'DTLB'
           [C(DTLB)][C(OP_READ)][C(RESULT_MISS)]   = ARMV8_PMUV3_PERFCTR_L1D_TLB_REFILL,
              ^
   drivers/perf/arm_pmuv3.c:67:14: error: use of undeclared identifier 'OP_READ'
           [C(DTLB)][C(OP_READ)][C(RESULT_MISS)]   = ARMV8_PMUV3_PERFCTR_L1D_TLB_REFILL,
                       ^
   drivers/perf/arm_pmuv3.c:67:26: error: use of undeclared identifier 'RESULT_MISS'
           [C(DTLB)][C(OP_READ)][C(RESULT_MISS)]   = ARMV8_PMUV3_PERFCTR_L1D_TLB_REFILL,
                                   ^
   drivers/perf/arm_pmuv3.c:68:5: error: use of undeclared identifier 'DTLB'
           [C(DTLB)][C(OP_READ)][C(RESULT_ACCESS)] = ARMV8_PMUV3_PERFCTR_L1D_TLB,
              ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ARM_PMUV3
   Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
   Selected by [y]:
   - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]


vim +/PERF_MAP_ALL_UNSUPPORTED +44 drivers/perf/arm_pmuv3.c

62a4dda9d63a10 arch/arm64/kernel/perf_event.c Mark Rutland  2015-10-02  37  
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  38  /*
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  39   * ARMv8 Architectural defined events, not all of these may
342e53bd8548e0 arch/arm64/kernel/perf_event.c Will Deacon   2018-10-05  40   * be supported on any given implementation. Unsupported events will
342e53bd8548e0 arch/arm64/kernel/perf_event.c Will Deacon   2018-10-05  41   * be disabled at run-time based on the PMCEID registers.
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  42   */
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  43  static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = {
ae2fb7ece973f0 arch/arm64/kernel/perf_event.c Mark Rutland  2015-07-21 @44  	PERF_MAP_ALL_UNSUPPORTED,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  45  	[PERF_COUNT_HW_CPU_CYCLES]		= ARMV8_PMUV3_PERFCTR_CPU_CYCLES,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  46  	[PERF_COUNT_HW_INSTRUCTIONS]		= ARMV8_PMUV3_PERFCTR_INST_RETIRED,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  47  	[PERF_COUNT_HW_CACHE_REFERENCES]	= ARMV8_PMUV3_PERFCTR_L1D_CACHE,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  48  	[PERF_COUNT_HW_CACHE_MISSES]		= ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  49  	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS]	= ARMV8_PMUV3_PERFCTR_PC_WRITE_RETIRED,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  50  	[PERF_COUNT_HW_BRANCH_MISSES]		= ARMV8_PMUV3_PERFCTR_BR_MIS_PRED,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  51  	[PERF_COUNT_HW_BUS_CYCLES]		= ARMV8_PMUV3_PERFCTR_BUS_CYCLES,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  52  	[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND]	= ARMV8_PMUV3_PERFCTR_STALL_FRONTEND,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  53  	[PERF_COUNT_HW_STALLED_CYCLES_BACKEND]	= ARMV8_PMUV3_PERFCTR_STALL_BACKEND,
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  54  };
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  55  
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  56  static const unsigned armv8_pmuv3_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  57  						[PERF_COUNT_HW_CACHE_OP_MAX]
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  58  						[PERF_COUNT_HW_CACHE_RESULT_MAX] = {
ae2fb7ece973f0 arch/arm64/kernel/perf_event.c Mark Rutland  2015-07-21 @59  	PERF_CACHE_MAP_ALL_UNSUPPORTED,
ae2fb7ece973f0 arch/arm64/kernel/perf_event.c Mark Rutland  2015-07-21  60  
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21 @61  	[C(L1D)][C(OP_READ)][C(RESULT_ACCESS)]	= ARMV8_PMUV3_PERFCTR_L1D_CACHE,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21 @62  	[C(L1D)][C(OP_READ)][C(RESULT_MISS)]	= ARMV8_PMUV3_PERFCTR_L1D_CACHE_REFILL,
ae2fb7ece973f0 arch/arm64/kernel/perf_event.c Mark Rutland  2015-07-21  63  
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14 @64  	[C(L1I)][C(OP_READ)][C(RESULT_ACCESS)]	= ARMV8_PMUV3_PERFCTR_L1I_CACHE,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14 @65  	[C(L1I)][C(OP_READ)][C(RESULT_MISS)]	= ARMV8_PMUV3_PERFCTR_L1I_CACHE_REFILL,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  66  
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14 @67  	[C(DTLB)][C(OP_READ)][C(RESULT_MISS)]	= ARMV8_PMUV3_PERFCTR_L1D_TLB_REFILL,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  68  	[C(DTLB)][C(OP_READ)][C(RESULT_ACCESS)]	= ARMV8_PMUV3_PERFCTR_L1D_TLB,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  69  
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  70  	[C(ITLB)][C(OP_READ)][C(RESULT_MISS)]	= ARMV8_PMUV3_PERFCTR_L1I_TLB_REFILL,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  71  	[C(ITLB)][C(OP_READ)][C(RESULT_ACCESS)]	= ARMV8_PMUV3_PERFCTR_L1I_TLB,
236b9b91cd1255 arch/arm64/kernel/perf_event.c Jeremy Linton 2016-09-14  72  
ffdbd3d83553be arch/arm64/kernel/perf_event.c Leo Yan       2020-08-11  73  	[C(LL)][C(OP_READ)][C(RESULT_MISS)]	= ARMV8_PMUV3_PERFCTR_LL_CACHE_MISS_RD,
ffdbd3d83553be arch/arm64/kernel/perf_event.c Leo Yan       2020-08-11  74  	[C(LL)][C(OP_READ)][C(RESULT_ACCESS)]	= ARMV8_PMUV3_PERFCTR_LL_CACHE_RD,
ffdbd3d83553be arch/arm64/kernel/perf_event.c Leo Yan       2020-08-11  75  
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  76  	[C(BPU)][C(OP_READ)][C(RESULT_ACCESS)]	= ARMV8_PMUV3_PERFCTR_BR_PRED,
03598fdbc9deae arch/arm64/kernel/perf_event.c Ashok Kumar   2016-04-21  77  	[C(BPU)][C(OP_READ)][C(RESULT_MISS)]	= ARMV8_PMUV3_PERFCTR_BR_MIS_PRED,
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  78  };
030896885ade0a arch/arm64/kernel/perf_event.c Will Deacon   2012-03-05  79  

:::::: The code at line 44 was first introduced by commit
:::::: ae2fb7ece973f0b285f41985f5de85c57df9bf5a arm64: perf: condense event number maps

:::::: TO: Mark Rutland <mark.rutland@arm.com>
:::::: CC: Will Deacon <will.deacon@arm.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28  8:01 [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED' kernel test robot
@ 2023-03-28 12:21 ` Will Deacon
  2023-03-28 15:14   ` Zaid Al-Bassam
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Will Deacon @ 2023-03-28 12:21 UTC (permalink / raw)
  To: kernel test robot
  Cc: Marc Zyngier, llvm, oe-kbuild-all, Linux Memory Management List,
	Zaid Al-Bassam

On Tue, Mar 28, 2023 at 04:01:49PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   a6faf7ea9fcb7267d06116d4188947f26e00e57e
> commit: 3b16f6268e660f15aed0bb97aefe87e893eb8882 [6577/7309] ARM: mach-virt: Select PMUv3 driver by default
> config: arm-randconfig-r024-20230326 (https://download.01.org/0day-ci/archive/20230328/202303281539.zzI4vpw1-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
> reproduce (this is a W=1 build):
>         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
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3b16f6268e660f15aed0bb97aefe87e893eb8882
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 3b16f6268e660f15aed0bb97aefe87e893eb8882
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/perf/
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/202303281539.zzI4vpw1-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
>            PERF_MAP_ALL_UNSUPPORTED,
>            ^
> >> drivers/perf/arm_pmuv3.c:59:2: error: use of undeclared identifier 'PERF_CACHE_MAP_ALL_UNSUPPORTED'
>            PERF_CACHE_MAP_ALL_UNSUPPORTED,
>            ^

I think the Kconfig warning is relevant here:

> Kconfig warnings: (for reference only)
>    WARNING: unmet direct dependencies detected for ARM_PMUV3
>    Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
>    Selected by [y]:
>    - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]

Since we're selecting an option which has its own dependencies. I think
the easiest bet is to invert the linkage so that PMUV3 has a dependency
on ARCH_VIRT for 32-bit Arm (diff below).

Marc, Zaid -- what do you think?

Cheers,

Will

--->8

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a5e5c0b09ff2..e24a9820e12f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -401,7 +401,6 @@ config ARCH_VIRT
        select ARM_GIC_V3
        select ARM_GIC_V3_ITS if PCI
        select ARM_PSCI
-       select ARM_PMUV3 if PERF_EVENTS
        select HAVE_ARM_ARCH_TIMER
 
 config ARCH_AIROHA
diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
index 711f82400086..cf1559581fbc 100644
--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -103,7 +103,7 @@ config ARM_SMMU_V3_PMU
 config ARM_PMUV3
        depends on HW_PERF_EVENTS && ((ARM && CPU_V7) || ARM64)
        bool "ARM PMUv3 support" if !ARM64
-       default ARM64
+       default ARM64 || (ARM && ARCH_VIRT)
          help
          Say y if you want to use the ARM performance monitor unit (PMU)
          version 3. The PMUv3 is the CPU performance monitors on ARMv8


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28 12:21 ` Will Deacon
@ 2023-03-28 15:14   ` Zaid Al-Bassam
  2023-03-28 15:29   ` Arnd Bergmann
  2023-03-28 15:42   ` Marc Zyngier
  2 siblings, 0 replies; 8+ messages in thread
From: Zaid Al-Bassam @ 2023-03-28 15:14 UTC (permalink / raw)
  To: Will Deacon
  Cc: kernel test robot, Marc Zyngier, llvm, oe-kbuild-all,
	Linux Memory Management List

Hi Will,

First, Sorry I haven't noticed that missing dependency case. Your
change looks good to me, but to keep the driver/perf/Kconfig clean, I
was thinking of rather expanding the check at the arch level, i.e.:

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6f0a2576d17f..a82765929f67 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -401,7 +401,7 @@ config ARCH_VIRT
        select ARM_GIC_V3
        select ARM_GIC_V3_ITS if PCI
        select ARM_PSCI
-       select ARM_PMUV3 if PERF_EVENTS
+       select ARM_PMUV3 if PERF_EVENTS && HW_PERF_EVENTS
        select HAVE_ARM_ARCH_TIMER

 config ARCH_AIROHA

What do you think? Marc, Any input? please!

Thank you,
Zaid

On Tue, Mar 28, 2023 at 8:21 AM Will Deacon <will@kernel.org> wrote:
>
> On Tue, Mar 28, 2023 at 04:01:49PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   a6faf7ea9fcb7267d06116d4188947f26e00e57e
> > commit: 3b16f6268e660f15aed0bb97aefe87e893eb8882 [6577/7309] ARM: mach-virt: Select PMUv3 driver by default
> > config: arm-randconfig-r024-20230326 (https://download.01.org/0day-ci/archive/20230328/202303281539.zzI4vpw1-lkp@intel.com/config)
> > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
> > reproduce (this is a W=1 build):
> >         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
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3b16f6268e660f15aed0bb97aefe87e893eb8882
> >         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >         git fetch --no-tags linux-next master
> >         git checkout 3b16f6268e660f15aed0bb97aefe87e893eb8882
> >         # save the config file
> >         mkdir build_dir && cp config build_dir/.config
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/perf/
> >
> > If you fix the issue, kindly add following tag where applicable
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Link: https://lore.kernel.org/oe-kbuild-all/202303281539.zzI4vpw1-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > >> drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
> >            PERF_MAP_ALL_UNSUPPORTED,
> >            ^
> > >> drivers/perf/arm_pmuv3.c:59:2: error: use of undeclared identifier 'PERF_CACHE_MAP_ALL_UNSUPPORTED'
> >            PERF_CACHE_MAP_ALL_UNSUPPORTED,
> >            ^
>
> I think the Kconfig warning is relevant here:
>
> > Kconfig warnings: (for reference only)
> >    WARNING: unmet direct dependencies detected for ARM_PMUV3
> >    Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
> >    Selected by [y]:
> >    - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]
>
> Since we're selecting an option which has its own dependencies. I think
> the easiest bet is to invert the linkage so that PMUV3 has a dependency
> on ARCH_VIRT for 32-bit Arm (diff below).
>
> Marc, Zaid -- what do you think?
>
> Cheers,
>
> Will
>
> --->8
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index a5e5c0b09ff2..e24a9820e12f 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -401,7 +401,6 @@ config ARCH_VIRT
>         select ARM_GIC_V3
>         select ARM_GIC_V3_ITS if PCI
>         select ARM_PSCI
> -       select ARM_PMUV3 if PERF_EVENTS
>         select HAVE_ARM_ARCH_TIMER
>
>  config ARCH_AIROHA
> diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
> index 711f82400086..cf1559581fbc 100644
> --- a/drivers/perf/Kconfig
> +++ b/drivers/perf/Kconfig
> @@ -103,7 +103,7 @@ config ARM_SMMU_V3_PMU
>  config ARM_PMUV3
>         depends on HW_PERF_EVENTS && ((ARM && CPU_V7) || ARM64)
>         bool "ARM PMUv3 support" if !ARM64
> -       default ARM64
> +       default ARM64 || (ARM && ARCH_VIRT)
>           help
>           Say y if you want to use the ARM performance monitor unit (PMU)
>           version 3. The PMUv3 is the CPU performance monitors on ARMv8
>

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28 12:21 ` Will Deacon
  2023-03-28 15:14   ` Zaid Al-Bassam
@ 2023-03-28 15:29   ` Arnd Bergmann
  2023-03-28 15:35     ` Marc Zyngier
  2023-03-28 15:42   ` Marc Zyngier
  2 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2023-03-28 15:29 UTC (permalink / raw)
  To: Will Deacon, kernel test robot
  Cc: Marc Zyngier, llvm, oe-kbuild-all, Linux Memory Management List,
	Zaid Al-Bassam

On Tue, Mar 28, 2023, at 14:21, Will Deacon wrote:
> On Tue, Mar 28, 2023 at 04:01:49PM +0800, kernel test robot wrote:

> I think the Kconfig warning is relevant here:
>
>> Kconfig warnings: (for reference only)
>>    WARNING: unmet direct dependencies detected for ARM_PMUV3
>>    Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
>>    Selected by [y]:
>>    - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]
>
> Since we're selecting an option which has its own dependencies. I think
> the easiest bet is to invert the linkage so that PMUV3 has a dependency
> on ARCH_VIRT for 32-bit Arm (diff below).
>
> Marc, Zaid -- what do you think?

I think dropping the 'select' is best, as this is still a user-visible
option. How about this instead:

--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -103,7 +103,7 @@ config ARM_SMMU_V3_PMU
 config ARM_PMUV3
        depends on HW_PERF_EVENTS && ((ARM && CPU_V7) || ARM64)
        bool "ARM PMUv3 support" if !ARM64
-       default ARM64
+       default ARM64 || ARCH_VIRT
          help
          Say y if you want to use the ARM performance monitor unit (PMU)
          version 3. The PMUv3 is the CPU performance monitors on ARMv8

This way, it's still enabled by default for most people, but
there is no dependency problem and it's also possible to
turn it off.

     Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28 15:29   ` Arnd Bergmann
@ 2023-03-28 15:35     ` Marc Zyngier
  2023-03-28 16:37       ` Zaid Al-Bassam
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2023-03-28 15:35 UTC (permalink / raw)
  To: Arnd Bergmann, Will Deacon
  Cc: kernel test robot, llvm, oe-kbuild-all,
	Linux Memory Management List, Zaid Al-Bassam

On Tue, 28 Mar 2023 16:29:07 +0100,
"Arnd Bergmann" <arnd@arndb.de> wrote:
> 
> On Tue, Mar 28, 2023, at 14:21, Will Deacon wrote:
> > On Tue, Mar 28, 2023 at 04:01:49PM +0800, kernel test robot wrote:
> 
> > I think the Kconfig warning is relevant here:
> >
> >> Kconfig warnings: (for reference only)
> >>    WARNING: unmet direct dependencies detected for ARM_PMUV3
> >>    Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
> >>    Selected by [y]:
> >>    - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]
> >
> > Since we're selecting an option which has its own dependencies. I think
> > the easiest bet is to invert the linkage so that PMUV3 has a dependency
> > on ARCH_VIRT for 32-bit Arm (diff below).
> >
> > Marc, Zaid -- what do you think?
> 
> I think dropping the 'select' is best, as this is still a user-visible
> option. How about this instead:
> 
> --- a/drivers/perf/Kconfig
> +++ b/drivers/perf/Kconfig
> @@ -103,7 +103,7 @@ config ARM_SMMU_V3_PMU
>  config ARM_PMUV3
>         depends on HW_PERF_EVENTS && ((ARM && CPU_V7) || ARM64)
>         bool "ARM PMUv3 support" if !ARM64
> -       default ARM64
> +       default ARM64 || ARCH_VIRT
>           help
>           Say y if you want to use the ARM performance monitor unit (PMU)
>           version 3. The PMUv3 is the CPU performance monitors on ARMv8
> 
> This way, it's still enabled by default for most people, but
> there is no dependency problem and it's also possible to
> turn it off.

[removing my old self from the Cc list]

Either way work for me. Or even drop that patch altogether and let
people select PMUv3 if they really want it. This is extremely niche
anyway, and most people won't care.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28 12:21 ` Will Deacon
  2023-03-28 15:14   ` Zaid Al-Bassam
  2023-03-28 15:29   ` Arnd Bergmann
@ 2023-03-28 15:42   ` Marc Zyngier
  2 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2023-03-28 15:42 UTC (permalink / raw)
  To: Will Deacon
  Cc: kernel test robot, llvm, oe-kbuild-all,
	Linux Memory Management List, Zaid Al-Bassam

On Tue, 28 Mar 2023 13:21:38 +0100,
Will Deacon <will@kernel.org> wrote:
> 
> On Tue, Mar 28, 2023 at 04:01:49PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   a6faf7ea9fcb7267d06116d4188947f26e00e57e
> > commit: 3b16f6268e660f15aed0bb97aefe87e893eb8882 [6577/7309] ARM: mach-virt: Select PMUv3 driver by default
> > config: arm-randconfig-r024-20230326 (https://download.01.org/0day-ci/archive/20230328/202303281539.zzI4vpw1-lkp@intel.com/config)
> > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
> > reproduce (this is a W=1 build):
> >         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
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3b16f6268e660f15aed0bb97aefe87e893eb8882
> >         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >         git fetch --no-tags linux-next master
> >         git checkout 3b16f6268e660f15aed0bb97aefe87e893eb8882
> >         # save the config file
> >         mkdir build_dir && cp config build_dir/.config
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/perf/
> > 
> > If you fix the issue, kindly add following tag where applicable
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Link: https://lore.kernel.org/oe-kbuild-all/202303281539.zzI4vpw1-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>):
> > 
> > >> drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
> >            PERF_MAP_ALL_UNSUPPORTED,
> >            ^
> > >> drivers/perf/arm_pmuv3.c:59:2: error: use of undeclared identifier 'PERF_CACHE_MAP_ALL_UNSUPPORTED'
> >            PERF_CACHE_MAP_ALL_UNSUPPORTED,
> >            ^
> 
> I think the Kconfig warning is relevant here:
> 
> > Kconfig warnings: (for reference only)
> >    WARNING: unmet direct dependencies detected for ARM_PMUV3
> >    Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
> >    Selected by [y]:
> >    - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]
> 
> Since we're selecting an option which has its own dependencies. I think
> the easiest bet is to invert the linkage so that PMUV3 has a dependency
> on ARCH_VIRT for 32-bit Arm (diff below).
> 
> Marc, Zaid -- what do you think?

As I said in another branch of the thread, I'd rather drop the
ARCH_VIRT patch altogether. It is only of interest to the 3 people
that care about it, most of which are already on Cc.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28 15:35     ` Marc Zyngier
@ 2023-03-28 16:37       ` Zaid Al-Bassam
  2023-03-28 17:51         ` Will Deacon
  0 siblings, 1 reply; 8+ messages in thread
From: Zaid Al-Bassam @ 2023-03-28 16:37 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Arnd Bergmann, Will Deacon, kernel test robot, llvm,
	oe-kbuild-all, Linux Memory Management List

Thank you Marc.

Arnd, Do you want to change your patch to drop [1], or should I create
a new patch? Btw, Thank you for the patch.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/commit/?id=3b16f6268e66

Zaid

On Tue, Mar 28, 2023 at 11:35 AM Marc Zyngier <maz@kernel.org> wrote:
>
> On Tue, 28 Mar 2023 16:29:07 +0100,
> "Arnd Bergmann" <arnd@arndb.de> wrote:
> >
> > On Tue, Mar 28, 2023, at 14:21, Will Deacon wrote:
> > > On Tue, Mar 28, 2023 at 04:01:49PM +0800, kernel test robot wrote:
> >
> > > I think the Kconfig warning is relevant here:
> > >
> > >> Kconfig warnings: (for reference only)
> > >>    WARNING: unmet direct dependencies detected for ARM_PMUV3
> > >>    Depends on [n]: PERF_EVENTS [=y] && HW_PERF_EVENTS [=n] && (ARM [=y] && CPU_V7 [=y] || ARM64)
> > >>    Selected by [y]:
> > >>    - ARCH_VIRT [=y] && ARCH_MULTI_V7 [=y] && PERF_EVENTS [=y]
> > >
> > > Since we're selecting an option which has its own dependencies. I think
> > > the easiest bet is to invert the linkage so that PMUV3 has a dependency
> > > on ARCH_VIRT for 32-bit Arm (diff below).
> > >
> > > Marc, Zaid -- what do you think?
> >
> > I think dropping the 'select' is best, as this is still a user-visible
> > option. How about this instead:
> >
> > --- a/drivers/perf/Kconfig
> > +++ b/drivers/perf/Kconfig
> > @@ -103,7 +103,7 @@ config ARM_SMMU_V3_PMU
> >  config ARM_PMUV3
> >         depends on HW_PERF_EVENTS && ((ARM && CPU_V7) || ARM64)
> >         bool "ARM PMUv3 support" if !ARM64
> > -       default ARM64
> > +       default ARM64 || ARCH_VIRT
> >           help
> >           Say y if you want to use the ARM performance monitor unit (PMU)
> >           version 3. The PMUv3 is the CPU performance monitors on ARMv8
> >
> > This way, it's still enabled by default for most people, but
> > there is no dependency problem and it's also possible to
> > turn it off.
>
> [removing my old self from the Cc list]
>
> Either way work for me. Or even drop that patch altogether and let
> people select PMUv3 if they really want it. This is extremely niche
> anyway, and most people won't care.
>
> Thanks,
>
>         M.
>
> --
> Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED'
  2023-03-28 16:37       ` Zaid Al-Bassam
@ 2023-03-28 17:51         ` Will Deacon
  0 siblings, 0 replies; 8+ messages in thread
From: Will Deacon @ 2023-03-28 17:51 UTC (permalink / raw)
  To: Zaid Al-Bassam
  Cc: Marc Zyngier, Arnd Bergmann, kernel test robot, llvm,
	oe-kbuild-all, Linux Memory Management List

On Tue, Mar 28, 2023 at 12:37:42PM -0400, Zaid Al-Bassam wrote:
> Arnd, Do you want to change your patch to drop [1], or should I create
> a new patch? Btw, Thank you for the patch.
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/commit/?id=3b16f6268e66

I think the suggestion is to revert this change, so I'll do that now.

Cheers,

Will

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-28 17:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28  8:01 [linux-next:master 6577/7309] drivers/perf/arm_pmuv3.c:44:2: error: use of undeclared identifier 'PERF_MAP_ALL_UNSUPPORTED' kernel test robot
2023-03-28 12:21 ` Will Deacon
2023-03-28 15:14   ` Zaid Al-Bassam
2023-03-28 15:29   ` Arnd Bergmann
2023-03-28 15:35     ` Marc Zyngier
2023-03-28 16:37       ` Zaid Al-Bassam
2023-03-28 17:51         ` Will Deacon
2023-03-28 15:42   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.