Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2153539ybh; Fri, 17 Jul 2020 10:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvXE5U9ezwz1PzpWbZ3vHNAsCa627WoOl1mjlsnVTixgRhNKfXXqAs54Xz1UDhr3nQZNAD X-Received: by 2002:a50:acc5:: with SMTP id x63mr9888019edc.99.1595007073250; Fri, 17 Jul 2020 10:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595007073; cv=none; d=google.com; s=arc-20160816; b=N5NPYanS+YyHDAbIfWfBJc2Xh/iLqii1Fu/Ws0UfHwYGK+0MwTEQV8FSWv8zTA5z2A scV/tTTaMO8IE9bAtTpELK44og0gfF3vF6waxGXudD8M7JXSPwNgNWRzxeDuxReZHRS9 jYKcucx5vtTLeJJO0h92H2o7ru4qVn+K/l+COxsXNIpFXra3wdg9CO2YDmvncxWSMLIQ 3enSA0+x+V/tG35u+80kPuZOk8JNRqBTdrpgaOjSRE2YM5hvdD8AHNk86zDHRjYclxp4 VUuiN36lqWqOrfMW01+m6CM3710MBPJ+osmwJIZdnu8s3KR3akH1IibEXz1BJ/3iXSlD Xcog== 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=7JTqB5slGWNqmPcHQg0gX2jPDhSmZshqLrbRwDwrvQQ=; b=m5g0rNqvNl2aSDHm7aLxaw/UqDO4dczOLRF2XwDp6mJNxwkOpHf99JzFJ86e9Bmf8p 74QrQE7qr0C5Bt0Rohg5wJljOGrM/KEF/b5EUmp8+d2baDDmF5VUs7gbpcDxjWtGDjiN uVq9KdAZWdl/dbGzGFLvElCI000Fi1YfR88DLodAexWgXG+KCrFc2LNToGX0rLZ2FNkJ Dxc0y8OnfPG9r4XWKal/kTuryhERoX4XJ7Z6Q0Fzh55oJnMVHBPBLiWhrwL7JHLRvae4 XkhMUraiE9oMXXLSDMeDIACUOSYi4a06i7LiMtXw3SZvSaSZfae3THk74ipetAwpk1YL 7Pcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qkRGYkOM; 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 y19si5414349ejw.454.2020.07.17.10.30.49; Fri, 17 Jul 2020 10:31:13 -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=qkRGYkOM; 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 S1726944AbgGQR21 (ORCPT + 99 others); Fri, 17 Jul 2020 13:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbgGQR20 (ORCPT ); Fri, 17 Jul 2020 13:28:26 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38571C0619D2 for ; Fri, 17 Jul 2020 10:28:26 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id ga4so11665367ejb.11 for ; Fri, 17 Jul 2020 10:28:26 -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=7JTqB5slGWNqmPcHQg0gX2jPDhSmZshqLrbRwDwrvQQ=; b=qkRGYkOMW6VaoakdKRVaH5aUrXdmDg5t9er9/Vce66oxkl7UQqyWYOlRwXYeCpY3wW oGZLkqSMQcsYzJrQM1bl4jbPOH2ds+18vciyXIQPsIh7FHOEiWMHb+FbQPOAzmUtYx0d jAFb5ZBiJf1OgEZsVfnTqp9/tGZUXdX3DMpkRciQc7dzdFZjMmS+H+DJQfvlr/CrsaXE bH5rENTcwdmpjUlk5dB0JCsW5u+aaktYFW19sQYPYsWpe/3Pe/7RQhyb4jz0/LEW2lX3 sL4OLuZO05Zi99C6TpMJZ+BigM//cBFejkcKoMvjeBR4jPKuIlKROtzMLgdkDvKya0hC pOsw== 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=7JTqB5slGWNqmPcHQg0gX2jPDhSmZshqLrbRwDwrvQQ=; b=MV6HI8bil1N6Rz2Q1VTmEPrdWHfwsDfYnw05Dalhpuw2uT9fw2RNb5zXSRMtLjfX/g 3Qm67pfJVb/alf/n10EYEnmvd4c60fQR41tejdo4ZSYgXBlcL91NUFVMIh4drK55tgR0 dQwP1TdURYkmoEGbOm0+qYJyO/JzVjg81oVznX5w+tfjHA+hXY2nlqHHefhKoUupTprv IGcRgFMDWcqmgDWft517E3O+nVBrDiwnUN2Fq7rXCaeu9tWw1NH50nfcymkvdNYpiT3J 7Zjqr/aNgIs75RHgle+t591N6bG6D5IBX6z98KkXYFQ3TvJh4LmNKuv6J8O23NoNW+cS 5k4A== X-Gm-Message-State: AOAM530xXhqDXVEKP+UEPBrF6mE6h5VD+SkQWtJ92ZQljqTb8MH067uY 6x6QBGL5zopaU0qMooYJxzICijmLi1D0Lz4z3DdC8A== X-Received: by 2002:a17:906:eb93:: with SMTP id mh19mr9298900ejb.552.1595006904583; Fri, 17 Jul 2020 10:28:24 -0700 (PDT) MIME-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-5-samitolvanen@google.com> <20200624212737.GV4817@hirez.programming.kicks-ass.net> <20200624214530.GA120457@google.com> <20200625074530.GW4817@hirez.programming.kicks-ass.net> <20200625161503.GB173089@google.com> <20200625200235.GQ4781@hirez.programming.kicks-ass.net> <20200625224042.GA169781@google.com> <20200626112931.GF4817@hirez.programming.kicks-ass.net> In-Reply-To: <20200626112931.GF4817@hirez.programming.kicks-ass.net> From: Sami Tolvanen Date: Fri, 17 Jul 2020 10:28:13 -0700 Message-ID: Subject: Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool To: Steven Rostedt , Peter Zijlstra Cc: Masahiro Yamada , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux , Kernel Hardening , linux-arch , linux-arm-kernel , linux-kbuild , LKML , linux-pci@vger.kernel.org, X86 ML , Josh Poimboeuf , Matt Helsley 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 Fri, Jun 26, 2020 at 4:29 AM Peter Zijlstra wrote: > > On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > > > Not boot tested, but it generates the required sections and they look > > > more or less as expected, ymmv. > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > > index a291823f3f26..189575c12434 100644 > > > --- a/arch/x86/Kconfig > > > +++ b/arch/x86/Kconfig > > > @@ -174,7 +174,6 @@ config X86 > > > select HAVE_EXIT_THREAD > > > select HAVE_FAST_GUP > > > select HAVE_FENTRY if X86_64 || DYNAMIC_FTRACE > > > - select HAVE_FTRACE_MCOUNT_RECORD > > > select HAVE_FUNCTION_GRAPH_TRACER > > > select HAVE_FUNCTION_TRACER > > > select HAVE_GCC_PLUGINS > > > > This breaks DYNAMIC_FTRACE according to kernel/trace/ftrace.c: > > > > #ifndef CONFIG_FTRACE_MCOUNT_RECORD > > # error Dynamic ftrace depends on MCOUNT_RECORD > > #endif > > > > And the build errors after that seem to confirm this. It looks like we might > > need another flag to skip recordmcount. > > Hurm, Steve, how you want to do that? Steven, did you have any thoughts about this? Moving recordmcount to an objtool pass that knows about call sites feels like a much cleaner solution than annotating kernel code to avoid unwanted relocations. Sami