Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5991572ybe; Tue, 10 Sep 2019 11:51:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2feIea2clKNLQstPkr/YM2SLNE30iXzmNPePdXOJvw8ktVTb2SdTkJ2JOAJS4j8a/NKJ7 X-Received: by 2002:a05:6402:2d0:: with SMTP id b16mr33542394edx.147.1568141483007; Tue, 10 Sep 2019 11:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141483; cv=none; d=google.com; s=arc-20160816; b=qLLZPoCyLCegiYB0vlg1MnqSwjhv4I3FiwEzjdaPTBrudU74vrYJqe2iu82JNTeA9a 0si2qrLekjOAfkl05IAxAZn9jYyteTL44w23nG9QaegkIHvPTFecjs5AqqeICK4LL1Rd Xcl79yMtLR8QvDDjm5cXmqrAOnRUrOPREZ60egDz4SjjKh02AfY0XtB7F+aSKuzbOMD7 Hw9ZP8hwQUutur6LKmRIXG3T0GA49iMl5QCmrr7WtNAV/b3h/O3QhM+0s5ZPwT1nobIx ndxy4SZe/WdNh65FM2NLykzoATN9lE5cgT849c5qNj56Jz5I94XzumeFnCzEIO38MHlX z1dA== 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; bh=GzXrmlpC/CWlmBBx+Mfgp2MIVT6wc9VgoKmM//l5WEM=; b=z954P6Ed8bNIFM7BfOTiPsUkyYVplOvRnr4O/Sli7IYJlqokt/okKrSg7NbXdNLJlq YOWhov82o2C9mwbfF3ERoLHdb3uBqaQ1k+Rzg3U1vIVZFsPDcgzOsRxY3vdNW2IY8jqx x6bPPB8Q6ufT6dwq/SH3R8b1kPE5/Zd931WjJ2uhO8/1J3jdcz+aTHC/CaNNuF9XD6cM fqIq/D6OXcZ9I9cDC9Wyt7JfGYM/0Bp5ELGhqIfTlTKTbFdcGv/28Yn26FF5/vYr29S/ exlffzaK7xC/v3o04av2md1ap8WiRcQkAe/Ea6Vmb4fRfxTqrrzkJcVEGfD9XT0rVxzP QerQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c51si11953943edc.317.2019.09.10.11.50.59; Tue, 10 Sep 2019 11:51:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731257AbfIJIEm (ORCPT + 99 others); Tue, 10 Sep 2019 04:04:42 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36376 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbfIJIEm (ORCPT ); Tue, 10 Sep 2019 04:04:42 -0400 Received: by mail-qk1-f194.google.com with SMTP id s18so16124085qkj.3 for ; Tue, 10 Sep 2019 01:04:41 -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=GzXrmlpC/CWlmBBx+Mfgp2MIVT6wc9VgoKmM//l5WEM=; b=O2i/8iPrx6RirMRyYTfSLLmRMpPyykF2PLIFngT6G7Ly/aVhqg7FLnv7aGaxaJCCAq +KSHE9TIi0bHtfBaEP6kN8RuH9AJDYO55G17H3JF6aJZcmClCq3UuhPhy7+OdrTjgh7Y DXQQDvIXLYaTGbvjmdnA90I9vxZT5U9gAdsY/9BSyzLIk3B9JctjcCjhIYRfLlsufR3i RtqRCmpaBXehI7lC/hOn6HIMh7SVIF2lKanbRf59DL8rZlRQt1aZhfcjmeEi0WjaDQvK 6OvZsrg3BIHaZjW9OBjNi90TNctfrzetDvvebnMgE2SAyywoHRFpM1Y9nGkscfljIU6x t7WA== X-Gm-Message-State: APjAAAXEZvmB0iZnxl68bLxazNAUttQW8UfS8exEkE+zmdr/iguJIdKq GkoecuNQKdimG3s2nN6ox+amb4ckqF1J7lGzwnk= X-Received: by 2002:ae9:ee06:: with SMTP id i6mr7346717qkg.3.1568102680809; Tue, 10 Sep 2019 01:04:40 -0700 (PDT) MIME-Version: 1.0 References: <20190909202153.144970-1-arnd@arndb.de> <20190910074606.45k5m2pkztlpj4nj@willie-the-truck> In-Reply-To: <20190910074606.45k5m2pkztlpj4nj@willie-the-truck> From: Arnd Bergmann Date: Tue, 10 Sep 2019 10:04:24 +0200 Message-ID: Subject: Re: [PATCH] arm64: fix unreachable code issue with cmpxchg To: Will Deacon Cc: Catalin Marinas , Andrew Murray , Mark Rutland , Linux ARM , "linux-kernel@vger.kernel.org" , clang-built-linux , Masahiro Yamada , Borislav Petkov , Ingo Molnar 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 Tue, Sep 10, 2019 at 9:46 AM Will Deacon wrote: > > On Mon, Sep 09, 2019 at 10:21:35PM +0200, Arnd Bergmann wrote: > > On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined > > when CONFIG_OPTIMIZE_INLINING is set. > > Hmm. Given that CONFIG_OPTIMIZE_INLINING has also been shown to break > assignment of local 'register' variables on GCC, perhaps we should just > disable that option for arm64 (at least) since we don't have any toolchains > that seem to like it very much! I'd certainly prefer that over playing > whack-a-mole with __always_inline. Right, but I can also see good reasons to keep going: - In theory, CONFIG_OPTIMIZE_INLINING is the right thing to do -- the compilers also make some particularly bad decisions around inlining when each inline turns into an __always_inline, as has been the case in Linux for a long time. I think in most cases, we get better object code with CONFIG_OPTIMIZE_INLINING and in the cases where this is worse, it may be better to fix the compiler. The new "asm_inline" macro should also help with that. - The x86 folks have apparently whacked most of the moles already, see this commit from 2008 commit 3f9b5cc018566ad9562df0648395649aebdbc5e0 Author: Ingo Molnar Date: Fri Jul 18 16:30:05 2008 +0200 x86: re-enable OPTIMIZE_INLINING re-enable OPTIMIZE_INLINING more widely. Jeff Dike fixed the remaining outstanding issue in this commit: | commit 4f81c5350b44bcc501ab6f8a089b16d064b4d2f6 | Author: Jeff Dike | Date: Mon Jul 7 13:36:56 2008 -0400 | | [UML] fix gcc ICEs and unresolved externs [...] | This patch reintroduces unit-at-a-time for gcc >= 4.0, bringing back the | possibility of Uli's crash. If that happens, we'll debug it. it's still default-off and thus opt-in. - The inlining decisions of gcc and clang are already very different, and the bugs we are finding around that are much more common than the difference between CONFIG_OPTIMIZE_INLINING=y/n on a given compiler. Arnd