From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 390E1C3A5A7 for ; Wed, 4 Sep 2019 11:54:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17CBD22CF5 for ; Wed, 4 Sep 2019 11:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729804AbfIDLyI (ORCPT ); Wed, 4 Sep 2019 07:54:08 -0400 Received: from mail-oi1-f174.google.com ([209.85.167.174]:38532 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfIDLyH (ORCPT ); Wed, 4 Sep 2019 07:54:07 -0400 Received: by mail-oi1-f174.google.com with SMTP id 7so7402187oip.5 for ; Wed, 04 Sep 2019 04:54:07 -0700 (PDT) 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=T69bo+UrOlt2glBHGVe76qsO1FE/ClOTc1fP/qn3ly4=; b=W3ap7cN9ijp/DkBSlnKcYR6YPGQF1UeiamznjEyKcPhlnz3WWsIuadKeEzWUbetwB8 SrElHTCgQ6b5XbPmFOMYPN7T/Wia3nazVs+2X/fPTVW7QSFx+WznPjBjUL+Q7lXiLrmd cPQAO+s5kyICH5JHj96AqkPDy6WStjjXCJIRxfpsBa1WNEEEM/1ldKgmX/98n9DQARbW g5tta/DsMJacUt1pqkshVSIUsMDmM3K5ynitGA9vYw6507A+axhu3/ebBr8jkgAG8ej3 W//uelN+Q8MPcCzw1UzWqF270eiAARQp42zHEwjk3HSC8Do3RA8uKkatEIHb5z9K8Zfp 1edA== X-Gm-Message-State: APjAAAUPXfR4b6p9nPKTJFPYfpFoJ9E5rbFLpRXQB4OcJGVwrOunJkxD eUiziFKNTcBxvTNMbtOvw3ULOIwhaP324DRfREQ= X-Google-Smtp-Source: APXvYqwmRo6Essn/dIx2ugiIINngyVTsRr8G0kgxKgSD/D0rdmTTJq3MCnTl1RvAdyabnhGii94Sh7c+PeENUo3O4mI= X-Received: by 2002:aca:f305:: with SMTP id r5mr2841597oih.131.1567598046606; Wed, 04 Sep 2019 04:54:06 -0700 (PDT) MIME-Version: 1.0 References: <20190827145102.p7lmkpytf3mngxbj@treble> <20190827192255.wbyn732llzckmqmq@treble> <20190828152226.r6pl64ij5kol6d4p@treble> <20190829173458.skttfjlulbiz5s25@treble> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 4 Sep 2019 13:53:55 +0200 Message-ID: Subject: Re: objtool warning "uses BP as a scratch register" with clang-9 To: Linus Torvalds Cc: Josh Poimboeuf , Arnd Bergmann , Nick Desaulniers , Ilie Halip , Linux Kernel Mailing List , clang-built-linux , Peter Zijlstra , "Paul E. McKenney" 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 Hi Linus, On Thu, Aug 29, 2019 at 8:31 PM Linus Torvalds wrote: > On Thu, Aug 29, 2019 at 10:35 AM Josh Poimboeuf wrote: > > > > Peter suggested to try WRITE_ONCE for the two zero writes to see if that > > "fixes" it. > > I'm sure it "fixes" it. > > .. and then where else will we hit this? > > It's one thing to turn a structure zeroing into "memset()", but some > places really can't do it. > > We use "-ffreestanding" in some places to make sure that gcc doesn't > start calling random libc routines. I wonder if we need to make it a > general rule that it's done unconditionally. > > Sadly, I think that ends up also disabling things like > "__builtin_memcpy()" and friends. Which we _do_ want to have access > to, because then gcc can inline the memcpy() when we _do_ use > memcpy(). > > We used to do all of those heuristics by hand, but wanted to let the > compiler do them for us. > > So: > > - we do want "memcpy()" to become "__builtin_memcpy()" which can then > be optimized to either individual inlined assignments _or_ to an > out-of-line call to memcpy(). You can do #define memcpy(d, s, n) __builtin_memcpy(d, s, n) Alpha, m68k, sparc, and x86 already do. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds