Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3336442imu; Fri, 18 Jan 2019 08:40:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN59tidTpbsDlIEgyqPVnlolqPftvEdqh4prCBZ8VE0fOZZWtmWej18iWw2SR6IhLbdImdHV X-Received: by 2002:a62:a510:: with SMTP id v16mr19911668pfm.18.1547829646389; Fri, 18 Jan 2019 08:40:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547829646; cv=none; d=google.com; s=arc-20160816; b=KtbrlQx4EiQIHP1mAsfJe2ctnip0bC74XEXY6CIZd3Mm2zUUwWNEuwq0N6FdVNbZ8U 8GudMf4rby00TsXX9YUztH+5qZR9KyWDEitXwLqAPzGaMxHiHxzpakAxURxPZdiUgqO9 vVwbKYV5rfIRc7NHIIOlv3ciPvgr/LBm4msIdA9e24labXvdZGKsdavxGCXNWrkqD7bq D1CpTjOy45O4MISbeu7REPUsIR6ItFAdzBGDKyeE9co8xigyqPOkqchzsQ9mcGwj/W3M w9g9ufvcyXCZ5UzcqASHZnWq0W4aRxlEUOQpVqeQKaWJfE9diX3QyCbdVRDoMJwOvwCD a+2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:date:message-id:references :in-reply-to:subject:cc:to; bh=g6Qcr8U2mVQ9Y8n+9XW+rXHHbm+cMAZt12qd1ARL+tg=; b=U0roA3zGhN6b51dvTsIOWXk4jChz2oXVjirRRHNaEmmCjm5MXg9rnAEt8KpcpQ3hrL 2sDOMVHwqywFQ/qQWrP4SbVrqmhoqVm7+ulMicvsBj/tXCQ1E1VPgKIPjkmLTpUU3qNR 9PvpTxpx7DfOtuHuwl8kMV7dLJ4uXhV+QNyolrAbj90DD3lpm5hswp2W2uuk1ei4I6Vy wRCfI5w+VKMmeHBj0tohRDI50WhBIg8A5mLI0hd8RGVWN22G6rSYY8YLOZTMg3CJrkop 32DtPtxBXONVh9FHYHhCKBTRKknEwruWpNCaw6gN3Nzf1IpDu8d8KD61ycmATuDcfnAI GFBg== 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 t3si4780041plo.69.2019.01.18.08.40.28; Fri, 18 Jan 2019 08:40:46 -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 S1728081AbfARQjG (ORCPT + 99 others); Fri, 18 Jan 2019 11:39:06 -0500 Received: from verein.lst.de ([213.95.11.211]:44660 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727491AbfARQjF (ORCPT ); Fri, 18 Jan 2019 11:39:05 -0500 Received: by newverein.lst.de (Postfix, from userid 2005) id CD7BA68CEB; Fri, 18 Jan 2019 17:39:04 +0100 (CET) To: Mark Rutland , Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , Amit Daniel Kachhap Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: [PATCH v7 1/3] arm64: replace -pg with CC_FLAGS_FTRACE in Makefiles In-Reply-To: <20190118163736.6A99268CEB@newverein.lst.de> References: <20190118163736.6A99268CEB@newverein.lst.de> Message-Id: <20190118163904.CD7BA68CEB@newverein.lst.de> Date: Fri, 18 Jan 2019 17:39:04 +0100 (CET) From: duwe@lst.de (Torsten Duwe) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Torsten Duwe --- arch/arm64/kernel/Makefile | 6 +++--- drivers/firmware/efi/libstub/Makefile | 3 ++- 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) cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ -fno-builtin -fpic \