Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1246313ybt; Thu, 25 Jun 2020 01:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7OmAGn3TwfslYcX+dJbAwgeRwzCIQQq1wnGMOVEE4qf/CahJ+Qib3Y8l3mqmDrxSlcvBa X-Received: by 2002:a50:d942:: with SMTP id u2mr1794585edj.225.1593072259024; Thu, 25 Jun 2020 01:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593072259; cv=none; d=google.com; s=arc-20160816; b=mQYkEVv45BcIuVknnfkyi374s1+/dH62F63bN2OkOqSSLWlGF3Y7TwbsEuIUBRqrjN C4wMojf2PA7RuOPIx8rtVwLQz4WxJS9FCgl/Xn3AhEC5ZZdDEIU4oRK70Lq8r8UK0PzB B8Q8l7jhJX/M8BiKfxHPXE7cbyRdd5a76NQkLvb+3Bql1AuvckiEUpvH1uy2dVHTJJk7 xuK74DKxHIoCrYgo9qaYKKAsxIsge5jC9YcQGXB8qhNB3u03N+hv9QHW2WGVCjqukRTQ 2ysssA64rmHcWjB1ceoVE0kgB/5tWR0ndFo3Z9GpDsIKxhyPKRqDEGYKVbx2DnVCrunS SFxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=my2nyr72K0k6RU4vPxhUnXlcUiYtUEccfUZzce3A2lM=; b=hgY0hUM+ZSQNjp06hmBmNoIO7j9+Pj4Hl2fDT2X13e3UJOGueMgc9VKmr1eVtNSae6 BTV6PN1q+wqkZ7VJvWdEdxYna4dp6a0L2dDFkPNdWD72XxR5HS3EC7ubEDFNVhbzD4y/ SOzE+dyj6FlsIBDyaIMAt/DOi8O8/SXhB3UVr9ZvyxYTnadOzypjyUVZItHwpBtv1zPy tmNy7/ZtRykHlvBSF+qziV5zwfvpxbGxAdPFu7SYHuhz4OEmLVEObdAeUWfYjjvOXmnX mbOw0TR/FdsSB+F35Q5s164nSnK+ZwmsZd9bKPbUE7f9XJHWOO7AT/EBzzMTn4xLXCE+ rXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=l8HijPFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si9618677ejx.754.2020.06.25.01.03.55; Thu, 25 Jun 2020 01:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=l8HijPFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390570AbgFYIDi (ORCPT + 99 others); Thu, 25 Jun 2020 04:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390541AbgFYIDf (ORCPT ); Thu, 25 Jun 2020 04:03:35 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8919CC061573; Thu, 25 Jun 2020 01:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=my2nyr72K0k6RU4vPxhUnXlcUiYtUEccfUZzce3A2lM=; b=l8HijPFnSmJUFCeni2RH/BQsZe SnS630V1vrOlnRI9CR2NaPH7G8xEf4ItWfpBvRelAM1d7JadZJCP3hR0LlFKEMoKIvGB1Pg7HYubD UjWa22xRXDLOnavbddcY1g6vFeOysV2xmfgTY8uyd62WHfVvdtFlWJ4WMfGK3Tug9H2OtE2WBu37N 95uOyyKiEtOw7bja05pbOa8xZr65GH8Co4P28TvPd4iUEao0XgpglQW/eHF3oV/3Gziu9L1fNssv9 Mz7XkfB3L/F6/nE6O4FC22lkjZerK3ekIcrdAeVoAK3FljwuYUDMfy57zByz2uok1SMMYfX69hxsi SbH5pV8g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1joMqo-0002O9-K3; Thu, 25 Jun 2020 08:03:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 672C43003E5; Thu, 25 Jun 2020 10:03:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5304C22B8EBE8; Thu, 25 Jun 2020 10:03:13 +0200 (CEST) Date: Thu, 25 Jun 2020 10:03:13 +0200 From: Peter Zijlstra To: Nick Desaulniers Cc: Sami Tolvanen , Masahiro Yamada , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , clang-built-linux , Kernel Hardening , linux-arch , Linux ARM , Linux Kbuild mailing list , LKML , linux-pci@vger.kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH 00/22] add support for Clang LTO Message-ID: <20200625080313.GY4817@hirez.programming.kicks-ass.net> References: <20200624203200.78870-1-samitolvanen@google.com> <20200624211540.GS4817@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 02:31:36PM -0700, Nick Desaulniers wrote: > On Wed, Jun 24, 2020 at 2:15 PM Peter Zijlstra wrote: > > > > On Wed, Jun 24, 2020 at 01:31:38PM -0700, Sami Tolvanen wrote: > > > This patch series adds support for building x86_64 and arm64 kernels > > > with Clang's Link Time Optimization (LTO). > > > > > > In addition to performance, the primary motivation for LTO is to allow > > > Clang's Control-Flow Integrity (CFI) to be used in the kernel. Google's > > > Pixel devices have shipped with LTO+CFI kernels since 2018. > > > > > > Most of the patches are build system changes for handling LLVM bitcode, > > > which Clang produces with LTO instead of ELF object files, postponing > > > ELF processing until a later stage, and ensuring initcall ordering. > > > > > > Note that first objtool patch in the series is already in linux-next, > > > but as it's needed with LTO, I'm including it also here to make testing > > > easier. > > > > I'm very sad that yet again, memory ordering isn't addressed. LTO vastly > > increases the range of the optimizer to wreck things. > > Hi Peter, could you expand on the issue for the folks on the thread? > I'm happy to try to hack something up in LLVM if we check that X does > or does not happen; maybe we can even come up with some concrete test > cases that can be added to LLVM's codebase? I'm sure Will will respond, but the basic issue is the trainwreck C11 made of dependent loads. Anyway, here's a link to the last time this came up: https://lore.kernel.org/linux-arm-kernel/20171116174830.GX3624@linux.vnet.ibm.com/