Message ID | 20201027163624.20747-4-ionela.voinescu@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: cppc: add FFH support using AMUs | expand |
Hi Ionela, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on 3650b228f83adda7e5ee532e2b90429c03f7b9ec] url: https://github.com/0day-ci/linux/commits/Ionela-Voinescu/arm64-cppc-add-FFH-support-using-AMUs/20201028-004534 base: 3650b228f83adda7e5ee532e2b90429c03f7b9ec config: arm64-randconfig-r001-20201028 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 50dfa19cc799ae7cddd39a95dbfce675a12672ad) 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 arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/0day-ci/linux/commit/43a45631863c12f95767b36c67a29654319068df git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Ionela-Voinescu/arm64-cppc-add-FFH-support-using-AMUs/20201028-004534 git checkout 43a45631863c12f95767b36c67a29654319068df # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from ipc/msg.c:27: In file included from include/linux/msg.h:6: In file included from include/uapi/linux/msg.h:5: In file included from include/linux/ipc.h:5: In file included from include/linux/spinlock.h:54: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> ipc/msg.c:494:20: warning: implicit conversion from 'int' to 'unsigned short' changes value from 32768000 to 0 [-Wconstant-conversion] msginfo->msgseg = MSGSEG; ~ ^~~~~~ include/uapi/linux/msg.h:87:38: note: expanded from macro 'MSGSEG' #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff) ^~~~~~~~ include/uapi/linux/msg.h:86:36: note: expanded from macro '__MSGSEG' #define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */ ~~~~~~~~~~~~~~~~~^~~~~~~~ 1 warning and 1 error generated. -- In file included from kernel/dma/direct.c:7: In file included from include/linux/memblock.h:13: In file included from include/linux/mm.h:10: In file included from include/linux/gfp.h:6: In file included from include/linux/mmzone.h:8: In file included from include/linux/spinlock.h:54: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> kernel/dma/direct.c:102:20: warning: shift count >= width of type [-Wshift-count-overflow] phys_limit < DMA_BIT_MASK(64) && ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ >> kernel/dma/direct.c:102:20: warning: shift count >= width of type [-Wshift-count-overflow] phys_limit < DMA_BIT_MASK(64) && ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ >> kernel/dma/direct.c:102:20: warning: shift count >= width of type [-Wshift-count-overflow] phys_limit < DMA_BIT_MASK(64) && ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ~~~~~~~~~~~~~~~~~^~~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ 3 warnings and 1 error generated. -- In file included from drivers/dma/altera-msgdma.c:13: In file included from include/linux/dma-mapping.h:7: In file included from include/linux/device.h:15: In file included from include/linux/dev_printk.h:16: In file included from include/linux/ratelimit.h:6: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/dma/altera-msgdma.c:877:46: warning: shift count >= width of type [-Wshift-count-overflow] ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 1 warning and 1 error generated. -- In file included from drivers/dma/idma64.c:11: In file included from include/linux/dmaengine.h:8: In file included from include/linux/device.h:15: In file included from include/linux/dev_printk.h:16: In file included from include/linux/ratelimit.h:6: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/dma/idma64.c:648:45: warning: shift count >= width of type [-Wshift-count-overflow] ret = dma_coerce_mask_and_coherent(sysdev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 1 warning and 1 error generated. -- In file included from drivers/dma/qcom/hidma_mgmt.c:8: In file included from include/linux/dmaengine.h:8: In file included from include/linux/device.h:15: In file included from include/linux/dev_printk.h:16: In file included from include/linux/ratelimit.h:6: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/dma/qcom/hidma_mgmt.c:384:23: warning: shift count >= width of type [-Wshift-count-overflow] pdevinfo.dma_mask = DMA_BIT_MASK(64); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 1 warning and 1 error generated. -- In file included from drivers/dma/qcom/hidma.c:45: In file included from include/linux/dmaengine.h:8: In file included from include/linux/device.h:15: In file included from include/linux/dev_printk.h:16: In file included from include/linux/ratelimit.h:6: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ drivers/dma/qcom/hidma.c:750:8: warning: cast to smaller integer type 'enum hidma_cap' from 'const void *' [-Wvoid-pointer-to-enum-cast] cap = (enum hidma_cap) device_get_match_data(dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/dma/qcom/hidma.c:850:45: warning: shift count >= width of type [-Wshift-count-overflow] rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 2 warnings and 1 error generated. -- In file included from drivers/misc/mic/bus/vop_bus.c:9: In file included from include/linux/slab.h:15: In file included from include/linux/gfp.h:6: In file included from include/linux/mmzone.h:8: In file included from include/linux/spinlock.h:54: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/misc/mic/bus/vop_bus.c:150:27: warning: shift count >= width of type [-Wshift-count-overflow] dma_set_mask(&vdev->dev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 1 warning and 1 error generated. -- In file included from drivers/mmc/core/sd.c:12: In file included from include/linux/slab.h:15: In file included from include/linux/gfp.h:6: In file included from include/linux/mmzone.h:8: In file included from include/linux/spinlock.h:54: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/mmc/core/sd.c:89:22: warning: shift count >= width of type [-Wshift-count-overflow] card->cid.serial = UNSTUFF_BITS(resp, 24, 32); ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mmc/core/sd.c:58:39: note: expanded from macro 'UNSTUFF_BITS' const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \ ^ ~~~~~~ 1 warning and 1 error generated. -- In file included from drivers/mmc/host/sdhci-sprd.c:9: In file included from include/linux/dma-mapping.h:7: In file included from include/linux/device.h:15: In file included from include/linux/dev_printk.h:16: In file included from include/linux/ratelimit.h:6: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/mmc/host/sdhci-sprd.c:558:19: warning: shift count >= width of type [-Wshift-count-overflow] host->dma_mask = DMA_BIT_MASK(64); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 1 warning and 1 error generated. -- In file included from drivers/mmc/host/sdhci.c:14: In file included from include/linux/dmaengine.h:8: In file included from include/linux/device.h:15: In file included from include/linux/dev_printk.h:16: In file included from include/linux/ratelimit.h:6: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/mmc/host/sdhci.c:3953:40: warning: shift count >= width of type [-Wshift-count-overflow] ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ drivers/mmc/host/sdhci.c:4254:20: warning: shift count >= width of type [-Wshift-count-overflow] host->dma_mask = DMA_BIT_MASK(64); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 2 warnings and 1 error generated. -- In file included from drivers/mmc/host/dw_mmc.c:10: In file included from include/linux/blkdev.h:5: In file included from include/linux/sched.h:14: In file included from include/linux/pid.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ >> drivers/mmc/host/dw_mmc.c:2911:33: warning: shift count >= width of type [-Wshift-count-overflow] if (!dma_set_mask(host->dev, DMA_BIT_MASK(64))) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ >> drivers/mmc/host/dw_mmc.c:2911:33: warning: shift count >= width of type [-Wshift-count-overflow] if (!dma_set_mask(host->dev, DMA_BIT_MASK(64))) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ >> drivers/mmc/host/dw_mmc.c:2911:33: warning: shift count >= width of type [-Wshift-count-overflow] if (!dma_set_mask(host->dev, DMA_BIT_MASK(64))) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ~~~~~~~~~~~~~~~~~^~~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ drivers/mmc/host/dw_mmc.c:2913:13: warning: shift count >= width of type [-Wshift-count-overflow] DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 4 warnings and 1 error generated. vim +494 ipc/msg.c a0d092fc2df845a Pierre Peiffer 2008-04-29 473 156d9ed1260ee56 Al Viro 2017-07-09 474 static int msgctl_info(struct ipc_namespace *ns, int msqid, 156d9ed1260ee56 Al Viro 2017-07-09 475 int cmd, struct msginfo *msginfo) a0d092fc2df845a Pierre Peiffer 2008-04-29 476 { 2cafed30f150f73 Davidlohr Bueso 2013-07-08 477 int err; 27c331a17461420 Manfred Spraul 2018-08-21 478 int max_idx; 5a06a363ef48444 Ingo Molnar 2006-07-30 479 5a06a363ef48444 Ingo Molnar 2006-07-30 480 /* 5a06a363ef48444 Ingo Molnar 2006-07-30 481 * We must not return kernel stack data. ^1da177e4c3f415 Linus Torvalds 2005-04-16 482 * due to padding, it's not enough ^1da177e4c3f415 Linus Torvalds 2005-04-16 483 * to set all member fields. ^1da177e4c3f415 Linus Torvalds 2005-04-16 484 */ ^1da177e4c3f415 Linus Torvalds 2005-04-16 485 err = security_msg_queue_msgctl(NULL, cmd); ^1da177e4c3f415 Linus Torvalds 2005-04-16 486 if (err) ^1da177e4c3f415 Linus Torvalds 2005-04-16 487 return err; ^1da177e4c3f415 Linus Torvalds 2005-04-16 488 156d9ed1260ee56 Al Viro 2017-07-09 489 memset(msginfo, 0, sizeof(*msginfo)); 156d9ed1260ee56 Al Viro 2017-07-09 490 msginfo->msgmni = ns->msg_ctlmni; 156d9ed1260ee56 Al Viro 2017-07-09 491 msginfo->msgmax = ns->msg_ctlmax; 156d9ed1260ee56 Al Viro 2017-07-09 492 msginfo->msgmnb = ns->msg_ctlmnb; 156d9ed1260ee56 Al Viro 2017-07-09 493 msginfo->msgssz = MSGSSZ; 156d9ed1260ee56 Al Viro 2017-07-09 @494 msginfo->msgseg = MSGSEG; d9a605e40b1376e Davidlohr Bueso 2013-09-11 495 down_read(&msg_ids(ns).rwsem); ^1da177e4c3f415 Linus Torvalds 2005-04-16 496 if (cmd == MSG_INFO) { 156d9ed1260ee56 Al Viro 2017-07-09 497 msginfo->msgpool = msg_ids(ns).in_use; 156d9ed1260ee56 Al Viro 2017-07-09 498 msginfo->msgmap = atomic_read(&ns->msg_hdrs); 156d9ed1260ee56 Al Viro 2017-07-09 499 msginfo->msgtql = atomic_read(&ns->msg_bytes); ^1da177e4c3f415 Linus Torvalds 2005-04-16 500 } else { 156d9ed1260ee56 Al Viro 2017-07-09 501 msginfo->msgmap = MSGMAP; 156d9ed1260ee56 Al Viro 2017-07-09 502 msginfo->msgpool = MSGPOOL; 156d9ed1260ee56 Al Viro 2017-07-09 503 msginfo->msgtql = MSGTQL; ^1da177e4c3f415 Linus Torvalds 2005-04-16 504 } 27c331a17461420 Manfred Spraul 2018-08-21 505 max_idx = ipc_get_maxidx(&msg_ids(ns)); d9a605e40b1376e Davidlohr Bueso 2013-09-11 506 up_read(&msg_ids(ns).rwsem); 27c331a17461420 Manfred Spraul 2018-08-21 507 return (max_idx < 0) ? 0 : max_idx; ^1da177e4c3f415 Linus Torvalds 2005-04-16 508 } 2cafed30f150f73 Davidlohr Bueso 2013-07-08 509 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Hi Ionela, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on 3650b228f83adda7e5ee532e2b90429c03f7b9ec] url: https://github.com/0day-ci/linux/commits/Ionela-Voinescu/arm64-cppc-add-FFH-support-using-AMUs/20201028-004534 base: 3650b228f83adda7e5ee532e2b90429c03f7b9ec config: arm64-randconfig-r016-20201103 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1fcd5d5655e29f85e12b402e32974f207cfedf32) 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 arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/0day-ci/linux/commit/43a45631863c12f95767b36c67a29654319068df git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Ionela-Voinescu/arm64-cppc-add-FFH-support-using-AMUs/20201028-004534 git checkout 43a45631863c12f95767b36c67a29654319068df # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from drivers/ata/sata_highbank.c:9: In file included from include/linux/gfp.h:6: In file included from include/linux/mmzone.h:8: In file included from include/linux/spinlock.h:54: In file included from include/linux/irqflags.h:16: In file included from arch/arm64/include/asm/irqflags.h:10: In file included from arch/arm64/include/asm/ptrace.h:11: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ drivers/ata/sata_highbank.c:442:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] AHCI_SHT("sata_highbank"), ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/ata/ahci.h:387:16: note: expanded from macro 'AHCI_SHT' .can_queue = AHCI_MAX_CMDS, \ ^~~~~~~~~~~~~ drivers/ata/sata_highbank.c:442:2: note: previous initialization is here AHCI_SHT("sata_highbank"), ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT' ATA_NCQ_SHT(drv_name), \ ^~~~~~~~~~~~~~~~~~~~~ include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT' __ATA_BASE_SHT(drv_name), \ ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT' .can_queue = ATA_DEF_QUEUE, \ ^~~~~~~~~~~~~ drivers/ata/sata_highbank.c:442:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] AHCI_SHT("sata_highbank"), ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/ata/ahci.h:391:17: note: expanded from macro 'AHCI_SHT' .sdev_attrs = ahci_sdev_attrs ^~~~~~~~~~~~~~~ drivers/ata/sata_highbank.c:442:2: note: previous initialization is here AHCI_SHT("sata_highbank"), ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT' ATA_NCQ_SHT(drv_name), \ ^~~~~~~~~~~~~~~~~~~~~ include/linux/libata.h:1419:17: note: expanded from macro 'ATA_NCQ_SHT' .sdev_attrs = ata_ncq_sdev_attrs, \ ^~~~~~~~~~~~~~~~~~ >> drivers/ata/sata_highbank.c:512:30: warning: shift count >= width of type [-Wshift-count-overflow] dma_set_coherent_mask(dev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 3 warnings and 1 error generated. -- In file included from drivers/ata/sata_mv.c:40: In file included from include/linux/module.h:13: In file included from include/linux/stat.h:6: In file included from arch/arm64/include/asm/stat.h:12: In file included from include/linux/time.h:73: In file included from include/linux/time32.h:13: In file included from include/linux/timex.h:65: In file included from arch/arm64/include/asm/timex.h:8: In file included from arch/arm64/include/asm/arch_timer.h:12: In file included from arch/arm64/include/asm/hwcap.h:9: arch/arm64/include/asm/cpufeature.h:751:9: error: use of undeclared identifier 'nr_cpu_ids' return nr_cpu_ids; ^ drivers/ata/sata_mv.c:670:16: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] .can_queue = MV_MAX_Q_DEPTH - 1, ^~~~~~~~~~~~~~~~~~ drivers/ata/sata_mv.c:669:2: note: previous initialization is here ATA_NCQ_SHT(DRV_NAME), ^~~~~~~~~~~~~~~~~~~~~ include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT' __ATA_BASE_SHT(drv_name), \ ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT' .can_queue = ATA_DEF_QUEUE, \ ^~~~~~~~~~~~~ >> drivers/ata/sata_mv.c:4403:45: warning: shift count >= width of type [-Wshift-count-overflow] rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^ ~~~ 2 warnings and 1 error generated. vim +512 drivers/ata/sata_highbank.c 8996b89d6bc98ae Mark Langsdorf 2012-09-06 450 0ec24914675c482 Greg Kroah-Hartman 2012-12-21 451 static int ahci_highbank_probe(struct platform_device *pdev) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 452 { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 453 struct device *dev = &pdev->dev; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 454 struct ahci_host_priv *hpriv; d50b110f14ad070 Mark Langsdorf 2013-06-06 455 struct ecx_plat_data *pdata; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 456 struct ata_host *host; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 457 struct resource *mem; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 458 int irq; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 459 int i; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 460 int rc; d50b110f14ad070 Mark Langsdorf 2013-06-06 461 u32 n_ports; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 462 struct ata_port_info pi = ahci_highbank_port_info; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 463 const struct ata_port_info *ppi[] = { &pi, NULL }; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 464 8996b89d6bc98ae Mark Langsdorf 2012-09-06 465 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 466 if (!mem) { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 467 dev_err(dev, "no mmio space\n"); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 468 return -EINVAL; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 469 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 470 8996b89d6bc98ae Mark Langsdorf 2012-09-06 471 irq = platform_get_irq(pdev, 0); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 472 if (irq <= 0) { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 473 dev_err(dev, "no irq\n"); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 474 return -EINVAL; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 475 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 476 8996b89d6bc98ae Mark Langsdorf 2012-09-06 477 hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 478 if (!hpriv) { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 479 dev_err(dev, "can't alloc ahci_host_priv\n"); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 480 return -ENOMEM; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 481 } d50b110f14ad070 Mark Langsdorf 2013-06-06 482 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); d50b110f14ad070 Mark Langsdorf 2013-06-06 483 if (!pdata) { d50b110f14ad070 Mark Langsdorf 2013-06-06 484 dev_err(dev, "can't alloc ecx_plat_data\n"); d50b110f14ad070 Mark Langsdorf 2013-06-06 485 return -ENOMEM; d50b110f14ad070 Mark Langsdorf 2013-06-06 486 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 487 21bfd1aa9527811 Robert Richter 2015-05-31 488 hpriv->irq = irq; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 489 hpriv->flags |= (unsigned long)pi.private_data; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 490 8996b89d6bc98ae Mark Langsdorf 2012-09-06 491 hpriv->mmio = devm_ioremap(dev, mem->start, resource_size(mem)); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 492 if (!hpriv->mmio) { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 493 dev_err(dev, "can't map %pR\n", mem); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 494 return -ENOMEM; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 495 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 496 8996b89d6bc98ae Mark Langsdorf 2012-09-06 497 rc = highbank_initialize_phys(dev, hpriv->mmio); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 498 if (rc) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 499 return rc; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 500 8996b89d6bc98ae Mark Langsdorf 2012-09-06 501 725c7b570fda420 Antoine Tenart 2014-07-30 502 ahci_save_initial_config(dev, hpriv); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 503 8996b89d6bc98ae Mark Langsdorf 2012-09-06 504 /* prepare host */ 8996b89d6bc98ae Mark Langsdorf 2012-09-06 505 if (hpriv->cap & HOST_CAP_NCQ) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 506 pi.flags |= ATA_FLAG_NCQ; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 507 8996b89d6bc98ae Mark Langsdorf 2012-09-06 508 if (hpriv->cap & HOST_CAP_PMP) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 509 pi.flags |= ATA_FLAG_PMP; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 510 404eafe137f858b Rob Herring 2013-08-07 511 if (hpriv->cap & HOST_CAP_64) 404eafe137f858b Rob Herring 2013-08-07 @512 dma_set_coherent_mask(dev, DMA_BIT_MASK(64)); 404eafe137f858b Rob Herring 2013-08-07 513 8996b89d6bc98ae Mark Langsdorf 2012-09-06 514 /* CAP.NP sometimes indicate the index of the last enabled 8996b89d6bc98ae Mark Langsdorf 2012-09-06 515 * port, at other times, that of the last possible port, so 8996b89d6bc98ae Mark Langsdorf 2012-09-06 516 * determining the maximum port number requires looking at 8996b89d6bc98ae Mark Langsdorf 2012-09-06 517 * both CAP.NP and port_map. 8996b89d6bc98ae Mark Langsdorf 2012-09-06 518 */ 8996b89d6bc98ae Mark Langsdorf 2012-09-06 519 n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map)); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 520 d50b110f14ad070 Mark Langsdorf 2013-06-06 521 pdata->n_ports = n_ports; d50b110f14ad070 Mark Langsdorf 2013-06-06 522 hpriv->plat_data = pdata; d50b110f14ad070 Mark Langsdorf 2013-06-06 523 highbank_set_em_messages(dev, hpriv, &pi); d50b110f14ad070 Mark Langsdorf 2013-06-06 524 8996b89d6bc98ae Mark Langsdorf 2012-09-06 525 host = ata_host_alloc_pinfo(dev, ppi, n_ports); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 526 if (!host) { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 527 rc = -ENOMEM; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 528 goto err0; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 529 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 530 8996b89d6bc98ae Mark Langsdorf 2012-09-06 531 host->private_data = hpriv; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 532 8996b89d6bc98ae Mark Langsdorf 2012-09-06 533 if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 534 host->flags |= ATA_HOST_PARALLEL_SCAN; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 535 8996b89d6bc98ae Mark Langsdorf 2012-09-06 536 for (i = 0; i < host->n_ports; i++) { 8996b89d6bc98ae Mark Langsdorf 2012-09-06 537 struct ata_port *ap = host->ports[i]; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 538 8996b89d6bc98ae Mark Langsdorf 2012-09-06 539 ata_port_desc(ap, "mmio %pR", mem); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 540 ata_port_desc(ap, "port 0x%x", 0x100 + ap->port_no * 0x80); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 541 8996b89d6bc98ae Mark Langsdorf 2012-09-06 542 /* set enclosure management message type */ 8996b89d6bc98ae Mark Langsdorf 2012-09-06 543 if (ap->flags & ATA_FLAG_EM) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 544 ap->em_message_type = hpriv->em_msg_type; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 545 8996b89d6bc98ae Mark Langsdorf 2012-09-06 546 /* disabled/not-implemented port */ 8996b89d6bc98ae Mark Langsdorf 2012-09-06 547 if (!(hpriv->port_map & (1 << i))) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 548 ap->ops = &ata_dummy_port_ops; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 549 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 550 8996b89d6bc98ae Mark Langsdorf 2012-09-06 551 rc = ahci_reset_controller(host); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 552 if (rc) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 553 goto err0; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 554 8996b89d6bc98ae Mark Langsdorf 2012-09-06 555 ahci_init_controller(host); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 556 ahci_print_info(host, "platform"); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 557 21bfd1aa9527811 Robert Richter 2015-05-31 558 rc = ahci_host_activate(host, &ahci_highbank_platform_sht); 8996b89d6bc98ae Mark Langsdorf 2012-09-06 559 if (rc) 8996b89d6bc98ae Mark Langsdorf 2012-09-06 560 goto err0; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 561 8996b89d6bc98ae Mark Langsdorf 2012-09-06 562 return 0; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 563 err0: 8996b89d6bc98ae Mark Langsdorf 2012-09-06 564 return rc; 8996b89d6bc98ae Mark Langsdorf 2012-09-06 565 } 8996b89d6bc98ae Mark Langsdorf 2012-09-06 566 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 42187f424e11..9f4bdd2b26bf 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -741,9 +741,15 @@ static inline bool cpu_has_hw_af(void) } #ifdef CONFIG_ARM64_AMU_EXTN +/* Get a cpu that supports the Activity Monitors Unit (AMU) */ +extern int get_cpu_with_amu_feat(void); /* Check whether the cpu supports the Activity Monitors Unit (AMU) */ extern bool cpu_has_amu_feat(int cpu); #else +static inline int get_cpu_with_amu_feat(void) +{ + return nr_cpu_ids; +} static inline bool cpu_has_amu_feat(int cpu) { return false; diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 1142970e985b..c867a1e484b9 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1526,6 +1526,11 @@ bool cpu_has_amu_feat(int cpu) return cpumask_test_cpu(cpu, &amu_cpus); } +int get_cpu_with_amu_feat(void) +{ + return cpumask_any(&amu_cpus); +} + static void cpu_amu_enable(struct arm64_cpu_capabilities const *cap) { if (has_cpuid_feature(cap, SCOPE_LOCAL_CPU)) { diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 764fdb0f947b..7d25087deaa5 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -154,6 +154,9 @@ void update_freq_counters_refs(void) static inline bool freq_counters_valid(int cpu) { + if ((cpu >= nr_cpu_ids) || !cpumask_test_cpu(cpu, cpu_present_mask)) + return false; + if (!cpu_has_amu_feat(cpu)) { pr_debug("CPU%d: counters are not supported.\n", cpu); return false; @@ -330,3 +333,54 @@ void topology_scale_freq_tick(void) this_cpu_write(arch_core_cycles_prev, core_cnt); this_cpu_write(arch_const_cycles_prev, const_cnt); } + +#ifdef CONFIG_ACPI_CPPC_LIB +#include <acpi/cppc_acpi.h> + +static inline +int counters_read_on_cpu(int cpu, smp_call_func_t func, u64 *val) +{ + if (!cpu_has_amu_feat(cpu)) + return -EOPNOTSUPP; + + smp_call_function_single(cpu, func, val, 1); + + return 0; +} + +/* + * Refer to drivers/acpi/cppc_acpi.c for the description of the functions + * below. + */ +bool cpc_ffh_supported(void) +{ + return freq_counters_valid(get_cpu_with_amu_feat()); +} + +int cpc_read_ffh(int cpu, struct cpc_reg *reg, u64 *val) +{ + int ret = -EOPNOTSUPP; + + switch ((u64)reg->address) { + case 0x0: + ret = counters_read_on_cpu(cpu, store_corecnt, val); + break; + case 0x1: + ret = counters_read_on_cpu(cpu, store_constcnt, val); + break; + } + + if (!ret) { + *val &= GENMASK_ULL(reg->bit_offset + reg->bit_width - 1, + reg->bit_offset); + *val >>= reg->bit_offset; + } + + return ret; +} + +int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val) +{ + return -EOPNOTSUPP; +} +#endif /* CONFIG_ACPI_CPPC_LIB */
If Activity Monitors (AMUs) are present, two of the counters can be used to implement support for CPPC's (Collaborative Processor Performance Control) delivered and reference performance monitoring functionality using FFH (Functional Fixed Hardware). Given that counters for a certain CPU can only be read from that CPU, while FFH operations can be called from any CPU for any of the CPUs, use smp_call_function_single() to provide the requested values. Therefore, depending on the register addresses, the following values are returned: - 0x0 (DeliveredPerformanceCounterRegister): AMU core counter - 0x1 (ReferencePerformanceCounterRegister): AMU constant counter The use of Activity Monitors is hidden behind the generic {read,store}_{corecnt,constcnt}() functions. Read functionality for these two registers represents the only current FFH support for CPPC. Read operations for other register values or write operation for all registers are unsupported. Therefore, keep CPPC's FFH unsupported if no CPUs have valid AMU frequency counters. For this purpose, the get_cpu_with_amu_feat() is introduced. Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> --- arch/arm64/include/asm/cpufeature.h | 6 ++++ arch/arm64/kernel/cpufeature.c | 5 +++ arch/arm64/kernel/topology.c | 54 +++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+)