Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3384673imu; Fri, 18 Jan 2019 09:27:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN4m4x4WXBS4MY1akbsPLwEumowozXF0LMbJgnIWCgQQyBz6VzwgZYfr4AhvUliQMcG0qKpH X-Received: by 2002:a17:902:6e0f:: with SMTP id u15mr19760890plk.175.1547832458140; Fri, 18 Jan 2019 09:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547832458; cv=none; d=google.com; s=arc-20160816; b=kN+ro2EGhhW8OD2wbLtBOrm+WAMwyiwAo3R7Akkjg1Nj5tfGTl+/OK3ZQPmTpS7g3I ZAsqIa/LnpBcfGpqW629qWN3fHaRQdhD/rmHJ+LW/sFjVHon6IHnqKxnK/AFFJ8+t08S 0SW634gG4ODGgMB1P4Y/bddlFKTJZoAh5mCMbWyFF0jDY+ylL/seo8tXzuh8j0PQuI0M IrOxr1ik3uK6d/0QjxWWp6MfL00de+hkwA+Es7/JRGIqs7qix3oZE4olec09ibLI6ONJ CnyuYAef6OJIgKOaUU9dS+jaxRIXJL91ruhVPybb1nTdBHWtGljMNQRoawl0j+dW4sdB 1S8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NRYoYGgXK5gDhDBf4YoZt1/j1iQgSVlv/uhUZNFRiQg=; b=P2KlA08/0CvTLEo0+BVckI+G74B8MZFI2f+E1za5qdHYxqUTIkqN7xGdudky0Gt3TR g9YpKkckmqY/SBnAWNS1PlB2gipVufOA1weE/fRk9qfxZJ7gQjctNTl9gagmObAyAeRl 8zqL9YAMR6f55ytkSuDO6tHYMp0ANIw9MhfGykC3MFmNOCSMhJSuL7UR9Uk7eachNupc SmmUbYpExUIlbBRHZ9XBvV/nY2q4TRxqhn2cLjxn9AU7CGpcIQ0oQjTdbtW22WGlcAYn dbinNcwAUaSHO+YKtoU78H/XlLMSjBVW5gmEN+ZyhgLgZSKTJyPBlo7gNAyuMJpr5h/y jIJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si5262400pgl.108.2019.01.18.09.27.21; Fri, 18 Jan 2019 09:27:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728320AbfARRZC (ORCPT + 99 others); Fri, 18 Jan 2019 12:25:02 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35284 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727553AbfARRZB (ORCPT ); Fri, 18 Jan 2019 12:25:01 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0E78980D; Fri, 18 Jan 2019 09:25:01 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A744D3F7BE; Fri, 18 Jan 2019 09:24:58 -0800 (PST) Date: Fri, 18 Jan 2019 17:24:56 +0000 From: Mark Rutland To: Torsten Duwe Cc: Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , Amit Daniel Kachhap , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v7 1/3] arm64: replace -pg with CC_FLAGS_FTRACE in Makefiles Message-ID: <20190118172455.GF12256@lakrids.cambridge.arm.com> References: <20190118163736.6A99268CEB@newverein.lst.de> <20190118163904.CD7BA68CEB@newverein.lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190118163904.CD7BA68CEB@newverein.lst.de> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Torsten, On Fri, Jan 18, 2019 at 05:39:04PM +0100, Torsten Duwe wrote: > Ftrace instrumentation might also be introduced by > -fpatchable-function-entry, not only -pg. Ensure the Makefiles are > flexible to filter out the respective flags in "notrace" directories. I think this is a cleanup regardless of whether we use -fpatchable-function-entry. Can we please give this a more complete description, e.g. | Currently arm64 makefiles assume that ftrace will use '-pg', and remove | this flag specifically, rather than the contents of $(CC_FLAGS_FTRACE). | | In preparation for arm64 supporting ftrace built on other compiler | options, let's have the arm64 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: Torsten Duwe > > --- > arch/arm64/kernel/Makefile | 6 +++--- > drivers/firmware/efi/libstub/Makefile | 3 ++- This misses arch/arm64/lib/Makefile and mm/kasan/makefile. Could we please split this into three patches, addressing: * arm64 * efistub * kasan ... since those have distinct maintainers. All those patches can be part of this series, but having them as separate patches is a bit nicer for review. > 2 files changed, 5 insertions(+), 4 deletions(-) > --- a/arch/arm64/kernel/Makefile > +++ b/arch/arm64/kernel/Makefile > @@ -7,9 +7,9 @@ CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$( > AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) > CFLAGS_armv8_deprecated.o := -I$(src) > > -CFLAGS_REMOVE_ftrace.o = -pg > -CFLAGS_REMOVE_insn.o = -pg > -CFLAGS_REMOVE_return_address.o = -pg > +CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_insn.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE) > > # Object file lists. > obj-y := debug-monitors.o entry.o irq.o fpsimd.o \ > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -16,7 +16,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__K > > # arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly > # disable the stackleak plugin > -cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \ > +cflags-$(CONFIG_ARM64) := $(filter-out $(CC_FLAGS_FTRACE)\ > + ,$(KBUILD_CFLAGS)) -fpie \ > $(DISABLE_STACKLEAK_PLUGIN) Why do we need to swtich to using filter-out. AFAICT, subst works just fine. To keepthis legible, it would be nicer to split it like: cflags-$(CONFIG_ARM64) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \ -fpie $(DISABLE_STACKLEAK_PLUGIN) > cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ > -fno-builtin -fpic \ Please clean up this instance too, at least for consistency. Thanks, Mark.