[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUW5jNJY3L5EcxrtOttwpbdAWQ7=U_bZaLHcTogOdNuTcQ@mail.gmail.com>
Date: Fri, 19 Jul 2019 13:37:41 +0200
From: Sedat Dilek <sedat.dilek@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Josh Poimboeuf <jpoimboe@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <natechancellor@...il.com>,
clang-built-linux <clang-built-linux@...glegroups.com>,
x86@...nel.org
Subject: Re: x86 - clang / objtool status
On Thu, Jul 18, 2019 at 10:40 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> Folks,
>
> after picking up Josh's objtool updates I gave clang a test ride again.
>
> clan is built with https://github.com/ClangBuiltLinux/tc-build.git
>
> That's using the llvm master branch. top commit is:
>
> 0c99d19470b ("[OPENMP]Fix sharing of threadprivate variables with TLS support.")
>
> I merged
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/urgent
>
> into the tip of Linus tree to pick up the latest objtool changes.
>
> Here are the results for different configs:
>
> 1) defconfig
>
> objtool warnings:
>
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x88: redundant UACCESS disable
>
>
> 2) debian distro config
>
> objtool warnings:
>
> drivers/gpu/drm/amd/amdgpu/atom.o: warning: objtool: atom_op_move() falls through to next function atom_op_and()
> drivers/infiniband/hw/hfi1/platform.o: warning: objtool: tune_serdes() falls through to next function apply_tx_lanes()
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x86: redundant UACCESS disable
> drivers/gpu/drm/radeon/evergreen_cs.o: warning: objtool: evergreen_cs_parse() falls through to next function evergreen_dma_cs_parse()
>
> Build fails with:
>
> clang-10: error: unknown argument: '-mpreferred-stack-boundary=4'
> make[5]: *** [linux/scripts/Makefile.build:279: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_resource.o] Error 1
>
>
> 3) allmodconfig:
>
> objtool warnings:
>
> arch/x86/kernel/signal.o: warning: objtool: x32_setup_rt_frame()+0x255: call to memset() with UACCESS enabled
> arch/x86/kernel/signal.o: warning: objtool: __setup_rt_frame()+0x254: call to memset() with UACCESS enabled
> arch/x86/ia32/ia32_signal.o: warning: objtool: ia32_setup_rt_frame()+0x247: call to memset() with UACCESS enabled
>
> mm/kasan/common.o: warning: objtool: kasan_report()+0x52: call to __stack_chk_fail() with UACCESS enabled
> drivers/ata/sata_dwc_460ex.o: warning: objtool: sata_dwc_bmdma_start_by_tag()+0x3a0: can't find switch jump table
>
> lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch()+0x88: call to memset() with UACCESS enabled
> lib/ubsan.o: warning: objtool: ubsan_type_mismatch_common()+0x610: call to __stack_chk_fail() with UACCESS enabled
> lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch_v1()+0x88: call to memset() with UACCESS enabled
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x56: redundant UACCESS disable
>
> Build fails with:
>
> ERROR: "__compiletime_assert_2801" [drivers/net/wireless/intel/iwlwifi/iwlwifi.ko] undefined!
> ERROR: "__compiletime_assert_2446" [drivers/net/wireless/intel/iwlwifi/iwlwifi.ko] undefined!
> ERROR: "__compiletime_assert_2452" [drivers/net/wireless/intel/iwlwifi/iwlwifi.ko] undefined!
> ERROR: "__compiletime_assert_2790" [drivers/net/wireless/intel/iwlwifi/iwlwifi.ko] undefined!
>
> This also emits a boatload of warnings like this:
>
> linux/fs/nfs/dir.c:451:34: warning: variable 'wq' is uninitialized when used within its own initialization
> [-Wuninitialized]
> DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
> ^~
> linux/include/linux/wait.h:74:63: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD_ONSTACK'
> struct wait_queue_head name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)
> ~~~~ ^~~~
> linux/include/linux/wait.h:72:33: note: expanded from macro '__WAIT_QUEUE_HEAD_INIT_ONSTACK'
> ({ init_waitqueue_head(&name); name; })
>
> Thanks,
>
> tglx
>
Hi Thomas,
Thanks for the feedback.
The last days I tried several iterations of Josh's "v0", v1 and v2.
First of all I find out that it is possible to download and apply the
series (here: v2) from patchwork (see [1]).
I highly appreciate to have this in Josh's Git [2].
BTW, what is/was the base for the patchset?
I tried next-20190712 as this was the base in Josh's Git.
Later next-20190717 and next-20190718.
Please clarify.
With v2 applied on top of next-20190718 and an adapted/customized
kernel-config based on an official Debian/experimental 5.0.2 kernel I
fell over exactly the same 4 objtool warnings.
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.o: warning: objtool:
.altinstr_replacement+0x86: redundant UACCESS disable
drivers/gpu/drm/radeon/atom.o: warning: objtool: atom_op_move() falls
through to next function atom_op_and()
drivers/gpu/drm/radeon/evergreen_cs.o: warning: objtool:
evergreen_cs_parse() falls through to next function
evergreen_dma_cs_parse()
drivers/infiniband/hw/hfi1/platform.o: warning: objtool: tune_serdes()
falls through to next function apply_tx_lanes()
Kconfigs?
I highly appreciate to turn off AMDGPU if you do not need it.
Yes, I know all the patches mentioned in this thread as reading the
ClangBuiltLinux (CBL) mailing-list and following the CBL issue-tracker
(being a part of the project).
To get/attract more followers all these patches should be placed
somewhere (preferable Git) and/or be easily pickable.
Or at least a list or be tagged in patchwork.
I have no idea for an ideal patch-management in this topic.
I can boot into QEMU.
But on bare metal it looks like BPF and systemd-udevd/systemd-journald
do end in a maintenance mode.
I saved the dmesg-log.
Kernel-config, dmesg-log and systemd-log attached.
I have not tried with Debian/buster GCC v8 and/or dropping Josh's
objtool patchset.
I am building with a pre-release of Clang v9-pre and linking with LLD v9-pre.
As a recommendation:
apt.llvm.org offers binaries for Debian/buster.
I can send you my APT stuff if you like.
Regards,
- Sedat -
[0] https://lore.kernel.org/patchwork/project/lkml/list/?series=402470
[1] https://lore.kernel.org/patchwork/series/402470/mbox/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/log/?h=objtool-many-fixes
View attachment "dmesg_5.2.0-4-amd64-cbl-asmgoto.txt" of type "text/plain" (134984 bytes)
Download attachment "config-5.2.0-4-amd64-cbl-asmgoto" of type "application/octet-stream" (219492 bytes)
View attachment "systemctl-failed.txt" of type "text/plain" (1246 bytes)
Powered by blists - more mailing lists