Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various objtool warnings, then segfault (-march=piledriver) #30

Closed
dymn opened this issue Jan 24, 2018 · 17 comments
Closed

Various objtool warnings, then segfault (-march=piledriver) #30

dymn opened this issue Jan 24, 2018 · 17 comments

Comments

@dymn
Copy link

dymn commented Jan 24, 2018

These started with 4.14.9, but kernel have successfully built. Here are the first ones:

arch/x86/events/amd/uncore.o: warning: objtool: amd_uncore_cpu_starting()+0x9b: can't find jump dest instruction at .text+0x125
arch/x86/events/core.o: warning: objtool: x86_pmu_hw_config()+0x13: can't find jump dest instruction at .text+0x1495
kernel/fork.o: warning: objtool: account_kernel_stack()+0xd4: sibling call from callable instruction with modified stack frame
kernel/fork.o: warning: objtool: sysctl_max_threads()+0xee: stack state mismatch: cfa1=7+104 cfa2=7+96
arch/x86/entry/vdso/vma.o: warning: objtool: vgetcpu_cpu_init()+0x9e: return with modified stack frame
arch/x86/events/amd/ibs.o: warning: objtool: perf_ibs_init()+0x6a: stack state mismatch: cfa1=7+8 cfa2=7+0
...

While building kernel 4.14.14 and 4.14.15 I got with segfault (CONFIG_MPILEDRIVER=y, AMD FX-8320E):
...
mm/.tmp_memory.o: warning: objtool: print_bad_pte()+0x9c: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: wp_page_copy()+0x3a6: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: __follow_pte_pmd.isra.10()+0x296: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: _vm_normal_page()+0x2a: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: unmap_page_range()+0xf8: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: finish_mkwrite_fault()+0xc7: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: do_wp_page()+0xd2: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: alloc_set_pte()+0x38e: return with modified stack frame
/bin/sh: line 1: 23359 Segfault ./tools/objtool/objtool check "mm/.tmp_memory.o"
make[1]: *** [scripts/Makefile.build:321: mm/memory.o] Error 139
make: *** [Makefile:1028: mm] Error 2

But with "Generic-x86-64" I have successfully built kernel 4.14.15.

@graysky2
Copy link
Owner

graysky2 commented Jan 24, 2018

Hmmm... I don't have access to that chip to further debug.

@dymn
Copy link
Author

dymn commented Jan 24, 2018

Additional info there:
https://bugs.gentoo.org/642924

@AndyLavr
Copy link

@dymn
Copy link
Author

dymn commented Jan 24, 2018

This patch did not help.

https://patchwork.kernel.org/patch/10144853/

@AndyLavr
Copy link

gcc version?

@dymn
Copy link
Author

dymn commented Jan 24, 2018

sys-devel/gcc-6.4.0-r1

@AndyLavr
Copy link

AndyLavr commented Jan 24, 2018

gcc 7.2 and 7.2.1 build fine

[ 0.000000] microcode: microcode updated early to revision 0x1b, date = 2017-11-17
[ 0.000000] Linux version 4.15.0-041500rc9-lowlatency (root@GT80-2QE) (gcc version 7.2.1 20180122 (GCC)) #201801220830 SMP PREEMPT Wed Jan 24 10:13:18 EET 2018

@dymn
Copy link
Author

dymn commented Jan 24, 2018

gcc-6.4.0 is in stable tree in gentoo.

@graysky2
Copy link
Owner

Does gentoo offer a 7.2 ebuild?

@dymn
Copy link
Author

dymn commented Jan 24, 2018

Yes, in unstable tree. But 6.4 -> 7.2 = rebuild all world. It is overhead.

@jelinekto
Copy link

jelinekto commented Feb 8, 2018

On FX-6300 the same thing happens with 4.15.2 and GCC 7.3.0.

@graysky2
Copy link
Owner

graysky2 commented Feb 8, 2018

I can tell you that I am unable to build with the piledriver option (building on an intel chip) but I can build all the other subarchs. I am not knowledgeable enough to know why piledriver is currently failing.

@dymn
Copy link
Author

dymn commented Feb 8, 2018

What do we need to do to find out?
Is there a problem with kernel or patch code?

Selecting CONFIG_MBULLDOZER instead of CONFIG_PILEDRIVER solves this bug: https://bugs.gentoo.org/642924#c21

@graysky2 graysky2 changed the title Various objtool warnings, then segfault (-march=native) Various objtool warnings, then segfault (-march=piledriver) Feb 10, 2018
@mfp20
Copy link

mfp20 commented Mar 7, 2018

Same issue here (piledriver, FX-8310). System is Arch. Kernel vanilla 4.15.7 + graysky + UKSM + ck1.

# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc-multilib/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.2.0 (GCC) 

Many objs build with

warning: objtool: xxxxxx: can't find jump dest instruction at yyyyyyyy
warning: objtool: xxxxxx: return with modified stack frame

Probably some workarounds are here. In particular seems like some CONFIG_x can shut off those warnings. But I didn't try yet; still building the first run.

Edit: it builds and runs. At least in my case it's just a cosmetic issue.

@graysky2
Copy link
Owner

Edit: it builds and runs. At least in my case it's just a cosmetic issue.

OK, so safe to close as not-a-bug?

@mfp20
Copy link

mfp20 commented Mar 10, 2018

@graysky2
I'm experiencing issues on suspend but it could be anything (ex: one of the other patches, the new AMDGPU DC driver, and so on); I don't know anything about objtool, and I didn't have time to study and investigate further. Can't tell you anything I've already written. Sorry :(

@graysky2
Copy link
Owner

OK... closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants