Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp462987lqz; Sat, 30 Mar 2024 04:33:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWG/RrfCbctPSTF5DH4s8e04e6FrYcWjXn+ZH4/xbFfg6tjoL5suyECgP0O4UraTU3n1P4kV/6WpiTb8Vae8mcBJNhNq2UtvCzFu/Q+cw== X-Google-Smtp-Source: AGHT+IEkBQy0+QmAfMqX8sHFFOmhhfscVreoA3QnPaLoPCLbv2Ls2XcElzKhLk18B/yn+R3bVcKa X-Received: by 2002:a05:6214:57ca:b0:690:db88:9eb with SMTP id lw10-20020a05621457ca00b00690db8809ebmr4033931qvb.50.1711798382533; Sat, 30 Mar 2024 04:33:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711798382; cv=pass; d=google.com; s=arc-20160816; b=HoSyGiL+b5g4YbR3A34Uz98tz5HNN22EVa32sYjhggsbNxmTZLkmRt55yINuQU4O1z rpdCNSLncta+MtmX2Xvs8FTQsmiln7UXICXGpDsPAUlQ9F+W6BBHx6Ruiz0Y2MFw2lhn BeJN7ie5ciGK0N8b0J3LLVBDhR+zUVyoI3FoTogSMb6oP+I/qrmyeH6kj5/lOj0Rvl54 vacrCV76VSvY24oXSdPWhvVTEEuqbX75/F6ljC0wQYOE7zpp3yRwseXtUY1W0sgumjA1 GP0K3GwMntj4YD8+mJ4Ht5uoLnd3AP9aS6+qBLO3evKb5YOp4/++72LOfqa9MnYm1Htm GEYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=+UEKXJG6k/e8jDEPqr+L/XoNQSrO/Du5AyhsYSn6PlY=; fh=p04z/NUdU1ObgzFtFnbL6gWnhLKIevUm+4BOGLp6XB8=; b=ATM5JgHuWSVk6x3DTuVdv4tw3e1sdVUMqQtXBAp5oKNw/t0DRpHGhgu608Ylk3Wr6r vhO6Rk0nCqMCrgJpYyO2o94kxNnoGaXyoTsC6ophHt6Y8hNHGkHdXpB6GZreTf4gTubx UCWLnXPD6E/vqGXxgavZTtxsT9TQP3rWK6faaALg7SgD5yJ/E064+JnsXHleA+UGYpY0 wLgefn95nW1mRQUifDO9pYSOgcTTMvbJrI93DiFG7mx8AyltWowtxVd+7ySAsJKmxjUJ kJ8B1D54bjL2lT8gsfYUSOki2q8jGorfXO8VRaUT0F956L69woodIW7dl8AL+4B3snrf zwgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UI8AfALq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f21-20020ac859d5000000b0043122ffb279si5548824qtf.571.2024.03.30.04.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 04:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UI8AfALq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125702-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 471C31C213CE for ; Sat, 30 Mar 2024 11:33:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5709E39846; Sat, 30 Mar 2024 11:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UI8AfALq" 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 5EB2F383A5 for ; Sat, 30 Mar 2024 11:32:49 +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=1711798369; cv=none; b=ZnG2rVHQpsGM1404PfqycIqULzaE2So5knE1GezTmza8PcAb6eD+PnqHVGi/OIfml1T91RDMo0EMmMJs4Fr0e2sj0EvNUPp7rRlpDywKutGnP15GDwx6fsfeaTHu6oOAM1wm4ft/3pIWOhzAJINzp6WPFJ1f2uHOvrUiFvy08ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711798369; c=relaxed/simple; bh=59t14P97Qbus2k7ECGdDRfg5v7qHQzW7QSOAb39Y840=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=rG8iYOoLb4ZT16Ymk8nHIHPB4g3A3cZmToBgwdidN7ZDuiXKz3T7lcoK4cS5dVMmr7APoNUphDfMRg0hEfDxxtlH2/DAaKrSoC4i96gM+02nm/W7nbQMcWVDhZaQKA5uv6tgLUOScnW/fV3VjYsO0t+Z9enpPWpsvezHm5Ih5Pk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UI8AfALq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8FB8C433F1; Sat, 30 Mar 2024 11:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711798368; bh=59t14P97Qbus2k7ECGdDRfg5v7qHQzW7QSOAb39Y840=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=UI8AfALqa5k08DmOn0ncQGJ6dPo6DXfPJCLns+pNs/e3FsDwAvZOmyNaX4MrwE51K smIJTvT7idUGoFXigrO0k7y7DZlzpJksYmrxdMVyth1XtySR1y3AOH3uP0xY5Y6PZb zLYY6n8sz6CgWI5k389/TdlF4XGtgCbOEOsSjHGf/D9yQMPdD+1Ga+14AaksAehmqR PrTAID0Wrl7DZYE8S8Znb/spWMN6yYsgyspYdGbahpt1M5uFlDtySZI6VnEhe/EU3A w9+fF8rQ2LmyspSg4C8K2uLIlKmBAHccQLpnTnfD+uO0bxxXqCvKBjhU4OYKAmxhkW pUPlnusm/ZwXQ== 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: Sat, 30 Mar 2024 13:32:42 +0200 Message-Id: Cc: "Mark Rutland" , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules From: "Jarkko Sakkinen" To: "Masami Hiramatsu" 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> <20240328084701.84aacecba30e83a9ce08a6d8@kernel.org> In-Reply-To: <20240328084701.84aacecba30e83a9ce08a6d8@kernel.org> On Thu Mar 28, 2024 at 1:47 AM EET, Masami Hiramatsu (Google) wrote: > On Wed, 27 Mar 2024 19:46:50 +0200 > "Jarkko Sakkinen" wrote: > > > 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(stru= ct kprobe *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 t= race_kprobe *tk) > > > > > > { > > > > > > char *p; > > > > > > @@ -129,6 +130,9 @@ static nokprobe_inline bool trace_kprobe_mo= dule_exist(struct trace_kprobe *tk) > > > > > > =20 > > > > > > return ret; > > > > > > } > > > > > > +#else > > > > > > +#define trace_kprobe_module_exist(tk) false /* aka a module ne= ver 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 tra= ce_kprobe *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(str= uct 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/lo= g/?h=3Dkprobes/without-modules > > > >=20 > > > > I'll hold off sending that out to the list until other folk have ha= d a chance > > > > to comment. > > > > > > Yeah, the updated one looks good to me too. > > > > > > Thanks! > >=20 > > As for RISC-V: > >=20 > > Tested-by: Jarkko Sakkinen # arch/riscv > > Thank you for testing! > > >=20 > > 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). > > Except for the 1st patch because that is for arm64, right? :) Right! For that not required :-) > > >=20 > > Just adding disclaimer because depending on subsystem people > > are more or less strict with this tag :-) > >=20 > > BR, Jarkko > > Thanks, BR, Jarkko