Re: [PATCH v9 2/9] preempt: Introduce __preempt_count_{sub, add}_return()

kernel test robot
2025-03-01T19:02:00Z

Hi Lyude,

kernel test robot noticed the following build errors:

[auto build test ERROR on 2014c95afecee3e76ca4a56956a936e23283f05b]

url: https://github.com/intel-lab-lkp/linux/commits/Lyude-Paul/preempt-Introduce-HARDIRQ_DISABLE_BITS/20250228-062508
base: 2014c95afecee3e76ca4a56956a936e23283f05b
patch link: https://lore.kernel.org/r/20250227221924.265259-3-lyude%40redhat.com
patch subject: [PATCH v9 2/9] preempt: Introduce __preempt_count_{sub, add}_return()
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250302/202503020203.USVBw4Bn-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250302/202503020203.USVBw4Bn-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503020203.USVBw4Bn-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from include/linux/preempt.h:85,
from include/linux/alloc_tag.h:11,
from include/linux/percpu.h:5,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:7,
from arch/s390/kernel/asm-offsets.c:11:
arch/s390/include/asm/preempt.h: In function '__preempt_count_add_return':
>> arch/s390/include/asm/preempt.h:109:38: error: void value not ignored as it ought to be
109 | return val + __atomic_add_const(val, &get_lowcore()->preempt_count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:102: arch/s390/kernel/asm-offsets.s] Error 1
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1264: prepare0] Error 2
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:251: __sub-make] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:251: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +109 arch/s390/include/asm/preempt.h

100
101 static __always_inline int __preempt_count_add_return(int val)
102 {
103 /*
104 * With some obscure config options and CONFIG_PROFILE_ALL_BRANCHES
105 * enabled, gcc 12 fails to handle __builtin_constant_p().
106 */
107 if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES)) {
108 if (__builtin_constant_p(val) && (val >= -128) && (val <= 127)) {
> 109 return val + __atomic_add_const(val, &get_lowcore()->preempt_count);
110 }
111 }
112 return val + __atomic_add(val, &get_lowcore()->preempt_count);
113 }
114

--
0-DAY CI Kernel Test Service