Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6058997yba; Thu, 11 Apr 2019 11:09:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC/RaiXcsUROO3AGunqiRSpOJeagN1BofHGrKJ6OpFp6ncWfyeN2uCFLEX6HrC9DgKSDV0 X-Received: by 2002:a63:6942:: with SMTP id e63mr49003340pgc.102.1555006178329; Thu, 11 Apr 2019 11:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555006178; cv=none; d=google.com; s=arc-20160816; b=NrHpP+yPc1Sx2nE1IUOU/L+asV567ttm2KpwP4n2H4fgSclFdt1YpSR0L7/8EZ9EBa Rd6AIxOEbgYAnoFimFMQHN2mH4gosOW8TvcTgu7+kOV0pXm1/mhsXj/96oF8xzH0sexY FeL0AY8hhJYuxwoYUum1t4TWnD+b1zOaFfuQX1hWMCW93nXdcaFuaSbyuYoxgsG+oz62 VTZTPJaUWoJ2M7zTIp/uQRqmpUOkmhs1V/OY09OLNYQRkuiwkcxE0U4VaTbVDy3X9+Ak DFBEGkbiDLcShuPYf1zCX/bfFAh8Wn2qg1+BHul4WQvh4db6Zf6oHd+vUNFECu9Otibi JNzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=D05VH0QEJsgcKa0zmQSeC39KlYyMQ70bI+B4qTcFcS4=; b=LfPTg3pSxFA3dbHFGKEY4hOQXpd6JvGb2bebxfdN7lHqvSvHgCHiv7wPoDYPeF7Kss 6dmyBulQvjascakY0QC6LQVcj0MYW2jh1XYM5BhkZR9lbzCGjAKDluB3foz4qiJm7DmM cyAUpBp/2gzu43wEtanW6YrQOp2vdqnVoldwNMSCMmhjIzHriqbCaQAQC4T8eyteDgEN bz37a5/TyZJ3ZcURucb0zkoPeajM1aoUhpq5xGByAWZGa9TtwO5wIIGzzMRjXd29rgO+ OlgvlY2imryTQo/VB/RdN8rr7FWQUCWdl5kplgGOwPP/XyFG0N71O0jUyDMVCyVd/xAJ JTOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bFGRuUsJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si1988673pfk.277.2019.04.11.11.09.21; Thu, 11 Apr 2019 11:09:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bFGRuUsJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726667AbfDKSIp (ORCPT + 99 others); Thu, 11 Apr 2019 14:08:45 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41816 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfDKSIp (ORCPT ); Thu, 11 Apr 2019 14:08:45 -0400 Received: by mail-pg1-f193.google.com with SMTP id f6so3879968pgs.8 for ; Thu, 11 Apr 2019 11:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D05VH0QEJsgcKa0zmQSeC39KlYyMQ70bI+B4qTcFcS4=; b=bFGRuUsJGAlQ/5urNzaXss8NHPejzmBjovyIp2O4eNzPBe6LT7qWaM/84YVsFe50o5 TO8+bk0uKLyq8r73C+sksnABLw2uprmzKI63ib3HjkBkmuOzOAvxScJDVT0QguKlRm9b Wn6t0QODx6xy7e99PWt5xnh3BFAu8+cZ730em5aUlNVI3jtf5PxCyRg0ynKKEW0/qi7i HTfoYwD7/bbrHNahqv9A7o9wqKAGsie90nvEuQbPvboEe7eDViHu3rGvrzfBhX0iWmDE yLPZfAoxk/VOijkOJsrJ+BZC9v/WRd5NeLQ0fTMSaPRNvSkVBZGm1+lLUJjO+QCvlDra tvjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D05VH0QEJsgcKa0zmQSeC39KlYyMQ70bI+B4qTcFcS4=; b=kuC2B0sf/xIe2Z6gZDIkWAR65c6KOJfvdSxQ4oBr9uXL0ybhZswcgZzd0u9rE1jtaS xMYXsk8C5fPzLxaG2b1S4orHrPnkSOT+MkPh/hpfPI3NXFgRtWlUE30ib3kKq3pW91Eq o5+71UBmSb9TrkwOXOXJ/QPnHgcZIv7QMKaE4qU5iw0njkqdp0ikAFThgprdRJJAsW2b J4rfnpmy4+jz+G7+BI65vAZ70TBarnl2LXFvaqq450xxlKI012Na9AuzzQ1nGzY3moUb +oQFv0JmDsK7ugXmx/IuPEQKKPuiBaoSWRcGGH+OdmjXzRCDE42ewiOtrkSnG0Zx9Ki4 Hrzw== X-Gm-Message-State: APjAAAW1GEw6x/u5AGf7etFtPWfQyD8CeATEiczUf9mbfRuWCRURTW4G FVXAX3xnFRmhoI0FHT8qPbPcKc4VhQlUZqqrAD2iSQ== X-Received: by 2002:a62:14d7:: with SMTP id 206mr50332231pfu.162.1555006123190; Thu, 11 Apr 2019 11:08:43 -0700 (PDT) MIME-Version: 1.0 References: <20190410201300.3528984-1-arnd@arndb.de> <20190410201300.3528984-2-arnd@arndb.de> In-Reply-To: From: Nick Desaulniers Date: Thu, 11 Apr 2019 11:08:31 -0700 Message-ID: Subject: Re: [PATCH 2/2] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed To: Arnd Bergmann Cc: Martin Schwidefsky , Heiko Carstens , clang-built-linux@googlegroups.com, Nathan Chancellor , linux-s390 , Vasily Gorbik , Masahiro Yamada , Philipp Rudo , Hendrik Brueckner , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 11, 2019 at 1:52 AM Arnd Bergmann wrote: > > On Thu, Apr 11, 2019 at 12:14 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > On Wed, Apr 10, 2019 at 1:13 PM Arnd Bergmann wrote: > > > > > > The purgatory and boot Makefiles do not inherit the original cflags, > > > so clang falls back to the default target architecture when building it, > > > typically this would be x86 when cross-compiling. > > > > > > Add $(CLANG_FLAGS) everywhere so we pass the correct --target=s390x-linux > > > option when cross-compiling. > > > > > > Signed-off-by: Arnd Bergmann > > > --- > > > arch/s390/Makefile | 5 +++-- > > > arch/s390/purgatory/Makefile | 1 + > > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/arch/s390/Makefile b/arch/s390/Makefile > > > index 9c079a506325..443990791099 100644 > > > --- a/arch/s390/Makefile > > > +++ b/arch/s390/Makefile > > > @@ -17,12 +17,13 @@ KBUILD_CFLAGS_MODULE += -fPIC > > > KBUILD_AFLAGS += -m64 > > > KBUILD_CFLAGS += -m64 > > > aflags_dwarf := -Wa,-gdwarf-2 > > > -KBUILD_AFLAGS_DECOMPRESSOR := -m64 -D__ASSEMBLY__ > > > +KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__ > > > KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) > > > -KBUILD_CFLAGS_DECOMPRESSOR := -m64 -O2 > > > +KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 > > > KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY > > > KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float > > > KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables > > > > Thanks for the respin with Nathan's suggestion. > > > > > +KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning,pointer-sign) > > > > What's up with this ^ ? Seems like the top level sets it (without > > cc-disable-warning :( ), but then KBUILD_CFLAGS_DECOMPRESSOR discards > > it. Does Clang actually flag code in this arch (that GCC doesn't)? > > Oops, that should have been a separate patch. > > I think what happens is that clang warns more aggressively about pointer sign > bugs than gcc in some cases, and some of those cases happen in s390 > header files that are included by both the kernel and the decompressor. > > The full warning log without this change is rather long, see > https://pastebin.com/KG9xaTNB From this link, it looks like the definitions of: __atomic64_or __atomic64_and __atomic64_xor and their *_barrier variants are problematic. I think converting those to use unsigned long is the way to go. Shouldn't you be doing bitwise ops on unsigned types anyways? The warnings with __atomic64_add are tougher to read/understand since at that point the log lines look like they start to mix together. > > I also tried patching the code to avoid the warnings, but I'm not entirely > happy with that result either, see > https://pastebin.com/pSMz5eZA That's no terrible, IMO, particularly with the change I suggest above. -- Thanks, ~Nick Desaulniers