From patchwork Wed May 16 14:14:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 10404055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 27EF360155 for ; Wed, 16 May 2018 14:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AB67288ED for ; Wed, 16 May 2018 14:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08FA7289A5; Wed, 16 May 2018 14:17:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 288F1289FD for ; Wed, 16 May 2018 14:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbeEPOPZ (ORCPT ); Wed, 16 May 2018 10:15:25 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:39289 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595AbeEPOPZ (ORCPT ); Wed, 16 May 2018 10:15:25 -0400 Received: by mail-pf0-f195.google.com with SMTP id a22-v6so425491pfn.6 for ; Wed, 16 May 2018 07:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=g/pYbuViNnp0SE7Hjw64GcuUQ5rV99c8aseSn7D5pDE=; b=HkUz7uR9EnjWrygmwvTpVjeLDvpnjQSjRA/llwj1Vr1Lu79bpUKSMVyOr9Rq4MABJf rvqEHOtveHm/9h1wwsqYwugBT+HGGzdrIe712tYqUTojjPBy4aMNPCJwLw2Uqb7bUZG5 nxHhsqDgPchQO1GzhjvzD4gc9oSjUJWmWRNwxWsiCEPppkSlB6aJoefXV/YQY3curon/ KJmG2YMXhYabLAcaoEpGDhMQ+5t2JhEZv17Ogi+Fa6HGW/ceQYaJshoz+y2zuwNRX0BK /rXdOJm3JW/C/UkANiucBSp9/p4wCik8n7h3z3XaQp3csqT3AlXKzpz36FB88gfMjvdC 2Z8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=g/pYbuViNnp0SE7Hjw64GcuUQ5rV99c8aseSn7D5pDE=; b=UrFgqZRe84jBPmfMRXzYKHY4+k/VrkMbV1SpRCVd+DTcY+AOPtB22dVuuyvNaaijE3 aqg/PX1DvD/lfTMA5vJXXxQfDTR5UVZQGELzlju8OBg2Dmikr8EDrGERKppr8vX9NGx3 uWauZIiDoPQmvBwa2edsHCY1HNSw7svfwj9qG5vvtSFkIJuzdeJOeb2laIO9fM50YpAm NcsL4ETseMRUWQrATd83VEFRa9VxMrY9+/7C1w79Da5eL9MC2jr1puhZ/dGojTDZPFW0 of0crJhZUyZ/V9ZGwTVm9e0msutfEMaNvx6aUiIPH6faPnmv90QVu5EFChgUWg0ijdOT gt4Q== X-Gm-Message-State: ALKqPwfNb4w5gxdkxL6XfVAx2RBnnMVkDxjEWYNj3+0D5v/fIvhZcsyG r3knzkU2nlpOlo4cN7w1+DUfNA== X-Google-Smtp-Source: AB8JxZo4Gq5BY5UpMqRLeF0XaFMHOT/tgM+H3n9GkSqdMi7KZI4unifAmOhOChBYS9QrwZx+luxC5g== X-Received: by 2002:a63:9a49:: with SMTP id e9-v6mr901463pgo.251.1526480124505; Wed, 16 May 2018 07:15:24 -0700 (PDT) Received: from roar.au.ibm.com (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id h130-v6sm7365162pfc.98.2018.05.16.07.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 07:15:23 -0700 (PDT) From: Nicholas Piggin To: linux-kbuild@vger.kernel.org Cc: Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, Masahiro Yamada , Segher Boessenkool Subject: [PATCH v4 4/4] powerpc/kbuild: move -mprofile-kernel check to Kconfig Date: Thu, 17 May 2018 00:14:58 +1000 Message-Id: <20180516141458.18996-5-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516141458.18996-1-npiggin@gmail.com> References: <20180516141458.18996-1-npiggin@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This eliminates the workaround that requires disabling -mprofile-kernel by default in Kconfig. [ Note: this depends on https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig-shell-v3 ] Signed-off-by: Nicholas Piggin --- Since v3: - Moved a stray hunk back to patch 3 where it belongs. arch/powerpc/Kconfig | 16 +--------------- arch/powerpc/Makefile | 14 ++------------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 512fcc177c87..af527f894f9b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -460,23 +460,9 @@ config LD_HEAD_STUB_CATCH If unsure, say "N". -config DISABLE_MPROFILE_KERNEL - bool "Disable use of mprofile-kernel for kernel tracing" - depends on PPC64 && CPU_LITTLE_ENDIAN - default y - help - Selecting this options disables use of the mprofile-kernel ABI for - kernel tracing. That will cause options such as live patching - (CONFIG_LIVEPATCH) which depend on CONFIG_DYNAMIC_FTRACE_WITH_REGS to - be disabled also. - - If you have a toolchain which supports mprofile-kernel, then you can - disable this. Otherwise leave it enabled. If you're not sure, say - "Y". - config MPROFILE_KERNEL depends on PPC64 && CPU_LITTLE_ENDIAN - def_bool !DISABLE_MPROFILE_KERNEL + def_bool $(success $(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__) config IOMMU_HELPER def_bool PPC64 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 6faf1d6ad9dd..8f7a64fe7370 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -161,18 +161,8 @@ CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 endif ifdef CONFIG_MPROFILE_KERNEL - ifeq ($(shell $(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__),OK) - CC_FLAGS_FTRACE := -pg -mprofile-kernel - KBUILD_CPPFLAGS += -DCC_USING_MPROFILE_KERNEL - else - # If the user asked for mprofile-kernel but the toolchain doesn't - # support it, emit a warning and deliberately break the build later - # with mprofile-kernel-not-supported. We would prefer to make this an - # error right here, but then the user would never be able to run - # oldconfig to change their configuration. - $(warning Compiler does not support mprofile-kernel, set CONFIG_DISABLE_MPROFILE_KERNEL) - CC_FLAGS_FTRACE := -mprofile-kernel-not-supported - endif + CC_FLAGS_FTRACE := -pg -mprofile-kernel + KBUILD_CPPFLAGS += -DCC_USING_MPROFILE_KERNEL endif CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)