From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752171AbcF0U1M (ORCPT ); Mon, 27 Jun 2016 16:27:12 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:34646 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbcF0U1J (ORCPT ); Mon, 27 Jun 2016 16:27:09 -0400 MIME-Version: 1.0 Reply-To: sedat.dilek@gmail.com In-Reply-To: References: <063D6719AE5E284EB5DD2968C1650D6D41116CA6@AcuExch.aculab.com> From: Sedat Dilek Date: Mon, 27 Jun 2016 22:27:07 +0200 Message-ID: Subject: Re: [PATCH] usbhid: Fix lockdep unannotated irqs-off warning To: Linus Torvalds Cc: Alan Stern , David Laight , Jiri Kosina , Steven Rostedt , Tejun Heo , Lai Jiangshan , Benjamin Tissoires , Paul McKenney , Andy Lutomirski , LKML , USB list , Greg Kroah-Hartman , Peter Zijlstra , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2016 at 10:14 PM, Linus Torvalds wrote: > On Mon, Jun 27, 2016 at 12:50 PM, Sedat Dilek wrote: >> >> $ objdump -S clang-eflag.o >> >> clang-eflag.o: file format elf64-x86-64 >> >> >> Disassembly of section .text: >> >> 0000000000000000 : >> 0: 55 push %rbp >> 1: 48 89 e5 mov %rsp,%rbp >> 4: 53 push %rbx >> 5: 50 push %rax >> 6: e8 00 00 00 00 callq b >> b: ff 0d 00 00 00 00 decl 0x0(%rip) # 11 >> 11: 9c pushfq >> 12: 5b pop %rbx >> 13: e8 00 00 00 00 callq 18 >> 18: b8 01 00 00 00 mov $0x1,%eax >> 1d: 53 push %rbx >> 1e: 9d popfq >> 1f: 75 07 jne 28 > > > Yeah, the above is pure garbage. > >> So, the issue is still alive. >> >> What do you mean by "for the kernel we at a minimum need a way to >> disable that code generation"? >> Can this be fixed in the Linux-kernel? > > No. This will never be fixed in the kernel. It's a compiler bug. > > The compiler generates shit code. It's absolutely atrociously bad even > if you ignore any kernel issues, because that kind of code just > performs badly (the compiler should have used "setcc" or something > similar to just set the comparison value, not save and restore eflags. > > And quite frankly, any compiler writer that thinks it is good code is > not somebody I want touching a compiler that the kernel depends on > anyway. > > But it is not just bad code for the kernel, it's actively buggy code, > since it corrupts the IF. > > Until this gets fixed in LLVM, there's no way in hell that we will > ever have a kernel compiled with that piece of shit. > > Really. If the LLVM developers cannot fix their crap code generation, > it's not worth touching that shit with a ten-foot pole. > > I'd love to be able to compile the kernel with LLVM, but the fact that > the broken eflags code apparently _still_ hasn't been fixed makes me > just go "not worth it". > > And if the LLVM developers don't see this as an obvious bug, it's even > less worth it - because that shows not just that the compiler is > broken, but that the developers involved with it are broken too. > Thanks for the quick answer. I just grepped for some "buzzwords" people gave me in this email-thread and I was looking at (llvm.git HEAD - upcoming v3.9 release) and found these comments in [1] [ lib/Target/X86/X86InstrInfo.cpp ] void X86InstrInfo::copyPhysReg() ... // PUSHF/POPF is also potentially incorrect because it affects other flags // such as TF/IF/DF, which LLVM doesn't model. ... - Sedat - [1] https://github.com/llvm-mirror/llvm/blob/master/lib/Target/X86/X86InstrInfo.cpp#L4516