[llvmlinux] Kernel clang patches rebased to master

Andrej Rode mail at andrejro.de
Wed Mar 1 06:34:34 UTC 2017


On Mon, Feb 27, 2017 at 12:54:05AM -0800, Andrej Rode wrote:
> Hi, 
> 
> this is a reply to [0]. Unfortunaly I wasn't subscribed at that time and
> can't reply properly. I rebased the patchset onto 4.10.0 but
> unfortunately I'm not able to boot the clang compiled kernel (though it compiles).
> Same config (and patches) with a gcc compiled kernel works. 


Looking at the log output I spotted these warnings:

arch/x86/kernel/cpu/mcheck/mce.c:2070:12: warning: 'break' is bound to
loop, GCC binds it to switch [-Wgcc-compat]
kernel/task_work.c:103:12: warning: 'break' is bound to current loop,
GCC binds it to the enclosing loop [-Wgcc-compat]
drivers/md/raid5.c:4414:3: warning: 'break' is bound to current loop,
GCC binds it to the enclosing loop [-Wgcc-compat]

From the looks these warnings lead to major breakage in the x86
implementation of cmpxchg since the while loops break out if cmpxchg
(__raw_cmpxchg)
evaluates a non-default value.
Looking at the implementation in arm64 the whole thing could be
implemented without a switch statement mitigating the issue.

But I'm not sure if this is an issue at all, but it seems like one.

Cheers,
Andrej
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20170228/ed3e322e/attachment.sig>


More information about the LLVMLinux mailing list