[gcc-4.4] Re: arch/x86/events/intel/uncore_snbep.o: warning: objtool: snbep_uncore_msr_enable_event()+0x2e: function has unreachable instruction

2016-07-20 Thread Fengguang Wu

On Thu, Jul 21, 2016 at 11:06:06AM +0800, Liang, Kan wrote:

Hi Fengguang,

I located the unreachable instruction which is ud2.

This instruction will raise invalid opcode exception. So I think
normally it should not be reached.  Also ud2 should be generated by
compiler, not our codes.


It's great to know that!


I have no idea how to fix it.
Have you met similar issue before?
Do you have any suggestions?


The warning shows up when we enabled gcc-4.4 for kernel build tests.
It emits this "function has unreachable instruction" warning for
~1 kernel functions all over the places.

So it must be a toolchain specific problem.
Let's CC LKML and gcc lists for possible solutions.


0e0f :
e0f:   55  push   %rbp
e10:   48 89 e5mov%rsp,%rbp
e13:   53  push   %rbx
e14:   83 be 80 01 00 00 ffcmpl   $0x,0x180(%rsi)
e1b:   48 89 f3mov%rsi,%rbx
e1e:   74 2b   je e4b 

e20:   31 f6   xor%esi,%esi
e22:   e8 00 00 00 00  callq  e27 

e27:   48 89 c2mov%rax,%rdx
e2a:   8b b3 78 01 00 00   mov0x178(%rbx),%esi
e30:   48 c1 ea 20 shr$0x20,%rdx
e34:   48 83 3d 00 00 00 00cmpq   $0x0,0x0(%rip)# e3c 

e3b:   00
e3c:   75 02   jnee40 

e3e:   0f 0b   ud2
e40:   89 f7   mov%esi,%edi
e42:   89 c6   mov%eax,%esi
e44:   ff 14 25 00 00 00 00callq  *0x0

Thanks,
Kan



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
head:   47ef4ad2684d380dd6d596140fb79395115c3950
commit: 3b94a891667c30fb4624221497d77fc65d950345
perf/x86/intel/uncore: Remove SBOX support for Broadwell server
date:   7 weeks ago
config: x86_64-randconfig-s0-07191857 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout 3b94a891667c30fb4624221497d77fc65d950345
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

>> arch/x86/events/intel/uncore_snbep.o: warning: objtool:
snbep_uncore_msr_enable_event()+0x2e: function has unreachable
instruction

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


[net-next:master 488/665] verifier.c:undefined reference to `__multi3'

2017-11-11 Thread Fengguang Wu
CC gcc list. According to Alexei:

 This is a known issue with gcc 7 on mips that is "optimizing"
 normal 64-bit multiply into 128-bit variant.
 Nothing to fix on the kernel side.

 Digging further, this function was added to
 arch/sparc/lib/multi3.S
 since gcc doing the same "optimization" there.
 Adding asm code doesn't look right to me. I'd rather push
 gcc folks to avoid such codegen.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
master
head:   7c5556decd0a629e9ee02e93653f75ba7b7da03c
commit: 638f5b90d46016372a8e3e0a434f199cc5e12b8c [488/665] bpf: reduce verifier 
memory consumption
config: mips-64r6el_defconfig (attached as .config)
compiler: mips64el-linux-gnuabi64-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
 wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
 chmod +x ~/bin/make.cross
 git checkout 638f5b90d46016372a8e3e0a434f199cc5e12b8c
 # save the attached .config to linux build tree
 make.cross ARCH=mips 

All errors (new ones prefixed by >>):

kernel/bpf/verifier.o: In function `realloc_verifier_state.isra.19':
>> verifier.c:(.text+0x36fc): undefined reference to `__multi3'
crypto/scompress.o: In function `.L82':
scompress.c:(.text+0x55c): undefined reference to `__multi3'
lib/mpi/generic_mpih-mul1.o: In function `.L2':
generic_mpih-mul1.c:(.text+0x60): undefined reference to `__multi3'
lib/mpi/generic_mpih-mul2.o: In function `.L2':
generic_mpih-mul2.c:(.text+0x5c): undefined reference to `__multi3'
lib/mpi/generic_mpih-mul3.o: In function `.L2':
generic_mpih-mul3.c:(.text+0x5c): undefined reference to `__multi3'
lib/mpi/mpih-div.o:mpih-div.c:(.text+0x1b8): more undefined references to 
`__multi3' follow

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
kbuild-all mailing list
kbuild-...@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild-all