Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1233757rwa; Sun, 21 Aug 2022 04:15:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR7kmzcKJ2wT7Nd10IWw/ovW1ZbIYoMeupzQo5yJxSaVTupr9ptITWwWaSIMhXRxoGuZ5DqV X-Received: by 2002:a05:6a00:27a0:b0:52f:8766:82ec with SMTP id bd32-20020a056a0027a000b0052f876682ecmr16220803pfb.17.1661080537085; Sun, 21 Aug 2022 04:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661080537; cv=none; d=google.com; s=arc-20160816; b=wfqqPHrfjkYuqWBA6q1cFQuxvlXWWn6wt8uwPwbtpzgHyN5Fs40A9EFNhuq5mbLDN/ xCBSdtLY//1tnNtL8eoxbVxFp23IjaaUAOHnWuIqX6nJsNycaeK12e+jTLPgL4nrSc8C vlzKZX8J7uhS+oMpbf5GLATBbIvLEQ5uXJnXgSvyU88gYuedIO18MW2B7HQUp5H3bacl cfT+YW5+v8EcJYJFcQV3BYZfi3JeBdhscKhKO3HD42JGDcdQs3yk0O8+zErGmceFXsCY RF/Vmx9pXeD+19TwrSqYC5eCfKNcR7hfaGAQpB8S7svNOYGkIF4F+6QjUyOrW+wMckfv HKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=LX+6Y3J7NBpt2yMeFwFFwIC5Leg2hEnRCyqHn0VPvDo=; b=db7UCX1YboTVeLf3yyr3FPAUGYgH0GP+Plv8FeIjiNg25rh+7B8tP0GROas2rGCHst grLW/BB11pwjH5gYsaVe+Bj+ess7q5hirp4SMfZieb8+e5U5a15QgPxhxHrqu9UEZHjH RaNPPD60ruzloTg79Eycm2VRdsGTc7HM10wK7WUGnFvrMg/6NUQw7Jeb3HgK1icz7Z44 miKNJRQaoewgfCT6w4+udypfZCC9tSlYDiebR+vBJUSpFnHPh/lKSeAh4P37b8r6uj4y wDzlrvBfP0nKDhIZ7F8F9IS8uW4NsABkWuM7OFBqty79hzA8K5Z6eJLCLoU4GRijytgN BAaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=d07yH0ky; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a170902a71300b0016eccdd02cdsi8651278plq.222.2022.08.21.04.15.26; Sun, 21 Aug 2022 04:15:37 -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=@gmail.com header.s=20210112 header.b=d07yH0ky; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbiHUKU5 (ORCPT + 99 others); Sun, 21 Aug 2022 06:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiHUKUz (ORCPT ); Sun, 21 Aug 2022 06:20:55 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71748140AC for ; Sun, 21 Aug 2022 03:20:54 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id fy5so16263626ejc.3 for ; Sun, 21 Aug 2022 03:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc; bh=LX+6Y3J7NBpt2yMeFwFFwIC5Leg2hEnRCyqHn0VPvDo=; b=d07yH0kygyLJOxqLq2147/N73AxZ5f3tGbe8gvFccThsDGfONVLppvTah1r0vZZzrH t4tZfFMWo9KLBgJ5A+/RgaqlGX9T2+xBb+LxfBnXArXQmpgxwnX6zqdxqDUZC/R0Ev++ SYYPvIQ8gMMW1pJfpY2A4tMehVCRhggcL1gtS0qM5H011ju2D2nKjRzoWysrUHcdOlnd xa96IvjTF1wfLkVmEeFMNdSyEzfbs49MvQIfqnjHKqtgLdC4eerKfgMwZCDzqnx/+LTj h6B6hXxLNmdizUP4zRbSrjQw++6llPyFsajCgKtmEhhHwdV4/ojdsaUi1S/22uLt7jY5 Xiww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc; bh=LX+6Y3J7NBpt2yMeFwFFwIC5Leg2hEnRCyqHn0VPvDo=; b=1dZg9Au43p6ZuKGDZ1S7EXEJPY/fqEdZgket0omSr39Ep2/bqCoWU7WdhnIsgEFyh8 vfGAPUAx+R5ArcBqSctCT4lW2P86i9V8DfTBwssffCz0d3ob/4sDlmGIcfXxp4/vvd9L hFZ3d0jRlBMane43tzXTgh+Gwu2u1M/wkn+im1SP6PdY0ZbqtE2CdCIu7YxGbkRMHVSQ Z7XhQPAp2vye+PgnFLlQYttPutMhKDHToPXD/VnWPDixvVdlhlkwlRVAp+diaA2NPvKa GlS10SSfrJJ+EQbo1iMpu93OH3n2QEf+S7bjI68XkE4fzUphM2LIcq+22E0hkluN7hIu 4dvg== X-Gm-Message-State: ACgBeo2qAmj9P7UCB+5S2ZHbfIZ/zFd4vxPrjxhnlJZByYo57KIhz2Ww rXROTfzaXwk/TL8yHMnuRmY= X-Received: by 2002:a17:907:720b:b0:731:6e49:dc93 with SMTP id dr11-20020a170907720b00b007316e49dc93mr10151421ejc.421.1661077253044; Sun, 21 Aug 2022 03:20:53 -0700 (PDT) Received: from gmail.com (195-38-113-151.pool.digikabel.hu. [195.38.113.151]) by smtp.gmail.com with ESMTPSA id c23-20020a056402101700b00445b3cab975sm6204043edu.56.2022.08.21.03.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 03:20:52 -0700 (PDT) Sender: Ingo Molnar Date: Sun, 21 Aug 2022 12:20:50 +0200 From: Ingo Molnar To: Steven Rostedt Cc: Chen Zhongjin , linux-kernel@vger.kernel.org, jpoimboe@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com Subject: Re: [PATCH v2] x86/unwind/orc: unwind ftrace trampolines with correct orc Message-ID: References: <20220819084334.244016-1-chenzhongjin@huawei.com> <20220819132812.391619d2@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220819132812.391619d2@gandalf.local.home> X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, FSL_HELO_FAKE,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 * Steven Rostedt wrote: > 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? Picked it up into tip:x86/urgent with minor edits to the changelog - will push it out after some testing. Thanks, Ingo