Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7006860rwi; Mon, 24 Oct 2022 08:42:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uc/qfszvs/4eNSr2N0gI/lI4m2g65fh9qvPE9Maa+nblMYJGsT61OzlGVIvl2ZyFUdmnu X-Received: by 2002:a17:90b:1c11:b0:213:2253:fa7a with SMTP id oc17-20020a17090b1c1100b002132253fa7amr3519081pjb.111.1666626129991; Mon, 24 Oct 2022 08:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666626129; cv=none; d=google.com; s=arc-20160816; b=LS8WEkbI5dLqhGtAR2NJySEZUiugagy7+ky9RmKlUSRC7w1tyMyyCuhFtwRLHCI1iE kQw1fqFHZLZaupwy8bLjpj98C3dqq2l9A7ON/SBxqJr7cjJUpq6XvQz0rxWFlnUCVzbz 3vMiLrnNEpktUVOssHwxl1W+1BbFo5C1DKmTLxQZESN4jEMNq/gQK2SsX0uPZKcMxK+2 sI1Ad2qv2D2b+TEpWwb88RvRbeWFlxu/DBdsqWtfn8M6I1p0SAg5O8Kn1vLrsj/ACO4B 7RhQKF4x5Jak2D2EuX7YhfkiYXKX7K5i6nP9XEPYV80zN6nkvJ+aDCQ+zXZ7pl8ygXQS IVYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zMJ9388d2IaUr+hpTsCIhH1Vd2J7lKXFcc4WwyY1P+4=; b=avfVjFBldXb8xxhDPZuETZkm5khLSv67dDfoRKLOzsaAbUNRenL+1bZKExZnlIJBGz BH3rNfbNe72zPQT8K/6KQsCH6PEkiGCF77riacKUVcwgYDG8Epybx8Nr+T2t+G+xjugP V9BlpzurZIwNaVN//In3P+WwwCFp9OGHGq+mvxBtK5ymmtoC1m7UkMj9WfT3hEHC2Znz 6Sf42N/0XEKR93nAib1spKQv8sFfq26ghCYFpGwdxNtMdmB1DLAhc+kKl/9E/BzFacmn qJtf38Vkg/KpJLQoAjr5itENd9MgVaoAx8n7hz4IH8SxW6hah9hMlyxlaE58Vg9/0oDI gm2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hGFSsT7B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020a63190d000000b0043c3f90f7c8si9847929pgl.655.2022.10.24.08.41.57; Mon, 24 Oct 2022 08:42:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hGFSsT7B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbiJXPXo (ORCPT + 99 others); Mon, 24 Oct 2022 11:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232164AbiJXPXQ (ORCPT ); Mon, 24 Oct 2022 11:23:16 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19DB718F92E; Mon, 24 Oct 2022 07:08:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D0366CE131C; Mon, 24 Oct 2022 11:39:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEB19C433C1; Mon, 24 Oct 2022 11:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611586; bh=NmoR6ZF8800yShyuHDROXNDRW2u/lpmaLXLmZLvhgAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hGFSsT7BZAltatXegTlT9wDwApoGjDhZE1tR8eX1sPWTVGjAej1C7jUyTtq+yXuJJ St5ucSf+9LTtjUR8p52HqYsAlx0XTcbBNgNDIVVIkXwYTvwfVp6hPjIFub8Mkkidzk ku1tPoQ1FBRbPCgigikVTNTg1IjuAUBifEkzOths= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Russell King , Sebastian Andrzej Siewior , Danilo Cezar Zanella Subject: [PATCH 4.9 017/159] ARM: fix function graph tracer and unwinder dependencies Date: Mon, 24 Oct 2022 13:29:31 +0200 Message-Id: <20221024112949.987222185@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King commit 503621628b32782a07b2318e4112bd4372aa3401 upstream. Naresh Kamboju recently reported that the function-graph tracer crashes on ARM. The function-graph tracer assumes that the kernel is built with frame pointers. We explicitly disabled the function-graph tracer when building Thumb2, since the Thumb2 ABI doesn't have frame pointers. We recently changed the way the unwinder method was selected, which seems to have made it more likely that we can end up with the function- graph tracer enabled but without the kernel built with frame pointers. Fix up the function graph tracer dependencies so the option is not available when we have no possibility of having frame pointers, and adjust the dependencies on the unwinder option to hide the non-frame pointer unwinder options if the function-graph tracer is enabled. Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Russell King Signed-off-by: Sebastian Andrzej Siewior Reported-by: Danilo Cezar Zanella Signed-off-by: Greg Kroah-Hartman --- arch/arm/Kconfig | 2 +- arch/arm/Kconfig.debug | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -53,7 +53,7 @@ config ARM select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU select HAVE_EXIT_THREAD select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) - select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) + select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL && !CC_IS_CLANG) select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_GCC_PLUGINS --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -17,8 +17,8 @@ config ARM_PTDUMP choice prompt "Choose kernel unwinder" - default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER - default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER + default UNWINDER_ARM if AEABI + default UNWINDER_FRAME_POINTER if !AEABI help This determines which method will be used for unwinding kernel stack traces for panics, oopses, bugs, warnings, perf, /proc//stack, @@ -35,7 +35,7 @@ config UNWINDER_FRAME_POINTER config UNWINDER_ARM bool "ARM EABI stack unwinder" - depends on AEABI + depends on AEABI && !FUNCTION_GRAPH_TRACER select ARM_UNWIND help This option enables stack unwinding support in the kernel