Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1887577rwb; Fri, 19 Aug 2022 11:05:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LQgqgUTrx/VJ2/B0lXWR1Ff//3YdkF8yAFag/q2LHMKUT0qs2h6VKwTcuOJh9gLxMk8zR X-Received: by 2002:a63:8b44:0:b0:41c:df4c:7275 with SMTP id j65-20020a638b44000000b0041cdf4c7275mr7362810pge.434.1660932320362; Fri, 19 Aug 2022 11:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660932320; cv=none; d=google.com; s=arc-20160816; b=sNFv6O38rFgiQdOVTVRPiyTE8YRlSVoTKYJ3Jhyccni0N89nOWMI6fpECjZ3LoE2Ya c839u6SIlwrkpmbxcTqON+L1mGihbgy7Nj0s+NXZtVq1tRJ4KhMTu2fKZvnHzq48JkBJ 8jZvEiwVloNdr8R/tizGJj6EeMMk1rmJvjsrMj31wryfEQ2pqbzbUjirmQa3Hmy9wQY4 0yGFHv7/Zg2nImNkPqmVE2VsWuKmuZmfHKqI86Fk9L/4xVp0uHW53HG35Biz9miqS3nm /29gDCdGD1ZJ8i/lfxMGM9SrvLgxP0ky32J74HAWMmnFLsYXfm+VAvO47IFpjCWyurgd S4Wg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=dOa6WnrcPWp+CcN6mJO+k1J2e6bTU1ag8NMlbhD4udQ=; b=0M9qpOEHw5daMabBgBwosrzjETw8oVlZscZcOvR9f+JdvAsQVCfAvWAlgzWq3H1eBZ CDgqDgVlMpJCAdMH5qq+WuL7YC1BqFCE11Wf7AKtie0I1wtVJNIanccBNx+F8JpsL2oi YM68yktCP1eH309qpRmBbz5CTnMVSajwd4o964Oj++9G6dUqEtMJ4Dc1fq9EH9fs5Arm IINTEPweml84EXNsJxKetiqfU7O/w9nEt98Zee3mYVTv9a4V4aDaLcc0ZqaYB8BExkBA HJiZpf8ozWvjjfBkWLa8ZLB/CX/QLaK1xxd7iEUS8r9H+2WBYaB6xu7MimlL3JDEsV3y 47ew== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a65404c000000b0041d131e1594si4722695pgp.670.2022.08.19.11.05.08; Fri, 19 Aug 2022 11:05:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352024AbiHSRxI (ORCPT + 99 others); Fri, 19 Aug 2022 13:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352000AbiHSRww (ORCPT ); Fri, 19 Aug 2022 13:52:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 842D847B99 for ; Fri, 19 Aug 2022 10:28:02 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2096A61825 for ; Fri, 19 Aug 2022 17:28:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6027EC433D6; Fri, 19 Aug 2022 17:28:00 +0000 (UTC) Date: Fri, 19 Aug 2022 13:28:12 -0400 From: Steven Rostedt To: Chen Zhongjin Cc: , , , , , , , , Subject: Re: [PATCH v2] x86/unwind/orc: unwind ftrace trampolines with correct orc Message-ID: <20220819132812.391619d2@gandalf.local.home> In-Reply-To: <20220819084334.244016-1-chenzhongjin@huawei.com> References: <20220819084334.244016-1-chenzhongjin@huawei.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Fri, 19 Aug 2022 16:43:34 +0800 Chen Zhongjin wrote: > When meeting ftrace trampolines in orc unwinding, unwinder uses address > of ftrace_{regs_}call address to find the orc, which gets next frame at > sp+176. > > If there is an irq hitting at sub $0xa8,%rsp, the next frame should be > sp+8 instead of 176. It makes unwinder skip correct frame and throw > warnings such as "wrong direction" or "can't access registers", etc, > depending on the content of the wrong frame address. > > By adding the base address ftrace_{regs_}caller with the offset > *ip - ops->trampoline*, > we can get the correct address to find orc. > > Also change "caller" to "tramp_addr" to make variable name conform to > its content. > > Fixes: 6be7fa3c74d1 ("ftrace, orc, x86: Handle ftrace dynamically allocated trampolines") > Cc: > Signed-off-by: Chen Zhongjin Reviewed-by: Steven Rostedt (Google) Would someone from the tip tree care to pull this in? -- Steve