[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKwvOdmNkMb35q=jNfpGSxtabaDSQStXtWHrnYaBizRq+GQ2XQ@mail.gmail.com>
Date: Thu, 15 Apr 2021 10:03:23 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: zhaoxiao <zhaoxiao@...ontech.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Arvind Sankar <nivedita@...m.mit.edu>, clin@...e.com,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Dan Williams <dan.j.williams@...el.com>,
Masahiro Yamada <masahiroy@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Joerg Roedel <jroedel@...e.de>,
Peter Zijlstra <peterz@...radead.org>,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE
On Thu, Apr 15, 2021 at 2:43 AM zhaoxiao <zhaoxiao@...ontech.com> 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 <zhaoxiao@...ontech.com>
> ---
> 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
Powered by blists - more mailing lists