Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp50779pxb; Thu, 21 Apr 2022 16:45:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywC20tp68Syn41uM+TIYkMkZWfRnbMJ83Lw+6lrTzl4bJHSa8VVUZGZogu3MBu3+a/Hjus X-Received: by 2002:a17:903:248:b0:155:e660:b774 with SMTP id j8-20020a170903024800b00155e660b774mr1626977plh.174.1650584701156; Thu, 21 Apr 2022 16:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650584701; cv=none; d=google.com; s=arc-20160816; b=UzjqRL3EC4ffNLkZabFNphUkWejSFGpREK3EUg/h9XdbExk+RUEmGfQwQzaIk0xbpc 5751s7YV7xwuZ7ZxnY8oVW00pro0PH3uZckZgcI8qAXpD8YwESdz4UUn2jQ1aR72Olvm +SiJeOt1rbNfNvLeKnNgZ5b6Fs6kJuPUITCfEvqhZqeEJqRGpxXjLf+HwfndiLz6FExl krJ8WRGMHhz0gO4pvTvPtreNY5tfe9PFtS24rdWUvDdzIyGVwXGlbSZFN8q8q7ekv4aa 3rUJnjlZWDHKJZOaN8WW5MpWOhlen4C/TS8VFP9b3688QoXJFmjMzsuVR3cHxNq2b1wO yg6w== 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=DVxjzFwqlooP5cJWP/yc1gCAwtHREiRgoZGSUZkvroY=; b=yNMf+XsdGCXyzllB4yiTeIXvKtIU36FIy0qtedjegOjF95U5d85mIneHZctW75GkvW RludvRrBXmOuPJSsmyK0OSFUr7rDNiVwU5GawEzAu46QM7asKF0+xvW9S+Hu1LYDLYxO HWMRYf3fd8Pt6tjaC9nzngTwBUnmzaYwo91nHiDICR+bIokNnSSAM3zmM7Oh6/wXQ8Vk IT74j8aR70D94rDNBvELQ3T5upvnP+7JOtAdn5LHjPLvALcogdOp1WeqqXs1XwYU2mIq R78hCcZI06Jc7MZn9iwnu1Xth2yHj1y0k6Svd/LiI4jPZHMnQt21KB4LZFT70MteKFRC Uacw== 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 o5-20020a17090ac70500b001ca9187cab3si6049735pjt.124.2022.04.21.16.44.45; Thu, 21 Apr 2022 16:45:01 -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 S1382671AbiDUMkx convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Apr 2022 08:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241611AbiDUMkv (ORCPT ); Thu, 21 Apr 2022 08:40:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCADF21839 for ; Thu, 21 Apr 2022 05:38:01 -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 706DC61C19 for ; Thu, 21 Apr 2022 12:38:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A892DC385A5; Thu, 21 Apr 2022 12:37:59 +0000 (UTC) Date: Thu, 21 Apr 2022 08:37:58 -0400 From: Steven Rostedt To: "Wangshaobo (bobo)" Cc: , , , , , , , , , Subject: Re: [RFC PATCH -next v2 0/4] arm64/ftrace: support dynamic trampoline Message-ID: <20220421083758.37b239a4@gandalf.local.home> In-Reply-To: <5ddc2722-4489-f66d-552d-1f4c755b5d30@huawei.com> References: <20220316100132.244849-1-bobo.shaobowang@huawei.com> <20220420141143.23286faa@gandalf.local.home> <5ddc2722-4489-f66d-552d-1f4c755b5d30@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=UTF-8 Content-Transfer-Encoding: 8BIT 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 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 Thu, 21 Apr 2022 09:13:01 +0800 "Wangshaobo (bobo)" wrote: > Not yet, Steve, ftrace_location() looks has no help to find a right > rec->ip in our case, > > ftrace_location() can find a right rec->ip when input ip is in the range > between > > sym+0 and sym+$end, but our question is how to  identify rec->ip from > __mcount_loc, Are you saying that the "ftrace location" is not between sym+0 and sym+$end? > > this changed the patchable entry before bti to after in gcc: > >    [1] https://reviews.llvm.org/D73680 > > gcc tells the place of first nop of the 5 NOPs when using > -fpatchable-function-entry=5,3, > > but not tells the first nop after bti, so we don't know how to adjust > our rec->ip for ftrace. OK, so I do not understand how the compiler is injecting bti with mcount calls, so I'll just walk away for now ;-) -- Steve