From patchwork Mon Oct 24 11:29:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519452wru; Mon, 24 Oct 2022 08:41:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WRfXokhdJTuQwpZ33+bHCKA9VzRnrgCQ3tUbPtHCM44/wj/VacDyyuXgOF/0RRIz2qDft X-Received: by 2002:a17:903:32c2:b0:182:1a9c:8f40 with SMTP id i2-20020a17090332c200b001821a9c8f40mr35002668plr.54.1666626104371; Mon, 24 Oct 2022 08:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666626104; cv=none; d=google.com; s=arc-20160816; b=ukiNgB/eLwyZUkCP2+3XGrI47yB/eRPwE7cISOeUiBhgHJOysRHxVTOp6qMb0X+BI/ +MhLyukksqfqALleMS2gUibRXS/gwJ2ARDhGRJZSOvQTC33Mw4HAS+WZQwujlS2ieEBg tTTrS99bZkU81MqXBEW42TzpNxr7Zn7Ew/churle0/NH1uopdehpnNJeAukzYfKJqbHk N0Ve9yJflh6DDtawYNoS0eUx98miJ3I/Ek85K0ysw4mFF8EFeDRETso201FkllVzB9g8 KOIcV0czOMnSm7OI5AckNqnmeZjnYHPw9Ga8tR3GgmE7/flYPYYh4WyVfESh8tbT+5gS 12lA== 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 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.31; Mon, 24 Oct 2022 08:41:44 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747584134316075595?= X-GMAIL-MSGID: =?utf-8?q?1747584134316075595?= 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