Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp947046pxb; Thu, 15 Apr 2021 10:05:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw34N9mogDzLzbVdvwzqtWpkD1f0ZZ1LKaUFdPA08PV2r9/Qav4QPNEkCAFRyJYPzRoEIOU X-Received: by 2002:a05:6402:31b2:: with SMTP id dj18mr5589529edb.104.1618506343993; Thu, 15 Apr 2021 10:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618506343; cv=none; d=google.com; s=arc-20160816; b=mNlhTJKX4By98sv2W5CEX1b1HAb3bda265JnA/EZwArHIRT6wIdHUvFjqYK81t4q4f vs0g/VBlGsN8mYsMt1BdJoeFlaP8RF/yClONB09J/bz0E/ViA+xLKheoKnl3UbL9HtD4 PGqRM7vsT7xuHHVlv5Fs6dFwYwNfcnq+4IUEMQmfOi8EI0mLHkP52RA6FjFKhRHOwFEj pp8H7e7gfxd+E4EzwjhbblYEcZJMmQ1xyxafc5gsHxF/e6RRt/2eJuSCc8hFZgQbkcHl Y3k9VynZzEYQbRJcpFecpk3tVBzaADJfPWwRSs+fyI94XtYWuuhcPk0LOFwN6+2VsWs1 Sprg== 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=U8nRxp9yxovE2rmz0BaOdHpuJsy82akPvndDf9QOMYI=; b=WOJPlAQID++W56q1UizP3kt4VyTNYeGquOH2bMgo7AcWR3nmZUFMp/kuizwIS2XJzs HInLWQkqPlrLEH3FC5ctCYz+G7Ug9tDFzNUs1OS4QUGSYLrR/Io1nYK/D8Mg5X6UxYH9 HAqMFpiw1xkZHV8wYvF6JfTQa65Bu/Nb5hV6iSUj+v6G88yuOEDKn18AwW4zC09DiMWv oh+NgT3xaIHPsX9ghr8k54WxWeiRDISAmy6miL14EZ+5TMng60noOvlIYoZsRZruIvVD JnIxGby46lu1g8fI+aG6jsu3I69wHuV2A9NOMpNmDfuYkRFogPzERndgelOikbAgD2WF /dOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="UJ/0rFU0"; 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 ds7si2646866ejc.214.2021.04.15.10.05.00; Thu, 15 Apr 2021 10:05:43 -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="UJ/0rFU0"; 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 S234374AbhDOREA (ORCPT + 99 others); Thu, 15 Apr 2021 13:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbhDORD7 (ORCPT ); Thu, 15 Apr 2021 13:03:59 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60DDDC061574 for ; Thu, 15 Apr 2021 10:03:36 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id z8so27889984ljm.12 for ; Thu, 15 Apr 2021 10:03:36 -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=U8nRxp9yxovE2rmz0BaOdHpuJsy82akPvndDf9QOMYI=; b=UJ/0rFU007c1xrSDt8rnZaY/C/1wRNIWX286uco8cqj/s1k0wTz/Ujh2svSH30FjaK XZxpO8u7ysEBnv0NcKQ6dpO+A7eotLNYjTXnUYy3V4XHhFL97q6dQrqErGkeVyLzoPyM evSWoRUKIrCVBH9EKNzM7YPyS/tfKFqIVyfQhe9TTbCJq4kpxktOhkBsUT6sa4veCcK0 Jkq3Hcp2rb1dcFf8JUBPOJaNKkW/wUMRirwse8u+dFV6BPCyyKZ87niieDLZDN/I6n7r uVFfDpxnHrlO8VrY6z0ZjHBAcVmB/EYs5p8a51hOiHFPmWy7s09RQUEGXYYLeGwLbEgk 5GYg== 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=U8nRxp9yxovE2rmz0BaOdHpuJsy82akPvndDf9QOMYI=; b=cTAzDY4wyuFiTsrrDEbaDKFLLQXk7v/6sZ4Y3YTiUNiC6K3niVCUgh1cR5XRfdJ28w ch7ISbbGkVRWl3dBT9RpADbFBAwmEbVAyZ+qj5/1oVShRPwT+PUYbm7ySMtR7ZGQL5tF XLWAckghsgz37KoF9anSTKVv8VoaLY6M4eT4TbA4gsMDnu5Xe1GUrbaV1DE5OHYR4ZZE VKn6kZrVxzfrOfs7wxemSrjaVR/R7/vr7HWhgP6S+NlLrVmAVCKk09savk2kNQCc2QYA o+8M8+D+/5/C2Dih8oM63l1hpnOwprCKz8TV5VuFTkP26uPeqnIvYP+ph5sz+Jt2LK+D iZeg== X-Gm-Message-State: AOAM532NBeQmieRYVZsGH/XWw+6Cs2Wnjen/CFPdGZh6RzWMuK/mVl0i 1jx8Ub3JE+b1EJMT/Te9gEyFP/y8IO1KHNRFeglbyA== X-Received: by 2002:a2e:968a:: with SMTP id q10mr121750lji.0.1618506214722; Thu, 15 Apr 2021 10:03:34 -0700 (PDT) MIME-Version: 1.0 References: <20210415094305.30964-1-zhaoxiao@uniontech.com> In-Reply-To: <20210415094305.30964-1-zhaoxiao@uniontech.com> From: Nick Desaulniers Date: Thu, 15 Apr 2021 10:03:23 -0700 Message-ID: Subject: Re: [PATCH] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE To: zhaoxiao Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Arvind Sankar , clin@suse.com, Andy Shevchenko , Dan Williams , Masahiro Yamada , LKML , Joerg Roedel , Peter Zijlstra , Josh Poimboeuf Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 2:43 AM zhaoxiao wrote: > > In preparation for x86 supporting ftrace built on other compiler > options, let's have the x86 Makefiles remove the $(CC_FLAGS_FTRACE) > flags, whatever these may be, rather than assuming '-pg'. > > There should be no functional change as a result of this patch. > > Signed-off-by: zhaoxiao > --- > arch/x86/kernel/Makefile | 16 ++++++++-------- > arch/x86/lib/Makefile | 2 +- I see additional CFLAGS_REMOVE_* = -pg in - arch/x86/mm/Makefile - arch/x86/kernel/cpu/Makefile - arch/x86/entry/vdso/Makefile - arch/x86/um/vdso/Makefile - arch/x86/xen/Makefile Would this same change be appropriate to all of the above? Seeing the additional possible values of CC_FLAGS_FTRACE (`-mrecord-mcount`, `-mnop-mcount`, `-mfentry`) makes we wonder if those are currently broken for these files as they are not removed, or if only `-pg` is problematic? Thank you for the patch. > 2 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile > index 2ddf08351f0b..2811fc6a17ba 100644 > --- a/arch/x86/kernel/Makefile > +++ b/arch/x86/kernel/Makefile > @@ -13,14 +13,14 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) > > ifdef CONFIG_FUNCTION_TRACER > # Do not profile debug and lowlevel utilities > -CFLAGS_REMOVE_tsc.o = -pg > -CFLAGS_REMOVE_paravirt-spinlocks.o = -pg > -CFLAGS_REMOVE_pvclock.o = -pg > -CFLAGS_REMOVE_kvmclock.o = -pg > -CFLAGS_REMOVE_ftrace.o = -pg > -CFLAGS_REMOVE_early_printk.o = -pg > -CFLAGS_REMOVE_head64.o = -pg > -CFLAGS_REMOVE_sev-es.o = -pg > +CFLAGS_REMOVE_tsc.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_paravirt-spinlocks.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_pvclock.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_kvmclock.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_early_printk.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_head64.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_sev-es.o = $(CC_FLAGS_FTRACE) > endif > > KASAN_SANITIZE_head$(BITS).o := n > diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile > index bad4dee4f0e4..0aa71b8a5bc1 100644 > --- a/arch/x86/lib/Makefile > +++ b/arch/x86/lib/Makefile > @@ -21,7 +21,7 @@ KASAN_SANITIZE_cmdline.o := n > KCSAN_SANITIZE_cmdline.o := n > > ifdef CONFIG_FUNCTION_TRACER > -CFLAGS_REMOVE_cmdline.o = -pg > +CFLAGS_REMOVE_cmdline.o = $(CC_FLAGS_FTRACE) > endif > > CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables > -- > 2.20.1 > > > -- Thanks, ~Nick Desaulniers