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
tune_serdes() falls through to next function apply_tx_lanes() in drivers/infiniband/hw/hfi1/platform.c #679
Comments
Where is |
@nickdesaulniers This is enabled in ours lld by default |
but you're also enabling So using your |
@nickdesaulniers Do you suggest to use ICF or gc-section not both at the same time ? |
Hmmm...I don't have the experience of maintaining a linux distro with a modified LLVM (AOSP LLVM has 1 out of tree patch at this point, which exports Clang's C++ API), but seeing so many changes makes me a little uncomfortable. In general, I appreciate you testing and reporting back your results. Another part of me thinks that it will be difficult to support something that's 99% llvm, but changes some defaults around.
I recommend not modifying the default behavior of the compiler; if these flags are a net win for projects, then add the flags explicitly to those projects' build files, rather than relying on implicit defaults changed within the compiler. Otherwise, it becomes harder for upstream developers to reproduce issues you may encounter, and support falls back on you. That said, I acknowledge how much work it would be to land such patches in each of the upstream codebases you distribute. Changing the compiler defaults is a quick win, but I'm not sure it's the ultimate long term solution. |
Should a distro-compiler-specific Label be added to categorize these? |
I'm going to stand by discouraging such "value adds." |
We will hit this again when [2] is upstream. From my build-log and local patches.series:
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/urgent Update: Shorter link in [3] (points to the same commit as in [2]) |
Re-Opened as Can someone confirm seeing the objtool-warning (again)? [1] https://git.kernel.org/linus/20bf2b378729c4a0366a53e2018a0b70ace94bcd |
shows no objtool warnings on v5.11-rc7. |
OK, thanks for the feedback. I tried with: --- a/drivers/infiniband/hw/hfi1/Makefile
+++ b/drivers/infiniband/hw/hfi1/Makefile
+CFLAGS_REMOVE_platform.o = -fcf-protection=none But that still shows:
Might be my linux-config (attached below) or one of my patches in my custom patchset (or used LLVM/Clang). |
My make-line: /usr/bin/perf_5.10 stat make V=1 -j4 LLVM=1 LLVM_IAS=1 PAHOLE=/opt/pahole/bin/pahole LOCALVERSION=-1-amd64-clang12-ias KBUILD_VERBOSE=1 KBUILD_BUILD_HOST=iniza KBUILD_BUILD_USER=sedat.dilek@gmail.com KBUILD_BUILD_TIMESTAMP=2021-02-07 bindeb-pkg KDEB_PKGVERSION=5.11.0~rc7-1~bullseye+dileks1 |
Uploaded gzip-ed |
Legit warning, maybe dead code or undefined behavior?
|
Just as a note: ( BTW, is "vanilla" politically correct? What if someone likes both [1] https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/log/?h=objtool/core |
I created a reduced test case: https://godbolt.org/z/s69rsK
Unfortunately, the output seems highly compiler specific and fragile, not sure if the output from godbolt.org has any problems. With "clang-11 -O2", I get no objtool warning. With "clang-12 -O2", I get platform.o: warning: objtool: tune_serdes()+0x30: can't find jump dest instruction at .text+0xdc" with clang-13 I get: platform.o: warning: objtool: n() falls through to next function tune_serdes() |
For reference, this is the clang-13 -O2 assembler output:
|
All my Linux Yesterday, I added I have archived all
If you want to inspect it - I can attach it here or send to you via email. NOTE: I disabled |
Oof, yes we can see there's: ...
# %bb.3:
...
jae .LBB1_7
# %bb.4:
jmp a # TAILCALL
.LBB1_5:
jmp k # TAILCALL
.LBB1_7: so a jump off the end of the function. Interestingly, I can add I see an @zmodem do you know what pass usually cleans up such default destinations of switch's that are unreachable? |
still reproducible in godbolt, reminiscent of #621 (comment). |
https://reviews.llvm.org/D109103 looks like it should fix the case reported by @arndb above, which looks reproduced from the same code as this bugs description. The issue is reminiscent of #621, but https://reviews.llvm.org/D109103 doesn't fix #621. They are closely related; LLVM has 3 techniques it uses during instruction selection to lower
This bug is about unreachable bit tests, while #621 seems to be about jump tables with entries to statically-proven unreachable blocks. |
Upload a test that shows ISEL taking a SwitchInst that has an unreachable BB for a default target being lowered to an unconditional jump off the end of a function. Link: https://bugs.llvm.org/show_bug.cgi?id=50080 Link: ClangBuiltLinux/linux#679 Link: ClangBuiltLinux/linux#1440 Reviewed By: craig.topper, hans Differential Revision: https://reviews.llvm.org/D109106
Upload a test that shows ISEL taking a SwitchInst that has an unreachable BB for a default target being lowered to an unconditional jump off the end of a function. Link: https://bugs.llvm.org/show_bug.cgi?id=50080 Link: ClangBuiltLinux/linux#679 Link: ClangBuiltLinux/linux#1440 Reviewed By: craig.topper, hans Differential Revision: https://reviews.llvm.org/D109106
…n is unreachable Otherwise we end up with an extra conditional jump, following by an unconditional jump off the end of a function. ie. bb.0: BT32rr .. JCC_1 %bb.4 ... bb.1: BT32rr .. JCC_1 %bb.2 ... JMP_1 %bb.3 bb.2: ... bb.3.unreachable: bb.4: ... Should be equivalent to: bb.0: BT32rr .. JCC_1 %bb.4 ... JMP_1 %bb.2 bb.1: bb.2: ... bb.3.unreachable: bb.4: ... This can occur since at the higher level IR (Instruction) SwitchInsts are required to have BBs for default destinations, even when it can be deduced that such BBs are unreachable. For most programs, this isn't an issue, just wasted instructions since the unreachable has been statically proven. The x86_64 Linux kernel when built with CONFIG_LTO_CLANG_THIN=y fails to boot though once D106056 is re-applied. D106056 makes it more likely that correlation-propagation (CVP) can deduce that the default case of SwitchInsts are unreachable. The x86_64 kernel uses a binary post processor called objtool, which emits this warning: vmlinux.o: warning: objtool: cfg80211_edmg_chandef_valid()+0x169: can't find jump dest instruction at .text.cfg80211_edmg_chandef_valid+0x17b I haven't debugged precisely why this causes a failure at boot time, but fixing this very obvious jump off the end of the function fixes the warning and boot problem. Link: https://bugs.llvm.org/show_bug.cgi?id=50080 Fixes: ClangBuiltLinux/linux#679 Fixes: ClangBuiltLinux/linux#1440 Reviewed By: hans Differential Revision: https://reviews.llvm.org/D109103
Building kernel 5.3.1 with LLVM/clang-9.0.0 on x86_64
The text was updated successfully, but these errors were encountered: