Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp212715lqo; Wed, 27 Mar 2024 10:52:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPWDPhkFDRGlEzGnTYNNmYAcG5ooJT075VR0JLGDj27o/2OCZsxsZipJuMB/Pt7a3na2rU+VXIMZvIkhR2p+wFDMZaXgg1FGoBjcD00g== X-Google-Smtp-Source: AGHT+IEYAwkjjYPE2dTKSt7PORnxZvwclKKGkokVng+8Yx/K9LAVJUNU+rnn6QI4uYa0JV4q+B/i X-Received: by 2002:a17:906:590b:b0:a47:2163:56c1 with SMTP id h11-20020a170906590b00b00a47216356c1mr121594ejq.36.1711561932028; Wed, 27 Mar 2024 10:52:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711561932; cv=pass; d=google.com; s=arc-20160816; b=s6Rl0ux+uOtkaxk1qu/BSG/mDCtS/BaTT0ltgm8gYwoRTVJ1/8L/Zzctgu/N/vyY9T VeAID/vGlbpYWmD8jMu8uBNb2EH2Dvg1OkQlCjAnOmhra7L7fW3OPe1ur2KsLXWMyeWJ FZ+Gmtlmj3URd6MoEsCEy7UxQUgzXLnDLUcEDqctXfOGf/wgMf1M5ue0pSFtdE3zE7d6 0l67W/XOGCG/As8j6x1Ok+6qwc6cIMfFBvHG1KoDHkvFskIdJDkxd7ScHvOYVrwA3Kra xCgveH5Ow/Z/jgR8CfZVa5vCc045RAL428k7xXlxMdCGHQg7Yala1b4Z3+IJlW+fAX5N 5b8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=Yi8DHX6VRU8FE01H2QRyVmF4XocnUefXWzl9ahh07PA=; fh=5zJxAjb5ZusqfLSXqDzbIme1GMqZPrkyQyY5NAnnWks=; b=rWuRDJQqrZB8fiHUyfJJV5k5Upeoqp+lZhNEc01qsOdiZD/Sl8bLS9iQJB7HJ7WgUE L8f0tqCzXph+9jo81EOc/xEDB1VI+v5pTx+lT+iTc6sqovaLh3pVGvI8079NUxLrML/K o/ujuYby7lvX5htR8LDl16Itja2hYUCj7nCKRyFAzxKFj6WdeDmw4WbLFnvK2cxyrb7G wHb9U9ai1Fog52woX8sBTyKDX80fCUs0wb5SWixb2MDPcGrsIutz7nr3dq6Iu3eeNwml K2ePMB41TPt/511QLbVBcfy3/QWrLC6mKZ3DU/kcLqSHM7WWHsB0/E9scClPuSc4tCeJ CrQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jbVTnNry; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ce3-20020a170906b24300b00a47325ce46bsi4544094ejb.200.2024.03.27.10.52.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 10:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jbVTnNry; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121740-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BC9FE1F21D1F for ; Wed, 27 Mar 2024 17:52:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7406A15098B; Wed, 27 Mar 2024 17:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jbVTnNry" 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 9E19914F9F1 for ; Wed, 27 Mar 2024 17:46:56 +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=1711561616; cv=none; b=KtN/29+24K6QeJUOue2WY46t9jQ9/1E66ro3Ugc5N495ktg3IUPrernjAwmQ3uhvVCTUelukTCTyiVmN6PzVK9pvWp0cf7vYcVJBZJl+vTeGV/ejLj3/ljakMLLJ77fTs0OG3T4rrj6SV9n7MLJZxRP7oqIGE15O2mf7OI50eEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711561616; c=relaxed/simple; bh=+JLGX36YP90VROvvA1SVh8R1mRHl0Ghl/7lpEVb6bo0=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=eXrDun6d1wgI4i9Dpy/8bq97vO8qRMOwnorappqMTmaCDftkU/F1uOrKmAjm0rlSXrn+sgJxrpZN9e4GyrUWZANUgZ8gQ3/3+RAQnanJK8+k9VMroLizzDz798zoqGhN4cvO6EbKrvXkYn4CkX3t3U55W26KOedoyx0f5W4UbrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jbVTnNry; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C063C433C7; Wed, 27 Mar 2024 17:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711561616; bh=+JLGX36YP90VROvvA1SVh8R1mRHl0Ghl/7lpEVb6bo0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jbVTnNryCOCvZ0IKvA3CTaFuKaG//yheGiNyp7ASv2D6PEhQi3q9LxNZbbShnm8MO sZdyp4MdS4nTGIy1KXIGiROGocQpc61GKmJYSb3j47b2VoIOTIoHMjz9OG4Ft0dV9c VhOeFDQStAaK/z4wUv8tPETLT41Af9SRMwkllKIdGZ70o+lZt16ibupYK3/+EbIv01 DTZWIYZHRo+tUsQZu1jJ7R5kq4/r0566Qrw09MD4+qR1udomiyigb0sLWPu0ebGyvr hkCmbstnM7u49tESQQzyL94fdAL5JYujU3ZzS5RFhfUymvplvreuHx8KxeIRL2pAPQ nRPIOumYqKH3g== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 27 Mar 2024 19:46:50 +0200 Message-Id: From: "Jarkko Sakkinen" To: "Masami Hiramatsu" , "Mark Rutland" Cc: , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules X-Mailer: aerc 0.17.0 References: <20240326163624.3253157-1-mark.rutland@arm.com> <20240326163624.3253157-5-mark.rutland@arm.com> <20240327090155.873f1ed32700dbdb75f8eada@kernel.org> In-Reply-To: <20240327090155.873f1ed32700dbdb75f8eada@kernel.org> On Wed Mar 27, 2024 at 2:01 AM EET, Masami Hiramatsu (Google) wrote: > 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: > >=20 > > > > +#ifdef CONFIG_MODULES > > > > /* Check if 'p' is probing a module. */ > > > > *probed_mod =3D __module_text_address((unsigned long) p->addr); > > > > if (*probed_mod) { > > > > @@ -1605,6 +1606,8 @@ static int check_kprobe_address_safe(struct k= probe *p, > > > > ret =3D -ENOENT; > > > > } > > > > } > > > > +#endif > > >=20 > > > This can be scoped a bit more (see v7 of my patch set). > >=20 > > > > +#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) > > > > =20 > > > > return ret; > > > > } > > > > +#else > > > > +#define trace_kprobe_module_exist(tk) false /* aka a module never = exists */ > > > > +#endif /* CONFIG_MODULES */ > > > > =20 > > > > static bool trace_kprobe_is_busy(struct dyn_event *ev) > > > > { > > > > @@ -670,6 +674,7 @@ static int register_trace_kprobe(struct trace_k= probe *tk) > > > > return ret; > > > > } > > > > =20 > > > > +#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, > > > > =20 > > > > return NOTIFY_DONE; > > > > } > > > > +#else > > > > +#define trace_kprobe_module_callback (NULL) > > > > +#endif /* CONFIG_MODULES */ > > >=20 > > > The last two CONFIG_MODULES sections could be combined. This was also= in > > > v7. > >=20 > > > Other than lgtm. > >=20 > > Great! I've folded your v7 changes in, and pushed that out to: > >=20 > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h= =3Dkprobes/without-modules > >=20 > > 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! As for RISC-V: Tested-by: Jarkko Sakkinen # arch/riscv I'm fine with adding to all patches because it would be hard to place tested-by to any specific patch (e.g. if this was a syscall I would give tested-by just for that patch). Just adding disclaimer because depending on subsystem people are more or less strict with this tag :-) BR, Jarkko