Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp928972ybt; Wed, 24 Jun 2020 15:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHJX70xY11uz/hnYiWm84Q2ZHR/ao/+5JgSCnLhOYod+cFt1vIPPysi5CR7obLg8hvRrMS X-Received: by 2002:a17:906:d93c:: with SMTP id rn28mr28708080ejb.190.1593036384076; Wed, 24 Jun 2020 15:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036384; cv=none; d=google.com; s=arc-20160816; b=CLUQ9ckJOqByOsKBU5o/qej0M2aCX4KSlhMX0H/8GrYaCYhMXGoSoW2xTT2Cz+5ZYi jlP7WKlu60TWy0exYgR4OtEeReY4Sydu+iKIAqdE/v4DkpiWouqkGDoZInhSKcByvI6r ZQbMB1tsNO5NVmiVecNmmcMkhJR2379SVbTJl8sHOALu7hcJK7w2BU2n3vAA7BxTOXc7 6wGfVB6949n9p+sD2yD3/0EI/SO7GcS56eZkRGhimIHi09Xr2kPmKn1uo8UXud4y6Jly 7vhhQn2U4QqJDNZFYjS7AtiNr1piN0oui3m7uRSgoe++1mjv2A45rThDrts+jqIDvDrs IJVw== 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=oeZYP2K14l8wy15C+mHJ7IGJGj+bMsdiaVhcvV254wo=; b=Vj21pGgJU8hV12bVtiN05e9ztEBS83cjgTvsYIuDtMEyB8skd8vOLyVz5uAQEmjue0 22KhaVbJ3UhkfwWSiY12uUHxRkSUVm9vXEn/xDYEMJ0TSWwH2EWSY4xlE72C7Quxmk1F 3GwX6nJO8BuJbHsNnIhRRnYrLHBDOgIz8tev0PLTQyaoWhosV/3nMH18GmBHZgcx9UCS MmDXXJK8qllAlNBAnKusQQId8z04DYiYlUm00jYdh/WuXDTsxUT0Hyhks7vsLxj9reYL 0EIZVGly/3pSXVBruNR256elayc8qsTtxJPps6OnWUMBh5X/HRYVR/gufsY4VGR+ep/l KKuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YLhBzo5t; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr10si16655723ejc.204.2020.06.24.15.06.01; Wed, 24 Jun 2020 15:06:24 -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=pass header.i=@google.com header.s=20161025 header.b=YLhBzo5t; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404012AbgFXVbt (ORCPT + 99 others); Wed, 24 Jun 2020 17:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404024AbgFXVbs (ORCPT ); Wed, 24 Jun 2020 17:31:48 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C119EC061796 for ; Wed, 24 Jun 2020 14:31:48 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id b7so2686970pju.0 for ; Wed, 24 Jun 2020 14:31:48 -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=oeZYP2K14l8wy15C+mHJ7IGJGj+bMsdiaVhcvV254wo=; b=YLhBzo5tLLnGs0t6TdhnFSz7LC+dIOGSdyR2PzbiJ5sbNeH/OqOlpGPE843RDUqPyB xcP72I6Wr3gEeg8vpHpVkU6u63LLrd63P+x1ZZGXfe69+AWJdANZ6EXt2a9Wp3ONoSX+ IYQFe9nK3k7itVIzd+Ql+LZ3lDH+ctkvhSsUBvpMOUjNf93JbToJ7w7Jl9+ej3WyaGi0 t64ZoJLPWNph8t4rfm6P3KDNWB+A/4Ny+h52bYBhzjkl8jF/deowywj6kuu84Svv0pXL Tt9UDtDNXClNBGQZGornTX62JX0NBkg8bcnSbq3QZ1eCahNDu3bRnftlUijmcZVfck9j lPdg== 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=oeZYP2K14l8wy15C+mHJ7IGJGj+bMsdiaVhcvV254wo=; b=i5f7lyYkp0KFYcVeAIxhbgDsOxBmL0+oo9bBIlEFKFBcxgoPYseowE1neDI4KDmFzm WSE5b0Tghbyii2BusiPndh9zo1FR+UlobPTzPVKyyrygi0eDyFvrtux2/qLHVBMX3vSx BY8Gr6c9+tqIj0zO1++a6hxuyurnOEarsmP78wn93vhFjMRzi0zOmjOo5JaXWCbK88Hz wlHWrrebLj+rH9wCIH+XQxd4IHA87yxeajkwQeUUROyn9XzoPwv7yKHJQ3v3R8N4Mhqw kqMf83XLOhCok/Lk1NGZriOlm5hoR2TTJEq0hIXlSBlYuV8DKOO+UBjW1IV0A/14P15Y 4DCQ== X-Gm-Message-State: AOAM533NZxYa7lNwm6BgVKp+adPMIwert3RNzTcB8Bo/eQA/oE+Avi8Q ObeRcq3ZWsvP8RSdiZuwkoVlkcu8m/+3sKUHLheokw== X-Received: by 2002:a17:90a:1e:: with SMTP id 30mr28248270pja.25.1593034308056; Wed, 24 Jun 2020 14:31:48 -0700 (PDT) MIME-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> <20200624211540.GS4817@hirez.programming.kicks-ass.net> In-Reply-To: <20200624211540.GS4817@hirez.programming.kicks-ass.net> From: Nick Desaulniers Date: Wed, 24 Jun 2020 14:31:36 -0700 Message-ID: Subject: Re: [PATCH 00/22] add support for Clang LTO To: Peter Zijlstra 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)" 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 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? -- Thanks, ~Nick Desaulniers