Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp498363pxp; Fri, 11 Mar 2022 08:26:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJysgyMI7i/jDEGDnUpuXmHhBWChkRLPp71/tX+0S1bYU+KlNxOfGo4HI7cocxJWUrRCVC38 X-Received: by 2002:a17:902:7086:b0:14f:ee29:5ef0 with SMTP id z6-20020a170902708600b0014fee295ef0mr10939258plk.142.1647015966143; Fri, 11 Mar 2022 08:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647015966; cv=none; d=google.com; s=arc-20160816; b=UWo086FEypnJPrWFkDBxy23QhNas1oQrx9rAAUpAiiQGAzjmFwpz/lgekJxjg/dz8f I6SE/xP1FlVZ/IA/I/RFghcuNn2Bpa+ZPtjIPdVdmwCan3IMxUqYaaza+Jb1Mf/BIE0c lv2jtVfcM9GPveVD418XoltGYU7PYd6R1YXHOaxYDr1uaGfsgv4NdmXN5iUMyoFWBTJ7 xZYz3+kQUxrLC4uVoxAuwl3f/vfElqtHqZK2+lyKO1nIR5qbClOU6Ig1SpEFLGTjmITb cX6X+7ukYUMh98U/pHfPvutz73HnzKhfHD74g+2ypCfZXMQ2pOpuKdGmlyUGnuTLc6Er IhRQ== 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=5eoQKpQalN4L+Bw4UNIhAvuH9VTpAWnmohwsMugP5y0=; b=Wos51XaJ70bNXDKojr3MV/T7hFXwIGs1LBpb0zYwtCT541RCyAYsxFj4bVbpGRfh3w duRfyja4j8yXScqTUpUN+O5YVoV11yDVZYfquX39cwI4GpfctLMWd5y7lFwKQIAG/Vfa Zqu/LHJfAVpWEA9GjXWqQe63R/lU8BLXyS+t2iOSY5G4agLt/mDolQxZXCuEnzDgCMCw soYDymC7CuEMIwz1d4vWnFtj3KZJ2up9Gb5nswPvYihN8v0+hmKpiaLPOvNdbV/Wu1+j B1mzeoYHloEyVE4zdM7+sbRMSYtxdACJClN4PLyupgk6GgBXvtetY1VNz+HyehNRjWX1 PrjQ== 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 v11-20020a17090a7c0b00b001bf5d5b5daasi5766709pjf.129.2022.03.11.08.25.49; Fri, 11 Mar 2022 08:26:06 -0800 (PST) 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 S244462AbiCJOyR (ORCPT + 99 others); Thu, 10 Mar 2022 09:54:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345916AbiCJOmX (ORCPT ); Thu, 10 Mar 2022 09:42:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4000935273; Thu, 10 Mar 2022 06:37:39 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 96629B8267B; Thu, 10 Mar 2022 14:37:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76B86C340E8; Thu, 10 Mar 2022 14:37:33 +0000 (UTC) Date: Thu, 10 Mar 2022 09:37:31 -0500 From: Steven Rostedt To: Peter Zijlstra Cc: Alexei Starovoitov , x86@kernel.org, joao@overdrivepizza.com, hjl.tools@gmail.com, jpoimboe@redhat.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, ndesaulniers@google.com, keescook@chromium.org, samitolvanen@google.com, mark.rutland@arm.com, alyssa.milburn@intel.com, mbenes@suse.cz, mhiramat@kernel.org, daniel@iogearbox.net, andrii@kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v4 00/45] x86: Kernel IBT Message-ID: <20220310093731.78a6a8d5@gandalf.local.home> In-Reply-To: References: <20220308153011.021123062@infradead.org> <20220308200052.rpr4vkxppnxguirg@ast-mbp.dhcp.thefacebook.com> <20220309190917.w3tq72alughslanq@ast-mbp.dhcp.thefacebook.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 Thu, 10 Mar 2022 14:47:18 +0100 Peter Zijlstra wrote: > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index acb50fb7ed2d..2d86d3c09d64 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -5354,6 +5381,11 @@ int modify_ftrace_direct(unsigned long ip, > mutex_lock(&direct_mutex); > > mutex_lock(&ftrace_lock); > + > + ip = ftrace_location(ip); > + if (!ip) > + goto out_unlock; > + Perhaps this should go into find_direct_entry() instead, as I think you are adding it before all the find_direct_entry() callers. And find_direct_entry will update the ip. -- Steve > entry = find_direct_entry(&ip, &rec); > if (!entry) > goto out_unlock;