From patchwork Mon Nov 11 10:54:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870627 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 C370E187844; Mon, 11 Nov 2024 11:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323938; cv=none; b=Pkv3okJa2i5dNCHZFhUh1XG8zALf7aWfmHnC1OtywAMZKIIzL1N1SnBJJbpt8yzsKGBiDpBPsomhzXz8HivWue5PBsVKvHVEEHJQ55TSdZb+tS+Q0LM5fTtPqMkPnR/wMYNhKK/kNZ43E3mVj9EGiqzG1pDG+WgRsCgqkYp8vXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323938; c=relaxed/simple; bh=LlZyfn7s6X5ZnMgdIhtpHnD2PaPvqkbq7NHeKVuGWRs=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=mnAsV71BqeCva3WYImpo1BSRKFsZDgW5b/5YO6msdfnAD19k+y4EoK0FasQI5h6lroI/jABDVk4mm3lbkpE/GvdjaZVfkIQMUkvJqEMKQx4+bX3kkjPqPLwFUVxSSypBKI6C2xivFW3HXh6YmCO62I02qBrBnnbOnMSAo6QxYls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=JQWTLkn6; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JQWTLkn6" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=PPoVrorGxnDtycLjsN//BVA/+ToqmOKYjcENc61e4vk=; b=JQWTLkn6bxmk/SwLRYA8YQGbqI Adgnu5Txb8si/+s9PAvvusk2eGZorH5LV3xHvgSfmBnJf11GX7ksmjjJCgnkUDDs22fdsmNEmvG2l yejcamDKU8Ig2Tki6hXVMU8Sf6zEkyw1zn2kRSxVFI6VPwSzkyijSygcjrdM8nByUEMvIrda0FnEM Knf6EDEFDURhnDyTwJq2T79aKOz/nzYyHHPOC5lh2z+VvS/ANB7qBz3E5jzt1xzNXROy8OIicMPBu pl8bHZyog6Sdra+MA3FqEpSiJHFHzVb917MSj7LVQs1yHFOUXKoXHmXrFRXThegZKfY3qD7irEkal uDT7DD/Q==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRT-0000000Cpw6-21qh; Mon, 11 Nov 2024 11:18:47 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id EBA8E300DDC; Mon, 11 Nov 2024 12:18:46 +0100 (CET) Message-Id: <20241111111816.912388412@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:31 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 1/8] module: Prepare for script References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since sed doesn't like multi-line make sure all EXPORT_SYMBOL_NS things are a single line. Signed-off-by: Peter Zijlstra (Intel) --- drivers/crypto/marvell/octeontx2/otx2_cptlf.c | 12 ++++-------- include/kunit/visibility.h | 3 +-- sound/soc/codecs/tas2781-fmwlib.c | 6 ++---- 3 files changed, 7 insertions(+), 14 deletions(-) --- a/drivers/crypto/marvell/octeontx2/otx2_cptlf.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptlf.c @@ -288,8 +288,7 @@ void otx2_cptlf_unregister_misc_interrup cptlf_set_misc_intrs(lfs, false); } -EXPORT_SYMBOL_NS_GPL(otx2_cptlf_unregister_misc_interrupts, - CRYPTO_DEV_OCTEONTX2_CPT); +EXPORT_SYMBOL_NS_GPL(otx2_cptlf_unregister_misc_interrupts, CRYPTO_DEV_OCTEONTX2_CPT); void otx2_cptlf_unregister_done_interrupts(struct otx2_cptlfs_info *lfs) { @@ -308,8 +307,7 @@ void otx2_cptlf_unregister_done_interrup cptlf_set_done_intrs(lfs, false); } -EXPORT_SYMBOL_NS_GPL(otx2_cptlf_unregister_done_interrupts, - CRYPTO_DEV_OCTEONTX2_CPT); +EXPORT_SYMBOL_NS_GPL(otx2_cptlf_unregister_done_interrupts, CRYPTO_DEV_OCTEONTX2_CPT); static int cptlf_do_register_interrrupts(struct otx2_cptlfs_info *lfs, int lf_num, int irq_offset, @@ -351,8 +349,7 @@ int otx2_cptlf_register_misc_interrupts( otx2_cptlf_unregister_misc_interrupts(lfs); return ret; } -EXPORT_SYMBOL_NS_GPL(otx2_cptlf_register_misc_interrupts, - CRYPTO_DEV_OCTEONTX2_CPT); +EXPORT_SYMBOL_NS_GPL(otx2_cptlf_register_misc_interrupts, CRYPTO_DEV_OCTEONTX2_CPT); int otx2_cptlf_register_done_interrupts(struct otx2_cptlfs_info *lfs) { @@ -375,8 +372,7 @@ int otx2_cptlf_register_done_interrupts( otx2_cptlf_unregister_done_interrupts(lfs); return ret; } -EXPORT_SYMBOL_NS_GPL(otx2_cptlf_register_done_interrupts, - CRYPTO_DEV_OCTEONTX2_CPT); +EXPORT_SYMBOL_NS_GPL(otx2_cptlf_register_done_interrupts, CRYPTO_DEV_OCTEONTX2_CPT); void otx2_cptlf_free_irqs_affinity(struct otx2_cptlfs_info *lfs) { --- a/include/kunit/visibility.h +++ b/include/kunit/visibility.h @@ -24,8 +24,7 @@ * in test file in order to use symbols. * @symbol: the symbol identifier to export */ - #define EXPORT_SYMBOL_IF_KUNIT(symbol) EXPORT_SYMBOL_NS(symbol, \ - EXPORTED_FOR_KUNIT_TESTING) + #define EXPORT_SYMBOL_IF_KUNIT(symbol) EXPORT_SYMBOL_NS(symbol, EXPORTED_FOR_KUNIT_TESTING) #else #define VISIBLE_IF_KUNIT static #define EXPORT_SYMBOL_IF_KUNIT(symbol) --- a/sound/soc/codecs/tas2781-fmwlib.c +++ b/sound/soc/codecs/tas2781-fmwlib.c @@ -2310,8 +2310,7 @@ int tasdevice_select_tuningprm_cfg(void out: return prog_status; } -EXPORT_SYMBOL_NS_GPL(tasdevice_select_tuningprm_cfg, - SND_SOC_TAS2781_FMWLIB); +EXPORT_SYMBOL_NS_GPL(tasdevice_select_tuningprm_cfg, SND_SOC_TAS2781_FMWLIB); int tasdevice_prmg_load(void *context, int prm_no) { @@ -2392,8 +2391,7 @@ void tasdevice_tuning_switch(void *conte TASDEVICE_BIN_BLK_PRE_SHUTDOWN); } } -EXPORT_SYMBOL_NS_GPL(tasdevice_tuning_switch, - SND_SOC_TAS2781_FMWLIB); +EXPORT_SYMBOL_NS_GPL(tasdevice_tuning_switch, SND_SOC_TAS2781_FMWLIB); MODULE_DESCRIPTION("Texas Firmware Support"); MODULE_AUTHOR("Shenghao Ding, TI, "); From patchwork Mon Nov 11 10:54:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870625 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B282318660C; Mon, 11 Nov 2024 11:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323937; cv=none; b=rjo3TCaM1hrDxLPmMOVbLAlueJQJn1w4FGk2xpGi7fMzJwRWqi5DPr1qTcjpu7dvFIrci1AlXeYr0rmG4NJK+G4FnngLc4LV63WADHYlV2h7G/QI+YFIGR/VXXoQuXdYdVHWUQTq45J5r361JyGwp7ncmKWDchy4FNzJ0c7163o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323937; c=relaxed/simple; bh=wAXGrCis2erKKnFBJ8avbS/b2YZc5XjQdw18YRo39tE=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=tb9btXUiSMKJEjlnxn1oc2F/ovlrHZr1YYFJ4vY34+ve7Fnt7YFatMRUUuSw13oTrLuhkRyOMHri/eTjXqYbdtmIkHv1eBK5Xz7AJOLQVNwqLNzFSPR5t44ykqZm6hKpwHdC9B8Rjw7vpVqGajRnOejcuz+8T/dxgVC/hoGDYIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=cEqNPzd6; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cEqNPzd6" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=/pFudQu1OVkP6rdTvBnjU8AKlbsmkvlwxkmlg5TAne0=; b=cEqNPzd6SnzU+t4/RmLbYzZdMb 8aR7IbDyof4l/Mi/2qPdgKAZnhu64rviBvsu9chCymn+LzyjPHthGCIX7tiCxQgJwn3rukuSse7l7 4grRE7VbXC8rALjQymartMxp6cNjbt+0UEmHzVrtfchQ/ZQwigLFXMzmZZxlxBhv4WjaH+jL0laOr wUqXvXSWz/3KQFJpGaNnBbkamDsqODMPelfyDRBzcMQH7gKzmgvqmXpVtLkN9vVCoY8f6JFVOfwfJ qZvYLwHaN+FCX8U3dg9fVlMQ7PXzClPCKliAj/rsygf+XURJF6TNH8UAWANQpMYiJhVmfnSs5Tw1o kY8X3s8A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRT-0000000Cpw8-2420; Mon, 11 Nov 2024 11:18:47 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 003AC30083E; Mon, 11 Nov 2024 12:18:46 +0100 (CET) Message-Id: <20241111111817.136750440@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:33 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 3/8] module: Fix up after script References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Peter Zijlstra (Intel) --- include/linux/export.h | 4 ++-- include/linux/module.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/include/linux/export.h +++ b/include/linux/export.h @@ -67,7 +67,7 @@ #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "") #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "GPL") -#define EXPORT_SYMBOL_NS(sym, "ns") __EXPORT_SYMBOL(sym, "", __stringify(ns)) -#define EXPORT_SYMBOL_NS_GPL(sym, "ns") __EXPORT_SYMBOL(sym, "GPL", __stringify(ns)) +#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", ns) +#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "GPL", ns) #endif /* _LINUX_EXPORT_H */ --- a/include/linux/module.h +++ b/include/linux/module.h @@ -296,7 +296,7 @@ extern typeof(name) __mod_##type##__##na * files require multiple MODULE_FIRMWARE() specifiers */ #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) -#define MODULE_IMPORT_NS("ns") MODULE_INFO(import_ns, __stringify(ns)) +#define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, ns) struct notifier_block; From patchwork Mon Nov 11 10:54:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870628 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B27CA156F44; Mon, 11 Nov 2024 11:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323938; cv=none; b=Sar9A281GVeDqii5z5E2Pk5+ipXVia1MbPR6edkHHevH1QL/oao8MhDZoFDJWUdEty9K/VJCS01kdMdk49lNluwxThH+02EvlmOSdy7NKRcTTGwQ7910JI3MSXRI406p5X7WmzDZO5qH1ZtcPtiBfUdDUWfochcf1xut97q30Ow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323938; c=relaxed/simple; bh=ICOg1urReFlrbqKpNdpCrFXGtC8QcWkJbyQIfD2HIMs=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=MgMdw/Yta/F4GSQWTMRdek0Pm3CfdwNcHt26WRuAQiczanXzdkesABF53irF2iriwSyZoT76nH4LdRDeLFlBes6i9kdR4Uard4W2dEYbpp7LVYxLc5XycWPjl9XokhouXjsAld4AsPK9wOeqYrKX2Rs/47jstKm2L4d4A/MDqkE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=A2kZgLmU; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="A2kZgLmU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=GKPMvBRLR7vZ9BJ6H1VKy/+n8A02WSymmS041p20eEQ=; b=A2kZgLmUDe0momfuDz3nJkXmGO mv73I836/RYc9jtfXJMN5qEuZXVg0dOuH5+l9/DBrAqA50CS0XAca/xMPUBhtvPDLxmW8QdqjJYnO WcawviSnSyZwZ7zlqYVLADLt0gWU/OP3j9DtyOLy5//X4Y6PxxGOJbHrCgichHmTbnw/2C0kn4abu WJNKtz65OEz8FttRWx5i9jTDTOagI3Z3p6xBIYB9ujfF35n/8Ryv/GAFAMP0sIXrS6QRaaDzZqmRV ADWFHwB52ea8AKwwWNLZ9CnhfHcw8xuAewGLSRJyvEUC1wGOBIBpd7FoP0ykktUf40zoOhPQbI1Ak /4Sr3XGw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRT-0000000Cpw9-20Zh; Mon, 11 Nov 2024 11:18:47 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 04C73300F1A; Mon, 11 Nov 2024 12:18:47 +0100 (CET) Message-Id: <20241111111817.244594188@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:34 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 4/8] module/modpost: Use for() loop References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Peter Zijlstra (Intel) --- scripts/mod/modpost.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1586,12 +1586,9 @@ static void read_symbols(const char *mod license = get_next_modinfo(&info, "license", license); } - namespace = get_modinfo(&info, "import_ns"); - while (namespace) { + for (namespace = get_modinfo(&info, "import_ns"); namespace; + namespace = get_next_modinfo(&info, "import_ns", namespace)) add_namespace(&mod->imported_namespaces, namespace); - namespace = get_next_modinfo(&info, "import_ns", - namespace); - } if (extra_warn && !get_modinfo(&info, "description")) warn("missing MODULE_DESCRIPTION() in %s\n", modname); From patchwork Mon Nov 11 10:54:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870630 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 049B8189B88; Mon, 11 Nov 2024 11:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323939; cv=none; b=GFltwyf4gs6WKSz0AV2N5unRp7KTH+YuS/vOo5t2ApZK5boVuAzPkhX/1lYKWMwZO1mnTQ91+T7U/iUmJFfa2cJc7O46UToUfilLRnIiujap70vvtsCiHub3W44Q/XYJh14eHMQcEKWzaMak5BOMV1DEjs7rQX0HCAi9ckYBjpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323939; c=relaxed/simple; bh=epoKNUw20KjRIxmQqCsJhCOrh6ujz3BwXBFxQJARgCM=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=i1M4BHUE5u2p3rqBJtP0ZpkhKvyzNHy46k3AJ7Lck9TJTmQxIp+LKfa7/82pSYLP3YTL3H1yy8bxGTV7sOOEOnNGKw3gvWwE9N4R8uAWHkhV8PkMQRn5wnIH6z9ibHejYmd2qydf6cIw9Zx/wojCDH1i2ToiI/jS8p4LEY57eOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=dPd0QQQ4; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dPd0QQQ4" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=pv+FVEk471RGcZ+dK0zuN25EA0xObldSGsurRFVCsFs=; b=dPd0QQQ4xxwsnXTz8BnI2WWdVt Dx0+uXv+33NncKT+XYluCNZFg6RKp2m4PdpF95I17VU3/b071r1/jQt88bjtikPKOVaCNGYh8HDwT UAHZYCF7qGo6oB48Q2TBXJSX+43+b66POWG0FY02agwza6VYFsMMMRKzGhWtP9j7q7YnYmztgsbHy yWdTnmlICquvoKcofL1azNECQHVusi2NNidsxuTSaIUHYvxzUBl9MfwYRkVrgZeMMQa/mu1eAowoX CJZWTHGBNNQb4tswvmFGZ7ZrN1A8w1cXtnT2hgV+gGPVWqjWy8deFfvYLrZV6kxlYWcNvoGwx1Scm ZfXfVuBg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRU-0000000CpwK-1kBF; Mon, 11 Nov 2024 11:18:48 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 098A630114C; Mon, 11 Nov 2024 12:18:47 +0100 (CET) Message-Id: <20241111111817.387887920@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:35 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 5/8] module/modpost: Add basename helper References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Peter Zijlstra (Intel) --- scripts/mod/modpost.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1553,6 +1553,16 @@ static void mod_set_crcs(struct module * free(buf); } +static const char *mod_basename(const char *modname) +{ + const char *basename = strrchr(modname, '/'); + if (basename) + basename++; + else + basename = modname; + return basename; +} + static void read_symbols(const char *modname) { const char *symname; @@ -1697,11 +1707,7 @@ static void check_exports(struct module s->crc_valid = exp->crc_valid; s->crc = exp->crc; - basename = strrchr(mod->name, '/'); - if (basename) - basename++; - else - basename = mod->name; + basename = mod_basename(mod->name); if (!contains_namespace(&mod->imported_namespaces, exp->namespace)) { modpost_log(!allow_missing_ns_imports, From patchwork Mon Nov 11 10:54:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870631 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 3EC9E19AD73; Mon, 11 Nov 2024 11:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323941; cv=none; b=ceXlq3v81YqHTap6PwAsnWkepTtTHnRmDvAYoZsCEbNlLjMWHUbyKqzX/v10Trg2Sckq6EIVFGlvEqMDbhrD8P4NpO4upN0EVcuN6mnfsm/zvVyY6CP1eJH9OtKYVocGxS/sSDneC/kSA6+eI9cezA0zGmfW7bmvMOxewbVIFq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323941; c=relaxed/simple; bh=XHnTJHOPYtZIDpwCX8Qj4Gyauad1xJ05yQqNtHbIPkY=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=WfLMbkedPFDzaZQtinM82Woyj65uP5loKJLj8pb6IAtKqrQuTFVIqpnXyZBa3MVPoIV6R1m0a7gBdZAsfOg08ig0rfN0Rj1DllhiTNhAGCnQFruan8UJDIUytHC+E+1B6/YIK8yCJN8Mnw66ZDbSbzNWzOFe1F3f1d+anh8QHRk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Tf4vS9Dl; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Tf4vS9Dl" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=aGjvucfOz39yLyUBScLYaZkWFoL5jwssjx5+IvdVnTE=; b=Tf4vS9DlqPq+tWaiyxNstrYCKE quaemMrjgj9A1i/MRz5CAunj225OaYaH53gDtdE4ttBzuVhGSKiWa7aBSsGAJiD64MkmceO9HsX6w +5S5jctlk4Gqjf+2FVagwftbBDgyFa8OIf5aovoY+sfV3l6aIEUb9jgyBZuj2+CyzvC3LR+eNcGDX PxtsxSUZGRLNYNLyvtytUh3XFahx/3vTirrGTNw7D5KuXHiida5sqJ3e4xfBGelk2CLPWz3tfkHoq GYzZzvPo6I1cSEHAqBhCg/ZzR0uMviD3MvA/4+n0TQlAAcnxtoebn339aELra1TFXNmurU+r5YtbN yNcrlTCA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRU-0000000CiRC-3Vfh; Mon, 11 Nov 2024 11:18:48 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 0D79930122C; Mon, 11 Nov 2024 12:18:47 +0100 (CET) Message-Id: <20241111111817.532312508@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:36 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 6/8] module: Add module specific symbol namespace support References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Designate the "MODULE_${modname}" symbol namespace to mean: 'only export to the named module'. Notably, explicit imports of anything in the "MODULE_" space is forbidden. Modules implicitly get the "MODULE_${modname}" namespace added. Signed-off-by: Peter Zijlstra (Intel) --- kernel/module/main.c | 28 ++++++++++++++++++++++++++-- scripts/mod/modpost.c | 5 +++++ 2 files changed, 31 insertions(+), 2 deletions(-) --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -1070,6 +1070,13 @@ static int verify_namespace_is_imported( namespace = kernel_symbol_namespace(sym); if (namespace && namespace[0]) { + /* + * Implicitly import MODULE_${mod->name} namespace. + */ + if (strncmp(namespace, "MODULE_", 7) == 0 && + strcmp(namespace+7, mod->name) == 0) + return 0; + for_each_modinfo_entry(imported_namespace, info, "import_ns") { if (strcmp(namespace, imported_namespace) == 0) return 0; @@ -1613,15 +1620,30 @@ static void module_license_taint_check(s } } -static void setup_modinfo(struct module *mod, struct load_info *info) +static int setup_modinfo(struct module *mod, struct load_info *info) { struct module_attribute *attr; + char *imported_namespace; int i; for (i = 0; (attr = modinfo_attrs[i]); i++) { if (attr->setup) attr->setup(mod, get_modinfo(info, attr->attr.name)); } + + for_each_modinfo_entry(imported_namespace, info, "import_ns") { + /* + * 'MODULE_' prefixed namespaces are implicit, disallow + * explicit imports. + */ + if (strstarts(imported_namespace, "MODULE_")) { + pr_err("%s: module tries to import module namespace: %s\n", + mod->name, imported_namespace); + return -EPERM; + } + } + + return 0; } static void free_modinfo(struct module *mod) @@ -2935,7 +2957,9 @@ static int load_module(struct load_info goto free_unload; /* Set up MODINFO_ATTR fields */ - setup_modinfo(mod, info); + err = setup_modinfo(mod, info); + if (err) + goto free_modinfo; /* Fix up syms, so that st_value is a pointer to location. */ err = simplify_symbols(mod, info); --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1565,6 +1565,7 @@ static const char *mod_basename(const ch static void read_symbols(const char *modname) { + char module_namespace[MODULE_NAME_LEN + 8]; const char *symname; char *version; char *license; @@ -1600,6 +1601,10 @@ static void read_symbols(const char *mod namespace = get_next_modinfo(&info, "import_ns", namespace)) add_namespace(&mod->imported_namespaces, namespace); + snprintf(module_namespace, sizeof(module_namespace), "MODULE_%s", + mod_basename(mod->name)); + add_namespace(&mod->imported_namespaces, module_namespace); + if (extra_warn && !get_modinfo(&info, "description")) warn("missing MODULE_DESCRIPTION() in %s\n", modname); } From patchwork Mon Nov 11 10:54:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870632 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 3ED1B19AD93; Mon, 11 Nov 2024 11:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323942; cv=none; b=ISid5nWvCDe4Rn44bOG8NFybtid24kXHf5TeLEWnT4l21bu4SutoncLynxC4qq4358JyktgWxjIFc7e4r3QXrYNwgjz+c2IDOgAKin2HTQyx4JCb7ZRyYAC7McImw59HCGpS/J3BcejqhAnCByxv+Lok6HOXagLFqfR9wv1EK10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323942; c=relaxed/simple; bh=Gh1yFaFkFcr2xJc52xK1w4jF0RWt4DU76CiOwQOb1Hk=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=pDhJFZeytaeRQK2RhDu1Pz+8FEmWcZsaIelfC8DJw9kI4Q6vaJnAF3Ufq4XxslALxYOQ6PYkLyDot/pGPl4NYqViojmvpBF8BpYBR22QCNPKYJMMicxPDkzqjFnBncQj3kpKSricTrnfO7LMFeusgGxySivYKqv2JTC9BgCxjWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Hn9MmnYb; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Hn9MmnYb" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=jDtXY2bUyMjOXT8/HogIZaen7IxgRS/M1Ecyy8kWGnA=; b=Hn9MmnYbpAiHxDphxtIwcLQRm/ cLd98Qbp2T3Bn6my0O12DOB6zmLe/byE9x1JkbbRbzHHpsvZp0br4ul/5Jt19LkJApdxS63fY4B84 VU2spvwsAegRk+YN9e7kVcRdJKMARQK4x4a7uYIUar4RxvyWp/BzWUcPECrL3/tiBZKnNxcGCvMJR xef6pX4tupKogtXuLzzfsjnhVQofiBUQAcSrNZvz1trTMe4CgcfDqNkCB5KwQWIVSYAjpt6DHwYNU EgCF8ESbNVWEcxaD+uIm0LbaUT+ZQz8k06FpUhvc78UvQDNTsxJ7xqFvQi3pZ6DrRdy3DUuAgmxjA XBgnciiA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRU-0000000CiRD-3TLl; Mon, 11 Nov 2024 11:18:48 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 115163021D3; Mon, 11 Nov 2024 12:18:47 +0100 (CET) Message-Id: <20241111111817.679388337@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:37 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 7/8] module: Extend the MODULE_ namespace parsing References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of only accepting "MODULE_${name}", extend it with a comma separated list of module names and add tail glob support. That is, something like: "MODULE_foo-*,bar" is now possible. Signed-off-by: Peter Zijlstra (Intel) --- kernel/module/main.c | 39 ++++++++++++++++++++++++++++++++++----- scripts/mod/modpost.c | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 11 deletions(-) --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -1061,6 +1061,38 @@ static char *get_modinfo(const struct lo return get_next_modinfo(info, tag, NULL); } +/* + * @namespace ~= "MODULE_foo-*,bar", match @modname to 'foo-*' or 'bar' + */ +static bool verify_module_namespace(const char *namespace, const char *modname) +{ + size_t len, modlen = strlen(modname); + const char *sep; + bool glob; + + if (strncmp(namespace, "MODULE_", 7) != 0) + return false; + + for (namespace += 7; *namespace; namespace = sep) { + sep = strchrnul(namespace, ','); + len = sep - namespace; + + glob = false; + if (sep[-1] == '*') { + len--; + glob = true; + } + + if (*sep) + sep++; + + if (strncmp(namespace, modname, len) == 0 && (glob || len == modlen)) + return true; + } + + return false; +} + static int verify_namespace_is_imported(const struct load_info *info, const struct kernel_symbol *sym, struct module *mod) @@ -1070,11 +1102,8 @@ static int verify_namespace_is_imported( namespace = kernel_symbol_namespace(sym); if (namespace && namespace[0]) { - /* - * Implicitly import MODULE_${mod->name} namespace. - */ - if (strncmp(namespace, "MODULE_", 7) == 0 && - strcmp(namespace+7, mod->name) == 0) + + if (verify_module_namespace(namespace, mod->name)) return 0; for_each_modinfo_entry(imported_namespace, info, "import_ns") { --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1565,7 +1565,6 @@ static const char *mod_basename(const ch static void read_symbols(const char *modname) { - char module_namespace[MODULE_NAME_LEN + 8]; const char *symname; char *version; char *license; @@ -1601,10 +1600,6 @@ static void read_symbols(const char *mod namespace = get_next_modinfo(&info, "import_ns", namespace)) add_namespace(&mod->imported_namespaces, namespace); - snprintf(module_namespace, sizeof(module_namespace), "MODULE_%s", - mod_basename(mod->name)); - add_namespace(&mod->imported_namespaces, module_namespace); - if (extra_warn && !get_modinfo(&info, "description")) warn("missing MODULE_DESCRIPTION() in %s\n", modname); } @@ -1687,6 +1682,38 @@ void buf_write(struct buffer *buf, const buf->pos += len; } +/* + * @namespace ~= "MODULE_foo-*,bar", match @modname to 'foo-*' or 'bar' + */ +static bool module_namespace(const char *namespace, const char *modname) +{ + size_t len, modlen = strlen(modname); + const char *sep; + bool glob; + + if (strncmp(namespace, "MODULE_", 7) != 0) + return false; + + for (namespace += 7; *namespace; namespace = sep) { + sep = strchrnul(namespace, ','); + len = sep - namespace; + + glob = false; + if (sep[-1] == '*') { + len--; + glob = true; + } + + if (*sep) + sep++; + + if (strncmp(namespace, modname, len) == 0 && (glob || len == modlen)) + return true; + } + + return false; +} + static void check_exports(struct module *mod) { struct symbol *s, *exp; @@ -1714,7 +1741,8 @@ static void check_exports(struct module basename = mod_basename(mod->name); - if (!contains_namespace(&mod->imported_namespaces, exp->namespace)) { + if (!module_namespace(exp->namespace, basename) && + !contains_namespace(&mod->imported_namespaces, exp->namespace)) { modpost_log(!allow_missing_ns_imports, "module %s uses symbol %s from namespace %s, but does not import it.\n", basename, exp->name, exp->namespace); From patchwork Mon Nov 11 10:54:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13870626 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 86DE9189B8C; Mon, 11 Nov 2024 11:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323938; cv=none; b=OQy00DCrPQPcp360UllVTn6ihK/zkU2x9kjz9jEhbGDOq9G5v2hazI32bxk6+PdMsSCd1tkBzkMNH+39N5G5uf879C5lAENe9DKnAU7mcbU0FCO3Xa/LLy+FZjD8b0KCyz+zYlpGxhFVwhEgFiZNyL/EseOZhM0mdYeo3XXzBCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323938; c=relaxed/simple; bh=jQc3iETDBc6tRQ9h0BRxDqfkc220WkwrPq9IuxaperY=; h=Message-Id:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rcb1LFZS+NdFqhR2uZeDYbFsp6WLIh9IwuvKd+VqjQSxQ/kpKhfwYt6HLNoQioWBKaX9mGXyqUj2AOzoITU50O7EVroutQjtXN+kIhtWPSAoIxeNi2YbRMdmQVEmttQ0yYcGN3nJiP6Z0N2sZ2g5lvWTZfsMyIVYwEfalLnz47E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=j2OLYZwp; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="j2OLYZwp" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=EuW8AIEfA7ZEbhSbDFIsFL71b7M2MQAgzyGLo9WNeIs=; b=j2OLYZwpQIEMw0H/6EuV+UURf5 505jntmBLe9FaNTX79ZsAZeJ9zk5LpVnXLLRy/WuqiSDo0gkha+uDPpuDhHQXuZWLjc1V0e+yjXuZ 4A3jUXRx3E5cW+BwrTaCwpX41eLpo3/P5fFD0f1n1A933mzHz98E9lkV1ws+b2RNoIMYFc/0WPr8a tAr6NdBQCMiO2t8/7fLlP2FZwwzNREkSW1BqXWcWuZc9FPFueCgqn11jdu7q9cHOpe3HtKUuk96cu SHOwmAjXVMu8bpRrwQ7xniSFXTaoZu8lFOFueAwQ8JNtix9IISnT6eHgtuFjK5dAYgJgI/VV/X0d7 P+rjUcUw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tASRU-0000000CpwL-1p1l; Mon, 11 Nov 2024 11:18:48 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 1514E3021DA; Mon, 11 Nov 2024 12:18:47 +0100 (CET) Message-Id: <20241111111817.826286643@infradead.org> User-Agent: quilt/0.65 Date: Mon, 11 Nov 2024 11:54:38 +0100 From: Peter Zijlstra To: mcgrof@kernel.org Cc: x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com, samitolvanen@google.com, da.gomez@samsung.com, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, hch@infradead.org, gregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: [RFC][PATCH 8/8] module: Provide EXPORT_SYMBOL*_FOR() helpers References: <20241111105430.575636482@infradead.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Because Christoph and Masahiro-san asked for it :-) Signed-off-by: Peter Zijlstra (Intel) --- include/linux/export.h | 3 +++ 1 file changed, 3 insertions(+) --- a/include/linux/export.h +++ b/include/linux/export.h @@ -70,4 +70,7 @@ #define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", ns) #define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "GPL", ns) +#define EXPORT_SYMBOL_FOR(sym, mods) EXPORT_SYMBOL_NS(sym, "MODULE_" mods) +#define EXPORT_SYMBOL_GPL_FOR(sym, mods) EXPORT_SYMBOL_NS_GPL(sym, "MODULE_" mods) + #endif /* _LINUX_EXPORT_H */