[arm-platforms:arm64/binutils-cleanup 1/2] arch/arm64/include/asm/alternative-macros.h:228:2: error: expected absolute expression

kernel test robot lkp at intel.com
Mon Jun 9 03:13:30 PDT 2025


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git arm64/binutils-cleanup
head:   61189b46d4cae85952b67f48da9af226155e9dd7
commit: 08c6df2c373ba216ffc1d0b79c3e028adae5d2c4 [1/2] arm64: Remove .inst workarounds after binutils bump
config: arm64-randconfig-r053-20250609 (https://download.01.org/0day-ci/archive/20250609/202506091850.ZQDMasOg-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250609/202506091850.ZQDMasOg-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506091850.ZQDMasOg-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from <built-in>:4:
   In file included from lib/vdso/getrandom.c:8:
   In file included from include/vdso/datapage.h:197:
   In file included from arch/arm64/include/asm/vdso/gettimeofday.h:10:
   In file included from arch/arm64/include/asm/alternative.h:5:
>> arch/arm64/include/asm/alternative-macros.h:228:2: error: expected absolute expression
     228 |         ALTERNATIVE("b  %l[l_no]", "nop", %[cpucap])
         |         ^
   arch/arm64/include/asm/alternative-macros.h:214:2: note: expanded from macro 'ALTERNATIVE'
     214 |         _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
         |         ^
   arch/arm64/include/asm/alternative-macros.h:76:2: note: expanded from macro '_ALTERNATIVE_CFG'
      76 |         __ALTERNATIVE_CFG(oldinstr, newinstr, cpucap, IS_ENABLED(cfg))
         |         ^
   arch/arm64/include/asm/alternative-macros.h:56:9: note: expanded from macro '__ALTERNATIVE_CFG'
      56 |         "664:\n\t"                                                      \
         |                ^
   <inline asm>:16:6: note: instantiated into assembly here
      16 |         .if ((664b-663b) != (662b-661b))
         |             ^
   In file included from <built-in>:4:
   In file included from lib/vdso/getrandom.c:8:
   In file included from include/vdso/datapage.h:197:
   In file included from arch/arm64/include/asm/vdso/gettimeofday.h:10:
   In file included from arch/arm64/include/asm/alternative.h:5:
>> arch/arm64/include/asm/alternative-macros.h:228:2: error: Alternatives instruction length mismatch
     228 |         ALTERNATIVE("b  %l[l_no]", "nop", %[cpucap])
         |         ^
   arch/arm64/include/asm/alternative-macros.h:214:2: note: expanded from macro 'ALTERNATIVE'
     214 |         _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
         |         ^
   arch/arm64/include/asm/alternative-macros.h:76:2: note: expanded from macro '_ALTERNATIVE_CFG'
      76 |         __ALTERNATIVE_CFG(oldinstr, newinstr, cpucap, IS_ENABLED(cfg))
         |         ^
   arch/arm64/include/asm/alternative-macros.h:58:3: note: expanded from macro '__ALTERNATIVE_CFG'
      58 |         ".error \"Alternatives instruction length mismatch\"\n"         \
         |          ^
   <inline asm>:17:1: note: instantiated into assembly here
      17 | .error "Alternatives instruction length mismatch"
         | ^
   2 errors generated.
   In file included from <built-in>:4:
   In file included from lib/vdso/gettimeofday.c:5:
   In file included from include/vdso/datapage.h:197:
   In file included from arch/arm64/include/asm/vdso/gettimeofday.h:11:
>> arch/arm64/include/asm/arch_timer.h:204:15: error: expected absolute expression
     204 |         asm volatile(ALTERNATIVE("isb\n mrs %0, cntvct_el0",
         |                      ^
   arch/arm64/include/asm/alternative-macros.h:214:2: note: expanded from macro 'ALTERNATIVE'
     214 |         _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
         |         ^
   arch/arm64/include/asm/alternative-macros.h:76:2: note: expanded from macro '_ALTERNATIVE_CFG'
      76 |         __ALTERNATIVE_CFG(oldinstr, newinstr, cpucap, IS_ENABLED(cfg))
         |         ^
   arch/arm64/include/asm/alternative-macros.h:56:9: note: expanded from macro '__ALTERNATIVE_CFG'
      56 |         "664:\n\t"                                                      \
         |                ^
   <inline asm>:29:6: note: instantiated into assembly here
      29 |         .if ((664b-663b) != (662b-661b))
         |             ^
   In file included from <built-in>:4:
   In file included from lib/vdso/gettimeofday.c:5:
   In file included from include/vdso/datapage.h:197:
   In file included from arch/arm64/include/asm/vdso/gettimeofday.h:11:
>> arch/arm64/include/asm/arch_timer.h:204:15: error: Alternatives instruction length mismatch
     204 |         asm volatile(ALTERNATIVE("isb\n mrs %0, cntvct_el0",
         |                      ^
   arch/arm64/include/asm/alternative-macros.h:214:2: note: expanded from macro 'ALTERNATIVE'
     214 |         _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
         |         ^
   arch/arm64/include/asm/alternative-macros.h:76:2: note: expanded from macro '_ALTERNATIVE_CFG'
      76 |         __ALTERNATIVE_CFG(oldinstr, newinstr, cpucap, IS_ENABLED(cfg))
         |         ^
   arch/arm64/include/asm/alternative-macros.h:58:3: note: expanded from macro '__ALTERNATIVE_CFG'
      58 |         ".error \"Alternatives instruction length mismatch\"\n"         \
         |          ^
   <inline asm>:30:1: note: instantiated into assembly here
      30 | .error "Alternatives instruction length mismatch"
         | ^
   make[3]: *** [scripts/Makefile.build:203: arch/arm64/kernel/vdso/vgetrandom.o] Error 1
   In file included from <built-in>:4:
   In file included from lib/vdso/gettimeofday.c:5:
   In file included from include/vdso/datapage.h:197:
   In file included from arch/arm64/include/asm/vdso/gettimeofday.h:11:
>> arch/arm64/include/asm/arch_timer.h:204:15: error: expected absolute expression
     204 |         asm volatile(ALTERNATIVE("isb\n mrs %0, cntvct_el0",
         |                      ^
   arch/arm64/include/asm/alternative-macros.h:214:2: note: expanded from macro 'ALTERNATIVE'
     214 |         _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
         |         ^
   arch/arm64/include/asm/alternative-macros.h:76:2: note: expanded from macro '_ALTERNATIVE_CFG'
      76 |         __ALTERNATIVE_CFG(oldinstr, newinstr, cpucap, IS_ENABLED(cfg))
         |         ^
   arch/arm64/include/asm/alternative-macros.h:56:9: note: expanded from macro '__ALTERNATIVE_CFG'
      56 |         "664:\n\t"                                                      \
         |                ^
   <inline asm>:29:6: note: instantiated into assembly here
      29 |         .if ((664b-663b) != (662b-661b))
         |             ^
   In file included from <built-in>:4:
   In file included from lib/vdso/gettimeofday.c:5:
   In file included from include/vdso/datapage.h:197:
   In file included from arch/arm64/include/asm/vdso/gettimeofday.h:11:
>> arch/arm64/include/asm/arch_timer.h:204:15: error: Alternatives instruction length mismatch
     204 |         asm volatile(ALTERNATIVE("isb\n mrs %0, cntvct_el0",
         |                      ^
   arch/arm64/include/asm/alternative-macros.h:214:2: note: expanded from macro 'ALTERNATIVE'
     214 |         _ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
         |         ^
   arch/arm64/include/asm/alternative-macros.h:76:2: note: expanded from macro '_ALTERNATIVE_CFG'
      76 |         __ALTERNATIVE_CFG(oldinstr, newinstr, cpucap, IS_ENABLED(cfg))
         |         ^
   arch/arm64/include/asm/alternative-macros.h:58:3: note: expanded from macro '__ALTERNATIVE_CFG'
      58 |         ".error \"Alternatives instruction length mismatch\"\n"         \
         |          ^
   <inline asm>:30:1: note: instantiated into assembly here
      30 | .error "Alternatives instruction length mismatch"
         | ^
   4 errors generated.
   make[3]: *** [scripts/Makefile.build:203: arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
   make[3]: Target 'include/generated/vdso-offsets.h' not remade because of errors.
   make[3]: Target 'arch/arm64/kernel/vdso/vdso.so' not remade because of errors.
   make[2]: *** [arch/arm64/Makefile:203: vdso_prepare] Error 2
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:248: __sub-make] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:248: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +228 arch/arm64/include/asm/alternative-macros.h

21fb26bfb01ffe Mark Rutland   2022-09-12  219  
21fb26bfb01ffe Mark Rutland   2022-09-12  220  static __always_inline bool
5235c7e2cfccb5 Mark Rutland   2023-06-07  221  alternative_has_cap_likely(const unsigned long cpucap)
21fb26bfb01ffe Mark Rutland   2022-09-12  222  {
de66cb37ab6488 Mark Rutland   2023-10-16  223  	if (!cpucap_is_possible(cpucap))
de66cb37ab6488 Mark Rutland   2023-10-16  224  		return false;
21fb26bfb01ffe Mark Rutland   2022-09-12  225  
4356e9f841f7fb Linus Torvalds 2024-02-09  226  	asm goto(
2c2ca3416b4090 Mark Rutland   2024-09-03  227  #ifdef BUILD_VDSO
2c2ca3416b4090 Mark Rutland   2024-09-03 @228  	ALTERNATIVE("b	%l[l_no]", "nop", %[cpucap])
2c2ca3416b4090 Mark Rutland   2024-09-03  229  #else
5235c7e2cfccb5 Mark Rutland   2023-06-07  230  	ALTERNATIVE_CB("b	%l[l_no]", %[cpucap], alt_cb_patch_nops)
2c2ca3416b4090 Mark Rutland   2024-09-03  231  #endif
21fb26bfb01ffe Mark Rutland   2022-09-12  232  	:
5235c7e2cfccb5 Mark Rutland   2023-06-07  233  	: [cpucap] "i" (cpucap)
21fb26bfb01ffe Mark Rutland   2022-09-12  234  	:
21fb26bfb01ffe Mark Rutland   2022-09-12  235  	: l_no);
21fb26bfb01ffe Mark Rutland   2022-09-12  236  
21fb26bfb01ffe Mark Rutland   2022-09-12  237  	return true;
21fb26bfb01ffe Mark Rutland   2022-09-12  238  l_no:
21fb26bfb01ffe Mark Rutland   2022-09-12  239  	return false;
21fb26bfb01ffe Mark Rutland   2022-09-12  240  }
21fb26bfb01ffe Mark Rutland   2022-09-12  241  

:::::: The code at line 228 was first introduced by commit
:::::: 2c2ca3416b4090aef8c646adccfc3be4b712db8a arm64: alternative: make alternative_has_cap_likely() VDSO compatible

:::::: TO: Mark Rutland <mark.rutland at arm.com>
:::::: CC: Jason A. Donenfeld <Jason at zx2c4.com>

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



More information about the linux-arm-kernel mailing list