From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F9FBEB64D9 for ; Wed, 12 Jul 2023 07:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:From:Mime-Version: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=0xHSY5y+F0fkavXEPKoJvtiwxz2jJgzUTi4dR0ag9Vg=; b=BxH 3rMVHMnbDwoZg5seVe6UO8gaFXaoE64/SL5LtHsdtMioYXEObgP6Q3zTEzqVMg3yZ+ksFYCfnctC+ CLWq76bW+ruidj+Bk7onEZ9hiww+zA2SPEfHyqiZJ5M6Djtq8KWS/up9MvfukixkhXuIa4zYpIzX3 VK1OR+JQWMbo7+wwWCme2nw3mnWyeQjaWhwwmEib0iveRFSKpm/HzgEQBYzoZxQ8JzDLbIq0bBBWL tRSL8KFII+EdqxvRx+BCe3jkAkp8ZFoTgbDwH7UV5PF5OMf6s7bVmyKnMg5PLP8Mdl9eO2xA5mlzD ogu4r+MK11rBIJnRo5nAnBw+GyZ+n3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJUim-00GqPX-0d; Wed, 12 Jul 2023 07:57:12 +0000 Received: from mxhk.zte.com.cn ([63.216.63.35]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJUik-00GqOd-0K for linux-arm-kernel@lists.infradead.org; Wed, 12 Jul 2023 07:57:11 +0000 Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4R197L5Y8zz5R9jt; Wed, 12 Jul 2023 15:57:02 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 36C7utTv023239; Wed, 12 Jul 2023 15:56:55 +0800 (+08) (envelope-from guo.ziliang@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid32; Wed, 12 Jul 2023 15:56:58 +0800 (CST) Date: Wed, 12 Jul 2023 15:56:58 +0800 (CST) X-Zmail-TransId: 2af964ae5cca56f-ed69e X-Mailer: Zmail v1.0 Message-ID: <202307121556582695428@zte.com.cn> Mime-Version: 1.0 From: To: , , Cc: , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIEFSTTogdW53aW5kOiB1c2UgZXhfZnJhbWUgd2l0aCBDT05GSUdfVU5XSU5ERVJfRlJBTUVfUE9JTlRFUg==?= X-MAIL: mse-fl1.zte.com.cn 36C7utTv023239 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 64AE5CCE.000/4R197L5Y8zz5R9jt X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230712_005710_304120_290A22A2 X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: guo ziliang We define ex_frame with CONFIG_UNWINDER_FRAME_POINTER in struct stackframe, struct stackframe { ...... #ifdef CONFIG_UNWINDER_FRAME_POINTER bool ex_frame; #endif }; but we just use ex_frame without CONFIG_UNWINDER_FRAME_POINTER in return_address() and unwind_frame(). so when we config CONFIG_FRAME_POINTER=y and CONFIG_ARM_UNWIND=n, compile failed: arch/arm/kernel/stacktrace.c: In function 'unwind_frame': arch/arm/kernel/stacktrace.c:44:11: error: 'struct stackframe' has no member named 'ex_frame' if (frame->ex_frame) { ^~ arch/arm/kernel/stacktrace.c:57:8: error: 'struct stackframe' has no member named 'ex_frame' frame->ex_frame = false; ^~ arch/arm/kernel/stacktrace.c:67:8: error: 'struct stackframe' has no member named 'ex_frame' frame->ex_frame = true; ^~ Maybe we should fix it. Signed-off-by: guo ziliang --- arch/arm/kernel/return_address.c | 2 ++ arch/arm/kernel/stacktrace.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c index ac15db6..dae49e7 100644 --- a/arch/arm/kernel/return_address.c +++ b/arch/arm/kernel/return_address.c @@ -47,7 +47,9 @@ void *return_address(unsigned int level) frame.kr_cur = NULL; frame.tsk = current; #endif +#ifdef CONFIG_UNWINDER_FRAME_POINTER frame.ex_frame = false; +#endif walk_stackframe(&frame, save_return_addr, &data); diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index 620aa82..338f552 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@ -82,6 +82,7 @@ int notrace unwind_frame(struct stackframe *frame) if (frame_pointer_check(frame)) return -EINVAL; +#ifdef CONFIG_UNWINDER_FRAME_POINTER /* * When we unwind through an exception stack, include the saved PC * value into the stack trace. @@ -102,6 +103,7 @@ int notrace unwind_frame(struct stackframe *frame) frame->ex_frame = false; return 0; } +#endif /* restore the registers from the stack frame */ #ifdef CONFIG_CC_IS_CLANG @@ -119,8 +121,10 @@ int notrace unwind_frame(struct stackframe *frame) (void *)frame->fp, &frame->kr_cur); #endif +#ifdef CONFIG_UNWINDER_FRAME_POINTER if (in_entry_text(frame->pc)) frame->ex_frame = true; +#endif return 0; } -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel