Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp93742pxu; Wed, 2 Dec 2020 16:05:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMbK5SjfyIHYxXZZmiD9cCUi1zI7wsuILE7yyjDO7gOCbfqByIXjRnk/CwwWVKMAdqPieD X-Received: by 2002:a17:906:60c4:: with SMTP id f4mr261927ejk.336.1606953930640; Wed, 02 Dec 2020 16:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606953930; cv=none; d=google.com; s=arc-20160816; b=jiJRvZo3dsaBiSfpGnD8JTnM74TeIiKo2ad/4nbTO6jwTP88AY8SHVPHYZSsrngWsE 7Lqv2k0DhsJFyFnBbLIA8aMZfYdI99pE1tza9GZg2odvgfQmR/AiH94kSAgNJ2MgXuaY Y/9ONkvbLmCHAqlGQP8b07pIAqzqwE6FfC6Q+WkTSJ/PDvy6fUPkwR9sNtKqvzWJ+40t JXhBiEk2qovtr+/nGYYG5sQ2EAC5o7TnPVOeZUCM2ACJXNgoaEUDRtCgxMMiosW0TyPj JWWFTC2uRJPtrnpzRLtV0tCrPj/7Ewh4PsVs7mU4kIrFtd1cd046WErzw8ODmfLfZupk bXVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TfjgZXZpIq5fZzABqVm3ochfUst+vG1roSThKbX3esM=; b=K9ss7A0QKhTBKbXu5efTjfssp5BWZ1+wbbJNfAZitCzDGPhRf+0FQ5oOV27pdyc4zH JbVvVad+r/+jEUWHQMQ/3xh5opFaQRygr68QegJPcIkji1EIubQK+uaafccTBGAabAi9 TV/JsOr6K0Kgbl3BK2DqhCAiRRhSkdAC9ac62cyogtAkl6mDhB/2qkc9ArjPbHstlLps FixvNdGIyJw3iMbkVhDlPnvM8nfIWJorWSCcfFqvDIyiqWt6XtbQtKLWjk2cjg8dh95s BwuUCVawJt2GeoeBXEZlTUnetNyYJhdOiB24DQHVsDIRa9jSmR35z7XnrOL4hzOf4eFH qcpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aKU+Elxn; 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 z16si208561edi.476.2020.12.02.16.05.07; Wed, 02 Dec 2020 16:05:30 -0800 (PST) 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=aKU+Elxn; 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 S1727156AbgLCACN (ORCPT + 99 others); Wed, 2 Dec 2020 19:02:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbgLCACM (ORCPT ); Wed, 2 Dec 2020 19:02:12 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BFAC0617A6 for ; Wed, 2 Dec 2020 16:01:32 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id n10so268663pgv.8 for ; Wed, 02 Dec 2020 16:01:32 -0800 (PST) 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=TfjgZXZpIq5fZzABqVm3ochfUst+vG1roSThKbX3esM=; b=aKU+Elxn2oMCSfhsrlmIncnG+eVufUmT2zZGZTURg6obiMVmWLv2CQrsZALP8JHr6v 80wrfU2Kj3rw9JzGE1+ad3sYmQZQVz6coBP/qWBA1CluJ2fZQ9zFZ4l6/vlEm63POXgw PoXOTvefcAuxzcoYa6jNF36cSIGxuqPsczhvBBhEyt1it/5x6Z9UoRq1nyzo8Q/oPO6y 8tFie1CBzkzTNDEZnK/uXLIeFNGsuWQZQvA6FlTiEpIBKkZpLzj9c+okfN8BIcEDQF66 yCFvYhAsRmLuryGfPwmqK9NiVqvG5a5hjCVx77mxrjmWl+oxa/bmaXsQ2vt2BC7OXv3G fQ2w== 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=TfjgZXZpIq5fZzABqVm3ochfUst+vG1roSThKbX3esM=; b=rFVDFyu9aX1oflLAYwuDG9GTUqDFPUe6OcljFxuve7OEbsIrZS89dK6GIdTxJSYdBV FWdduyRj/MqHnaW4N13yx+6NkvuIjagGgni0n0QdLiuqJoH3JVdit5f8RTrQFAH3uw4x qfjZjH6WKqncvs15Vy1iLdNh4R+8m0AVFp5UzS4836wPKMJKngZluTRLHSkgvdPj34sH 0PftWuRS/2M9GHmFy+R+tSHEEXwS8AHTgA3JVGi7Vyy6l+QL0/i59h0dOUgaN4d+BmXo RGTK17vVFlVbpIm66uAoLjwud+FBiEQL+eR4yV8BbkarTki+AEA/1H+bTDGwrJZ6uEUp /3dA== X-Gm-Message-State: AOAM531pY2pe/hAoxxZwf9W9/jpi+BvH1JqRZfqGeFmTMt0MLqGgOgVn bphLSbiAsUvkSfPbvKAdL7tck3CvisDwpc7zLXaN2w== X-Received: by 2002:a62:7905:0:b029:197:f300:5a2a with SMTP id u5-20020a6279050000b0290197f3005a2amr614586pfc.30.1606953691833; Wed, 02 Dec 2020 16:01:31 -0800 (PST) MIME-Version: 1.0 References: <20201201213707.541432-1-samitolvanen@google.com> In-Reply-To: <20201201213707.541432-1-samitolvanen@google.com> From: Nick Desaulniers Date: Wed, 2 Dec 2020 16:01:20 -0800 Message-ID: Subject: Re: [PATCH v8 00/16] Add support for Clang LTO To: Sami Tolvanen Cc: Masahiro Yamada , Steven Rostedt , Will Deacon , Josh Poimboeuf , Peter Zijlstra , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , clang-built-linux , Kernel Hardening , linux-arch , Linux ARM , Linux Kbuild mailing list , LKML , PCI Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 1:37 PM Sami Tolvanen wrote: > > This patch series adds support for building the kernel 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 has shipped millions of Pixel > devices running three major kernel versions with LTO+CFI 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 arm64 support depends on Will's memory ordering patches > [1]. I will post x86_64 patches separately after we have fixed the > remaining objtool warnings [2][3]. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=for-next/lto > [2] https://lore.kernel.org/lkml/20201120040424.a3wctajzft4ufoiw@treble/ > [3] https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/log/?h=objtool-vmlinux > > You can also pull this series from > > https://github.com/samitolvanen/linux.git lto-v8 > > --- > Changes in v8: > > - Cleaned up the LTO Kconfig options based on suggestions from > Nick and Kees. Thanks Sami, for the series: Tested-by: Nick Desaulniers (build and boot tested under emulation with https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=for-next/lto additionally rebased on top). As with v7, if the series changes drastically for v9, please consider dropping my tested by tag for the individual patches that change and I will help re-test them. -- Thanks, ~Nick Desaulniers