[peterz-queue:x86/wip.extable 21/23] arch/x86/include/asm/word-at-a-time.h:98:15: error: '__cold__' attribute only applies to functions

From: kernel test robot
Date: Tue Nov 09 2021 - 16:48:07 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/wip.extable
head: 3083969163ff9cd715077a33b045e439b92b70bf
commit: 6dbe299818d0da139c576c414c09bbf133c8a331 [21/23] x86,word-at-a-time: Remove .fixup usage
config: i386-buildonly-randconfig-r002-20211109 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f3798ad5fa845771846599f3c088016e3aef800c)
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
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=6dbe299818d0da139c576c414c09bbf133c8a331
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/wip.extable
git checkout 6dbe299818d0da139c576c414c09bbf133c8a331
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from lib/strnlen_user.c:8:
>> arch/x86/include/asm/word-at-a-time.h:98:15: error: '__cold__' attribute only applies to functions [-Werror,-Wignored-attributes]
do_exception: __cold;
^
include/linux/compiler_attributes.h:72:56: note: expanded from macro '__cold'
#define __cold __attribute__((__cold__))
^
1 error generated.


vim +/__cold__ +98 arch/x86/include/asm/word-at-a-time.h

81
82 static inline unsigned long load_unaligned_zeropad(const void *addr)
83 {
84 unsigned long offset, data;
85 unsigned long ret;
86
87 asm_volatile_goto(
88 "1: mov %[mem], %[ret]\n"
89
90 _ASM_EXTABLE(1b, %l[do_exception])
91
92 : [ret] "=r" (ret)
93 : [mem] "m" (*(unsigned long *)addr)
94 : : do_exception);
95
96 return ret;
97
> 98 do_exception: __cold;
99 offset = (unsigned long)addr & (sizeof(long) - 1);
100 addr = (void *)((unsigned long)addr & ~(sizeof(long) - 1));
101 data = *(unsigned long *)addr;
102 ret = data >> offset * 8;
103
104 return ret;
105 }
106

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip