Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp120348lqf; Tue, 26 Mar 2024 17:02:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJ7GOY6OWgaaM4mtUZFogv83aPnB2hHmRhTmjie9/b1yHm9ZjDqQCZA9qjeWWNyfse87uaFGBIoiG1bAe54qz5ZSKzRXeKn40NFSG5ow== X-Google-Smtp-Source: AGHT+IGqFfviPWkALB5WZAgLc5uKcccVNhB3+5HSDGIvGE9IFV9FNjLOk/GfNbM9NDmHSZtZrEsH X-Received: by 2002:a05:6358:248e:b0:17c:1bd9:a598 with SMTP id m14-20020a056358248e00b0017c1bd9a598mr2217881rwc.29.1711497730219; Tue, 26 Mar 2024 17:02:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711497730; cv=pass; d=google.com; s=arc-20160816; b=MfXr7TRBTWV2+wxm6dwiNXiQuHtHDoAosot/l9Z3VtV3851YNGQyLooJcIAPtlTAtK LvN759PkdG03MhIz0Ttw6eKOhO0c+dpOiLShC5zscvH8UrUnN2mjKgDS8KERZ9jxPBVP /5ZJOg9R/oQ8gtVIDXhJ0wyqrFHc81LXPP8Q+57yMZYmTliiQMrViMhpk60EZ6AZoNkD LUH8SATgvOiUUUXgwK6Vx4rsMqd7RGKkL6CCFCQjfHSDLGUiZYeim7zknRmHltDM2KJk 1epGQQe6J7q3XWbG2NDf9UeFsJEB9XH6LGTya/Onk9kQ9e+Yt4Tmpg+LA9/YBl3EKSsR G/wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=HNJzh5aM4QeNqOAKJL9r8dXDgVSCChbv+ZfW6tqx1qA=; fh=dVFaXPdiugCFBsSW9mQhQyTdgIGc93deRCdfdHN7TQA=; b=FC9aP7b9w9RdzZ3TmoWQoVARd9xYs1DYUvOJfQe6+xJ6zcgZX0lvHqESJJDPCbxIRq Ec9ZgCMudVW/XiE+2E1WfVwnYmBTmX8Vp2wodK/c8S6BkxlNeUpX/vEtS27bIT7lFQY9 0QuY2DrWEo2ynglYwuazUgI+IZsVnRTyYX5768OuuQysXvip/q06igAoI0fG0eXzqZAA mw9H0RLObC0Z/r+NKlqC2PKefycM1UaaZwG1XpctIbedSW8NLaxzIO7VX75hBVPK632j Po0kTfEu+S7FRM/iHOc8hOpiQ372bMKw/+PhUdXnHIy2ZfpYRY0J+sLIODEVz5nR5SiU m/lg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eqfqpiE/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u9-20020a632349000000b005dc3694a2f9si10761860pgm.659.2024.03.26.17.02.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 17:02:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="eqfqpiE/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D7FCC2E5438 for ; Wed, 27 Mar 2024 00:02:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACBCE1E878; Wed, 27 Mar 2024 00:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eqfqpiE/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D595F20EE for ; Wed, 27 Mar 2024 00:02:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711497722; cv=none; b=VifWx3Ilwv99R2/0lIlQwSTLsLepohXFl7m6vHAk7K1OPzm6puuWhbjiAOfQgwU7CLqTbjqzMfaMTdRczJMIv/pEKE5Wpvn2RFpfHf0YoHexGj30ypIwNZFuYooeRB/bQINZyDolPvBbmKiNMsrJ2pooj4dGVTT7j6seiFa08nM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711497722; c=relaxed/simple; bh=h1ujNBBy/aBs5SW6I/JPn+LTBRALB6UclagN9KkHVDc=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=goYB6YQt2kDuRiAk7f7DDdS5TNfB8/qqkKRegYkNVWWDqolJj98I0NW0ujgWZ/KbffAFiaonhR4c4EM1GP1/c7wrtCsxf8MgJ2TiypyVPUedh93DC1sGq9y3hi9DoAryKpZ4FOGIxibD71P9IGMuEwfuTI8LYsYBB5syig28CbI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eqfqpiE/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D00C433C7; Wed, 27 Mar 2024 00:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711497722; bh=h1ujNBBy/aBs5SW6I/JPn+LTBRALB6UclagN9KkHVDc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eqfqpiE/HKWvyIVb/EgbcC1g5iAtm+HLjwRUgFHbs9U8rp3c2WSUqHye2xfVRf0+B Uxy5b+pmom73QwIRXGHUJXlxr7nhOPrIynCmtY9qHHAhBT3CH2XXAqx1sw8vOW9qRJ FnxEyMBCI3smmROycLHUN1C9te9Jz+fidz1Z0Uxy/R6hDm+kXt4NXiZYcA5/QAx7oN 4Yj2UKDllfUz1IAMl7ChOAxv42I9cg+2rkWEmW2otQqwZuQdQiCS/suP+zGxjEml/Y uwEAOgEwHNqZNp3eXg5Lr9vMXJZLr3eDy3BRYEoxHXOZyTWAuY2rBicwz3rHvguSVg 17Xl6Xy699tGA== Date: Wed, 27 Mar 2024 09:01:55 +0900 From: Masami Hiramatsu (Google) To: Mark Rutland Cc: Jarkko Sakkinen , linux-kernel@vger.kernel.org, agordeev@linux.ibm.com, anil.s.keshavamurthy@intel.com, aou@eecs.berkeley.edu, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, davem@davemloft.net, gor@linux.ibm.com, hca@linux.ibm.com, jcalvinowens@gmail.com, linux-arm-kernel@lists.infradead.org, mhiramat@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, will@kernel.org Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules Message-Id: <20240327090155.873f1ed32700dbdb75f8eada@kernel.org> In-Reply-To: References: <20240326163624.3253157-1-mark.rutland@arm.com> <20240326163624.3253157-5-mark.rutland@arm.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 26 Mar 2024 17:38:18 +0000 Mark Rutland wrote: > On Tue, Mar 26, 2024 at 07:13:51PM +0200, Jarkko Sakkinen wrote: > > On Tue Mar 26, 2024 at 6:36 PM EET, Mark Rutland wrote: > > > > +#ifdef CONFIG_MODULES > > > /* Check if 'p' is probing a module. */ > > > *probed_mod = __module_text_address((unsigned long) p->addr); > > > if (*probed_mod) { > > > @@ -1605,6 +1606,8 @@ static int check_kprobe_address_safe(struct kprobe *p, > > > ret = -ENOENT; > > > } > > > } > > > +#endif > > > > This can be scoped a bit more (see v7 of my patch set). > > > > +#ifdef CONFIG_MODULES > > > static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk) > > > { > > > char *p; > > > @@ -129,6 +130,9 @@ static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk) > > > > > > return ret; > > > } > > > +#else > > > +#define trace_kprobe_module_exist(tk) false /* aka a module never exists */ > > > +#endif /* CONFIG_MODULES */ > > > > > > static bool trace_kprobe_is_busy(struct dyn_event *ev) > > > { > > > @@ -670,6 +674,7 @@ static int register_trace_kprobe(struct trace_kprobe *tk) > > > return ret; > > > } > > > > > > +#ifdef CONFIG_MODULES > > > /* Module notifier call back, checking event on the module */ > > > static int trace_kprobe_module_callback(struct notifier_block *nb, > > > unsigned long val, void *data) > > > @@ -699,6 +704,9 @@ static int trace_kprobe_module_callback(struct notifier_block *nb, > > > > > > return NOTIFY_DONE; > > > } > > > +#else > > > +#define trace_kprobe_module_callback (NULL) > > > +#endif /* CONFIG_MODULES */ > > > > The last two CONFIG_MODULES sections could be combined. This was also in > > v7. > > > Other than lgtm. > > Great! I've folded your v7 changes in, and pushed that out to: > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=kprobes/without-modules > > I'll hold off sending that out to the list until other folk have had a chance > to comment. Yeah, the updated one looks good to me too. Thanks! > > Mark. -- Masami Hiramatsu (Google)