From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF1EC433F5 for ; Thu, 24 Feb 2022 22:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235839AbiBXWw2 (ORCPT ); Thu, 24 Feb 2022 17:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235694AbiBXWwS (ORCPT ); Thu, 24 Feb 2022 17:52:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7828228998 for ; Thu, 24 Feb 2022 14:51:46 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 14FEA61B75 for ; Thu, 24 Feb 2022 22:51:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E418FC340F1; Thu, 24 Feb 2022 22:51:43 +0000 (UTC) Date: Thu, 24 Feb 2022 17:51:41 -0500 From: Steven Rostedt To: Josh Poimboeuf Cc: Masami Hiramatsu , Peter Zijlstra , x86@kernel.org, joao@overdrivepizza.com, hjl.tools@gmail.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, alexei.starovoitov@gmail.com Subject: Re: [PATCH v2 12/39] x86/ibt,ftrace: Search for __fentry__ location Message-ID: <20220224175141.6a318d61@gandalf.local.home> In-Reply-To: <20220224224631.tr3odcwacpoejftn@treble> References: <20220224145138.952963315@infradead.org> <20220224151322.714815604@infradead.org> <20220225005520.c69be2fbdbd28028361792d9@kernel.org> <20220224105847.5c899324@gandalf.local.home> <20220224110130.4f4ae4ac@gandalf.local.home> <20220224224631.tr3odcwacpoejftn@treble> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Feb 2022 14:46:31 -0800 Josh Poimboeuf wrote: > > > > > + rec = lookup_rec(ip - offset, (ip - offset) + size); > > If 'offset' is zero then why the math here? ^^^^^^^^^^^ ^^^^^^^^^^^ Because it didn't check for offset being zero when we wrote that line. ;-) Yes, checking for !offset makes that logic irrelevant. Good catch. -- Steve