Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2885757pxp; Tue, 22 Mar 2022 07:54:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3U13DshQh9HCcuLY4z5eHS2xBQw7QqH8kYpNHwogtibx0o91IFPiGO+Co55xuj96Zun/E X-Received: by 2002:a17:907:1c27:b0:6df:d55c:ab7c with SMTP id nc39-20020a1709071c2700b006dfd55cab7cmr14992097ejc.581.1647960841528; Tue, 22 Mar 2022 07:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647960841; cv=none; d=google.com; s=arc-20160816; b=OFFe0+ICUURXEdl7dy9A7lBsNbVbyY2sGEkMGsJdh5CdInruT4CJOZ+qCIZGpLuqDv mdsRMfTtOTBwbF5oIEa42hZvVdTVkap5euZnhQys9qkBcrdqw8aqs9mA9bNwJMQAAMjT /9HqUNEpphvH4CjuOhl8MFDXko4lDeSeMU5Q3MaD+WJWyvl282a1pbglyqsS66sXSnl6 mIbbhtaKV24PnaVNA4stOqEJKTUMK95oK9S8iNs4jNpahNZf6EfdsN90/GVO+adYsHo6 g4sfgCABsOulxDRnxW61rzLEMnt8ywbqTICuZyeLf9IttxMq9S7iQsL0dKRvwhCe9/KA aeJA== 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 :dkim-signature; bh=mldUOluquUcYT3EZ8Sitg5T2nVGaNFzMTZVjWuZi7Vc=; b=hN2s3rx4hDRH2AbNBDOchjkkvaRUkYaiyt1OWzoDuLTInJa9pHutDTfaBuYWlxNkFn kzkhlEq6PoAM8hCRKgZNHU42W8CcAwkva5PjU5d8b9vkaxH1N3zk/OUYdKqi+CN3ADiu l9riF8pxlQWjDOWSzKTFlWxU7g5WT8L1A5Sw/E+FBc53DnCmvaUqTM4dF8rmrJ19rnc/ heULAnrloDg7t86zjgUrz5dfAHi0AyVoyo7uX/y8cf9RtqlydKesd5rXEEDHwGDKsRSa sYAbonnEs30xIdiZrvdRXaXM0vfBq2GNU2hpwO7h5hhF+a3N1z1Qe68Z8kQ09XbN0sls lfDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MPq7XyYu; 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 c11-20020a056402120b00b0041935da592fsi4981492edw.624.2022.03.22.07.53.35; Tue, 22 Mar 2022 07:54: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MPq7XyYu; 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 S236694AbiCVO2O (ORCPT + 99 others); Tue, 22 Mar 2022 10:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241238AbiCVO0v (ORCPT ); Tue, 22 Mar 2022 10:26: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 C662D13F48; Tue, 22 Mar 2022 07:25:22 -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 0A411615BE; Tue, 22 Mar 2022 14:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 781C1C340EC; Tue, 22 Mar 2022 14:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647959121; bh=ZJy4jdo44xK7N2rkd/X1voMeDEE0lojYlDBJmgmcmhU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MPq7XyYuZOLpWAJVUwMdRZF7wvfqt9CnUvtuCNcd2EOsQR8wjlPn5L4wm70eaJTdv vkzjJCsXqKJRIfx3XxKJit/vwbEzEbdq9BeTJkdXy3os6LpfO254lsfS9Jk2YyFeab 0foNkCXdYPv45Wi0TF9u/KImGJNoBq+WovUGkxJERZBvh2OhX47pJtUJOIkVXICiYs lqkp5A/NqVfp2Zjzul9P5+zkGMJNR6ZnzLItF6WzdG2BQ6yiUNU147qlqeXuEkknXz qVCy43qgJNPbH6x+fl1YL+MfS87lnvE9cWDnsQkit56gHkYwSNJa2Qe3KU37/mFn+a FQvJKCHe2gzJw== Date: Tue, 22 Mar 2022 23:25:15 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: Peter Zijlstra , Stephen Rothwell , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux Kernel Mailing List , Linux Next Mailing List , mhiramat@kernel.org, ast@kernel.org, hjl.tools@gmail.com, rick.p.edgecombe@intel.com, rppt@kernel.org, linux-toolchains@vger.kernel.org, Andrew.Cooper3@citrix.com, ndesaulniers@google.com Subject: Re: linux-next: build warnings after merge of the tip tree Message-Id: <20220322232515.97d8e2d66d051881bcfe3ce0@kernel.org> In-Reply-To: <20220321121209.3b95e406@gandalf.local.home> References: <20220321140327.777f9554@canb.auug.org.au> <20220321112805.1393f9b9@gandalf.local.home> <20220321121209.3b95e406@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; 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=-7.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 Mon, 21 Mar 2022 12:12:09 -0400 Steven Rostedt wrote: > On Mon, 21 Mar 2022 17:04:28 +0100 > Peter Zijlstra wrote: > > > On Mon, Mar 21, 2022 at 11:28:05AM -0400, Steven Rostedt wrote: > > > On Mon, 21 Mar 2022 14:04:05 +0100 > > > Peter Zijlstra wrote: > > > > > > Also, folks, I'm thinking we should start to move to __fexit__, if CET > > > > SHSTK ever wants to come to kernel land return trampolines will > > > > insta-stop working. > > > > > > > > Hjl, do you think we could get -mfexit to go along with -mfentry ? > > > > > int funcA () { > > > [..] > > > return funcB(); > > > } > > > > > This currently works with function graph and kretprobe tracing because of > > > the shadow stack. Let's say we traced both funcA and funcB > > > > > > funcA: > > > call __fentry__ > > push funcA on trace-stack > > > > > > [..] > > > jmp funcB > > > > > > funcB: > > > call __fentry__ > > push funcB on trace-stack > > > > > > [..] > > call __fexit__ > > pop trace-stack until empty This seems wrong. We don't pop the trace-stack until empty, but we will record the real stack pointer at funcA. > > 'exit funcB' > > 'exit funcA' > > And what happens if funcC called funcA and it too was on the stack. We pop > that too? But it's not done yet, because calling of funcA was not a tail > call. Thus when the funcC is called, the trace-stack will be poped until funcA, because we can see the real stack pointer at the 'ret'. So the funcC is still on the trace-stack after that. Thank you, > > -- Steve > > > > > > > ret > > > > > > > > That is, the current algorithm traces the end of both funcA and funcB > > > without issue, because of how the shadow stack works. > > > > And it all works, no? Or what am I missing? > > > -- Masami Hiramatsu