Re: depmod warning: unknown symbol usb_stor_sense_invalidCDB in 5.4-rc1

2019-10-01 Thread Matthias Maennich
On Mon, Sep 30, 2019 at 10:45:25PM +0200, Stefan Wahren wrote: Hi, during make modules_install for arm/multi_v7_defconfig on current Linux 5.4-rc1, i'm getting the following warnings: depmod: WARNING: /media/stefan/rootfs//lib/modules/5.4.0-rc1-6-g4a80125-dirty/kernel/drivers/usb/storage/ua

Re: [PATCH v3 06/11] export: allow definition default namespaces in Makefiles or sources

2019-08-28 Thread Matthias Maennich
On Wed, Aug 28, 2019 at 12:49:51PM +0200, Jessica Yu wrote: +++ Matthias Maennich [21/08/19 12:49 +0100]: To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where MY_NAMESPACE will always be the namespace we are exporting to, allow exporting all definitions of EXPORT_SYMBOL() and

Re: [PATCH v3 03/11] module: add support for symbol namespaces.

2019-08-27 Thread Matthias Maennich
On Tue, Aug 27, 2019 at 05:37:18PM +0200, Jessica Yu wrote: +++ Matthias Maennich [21/08/19 12:49 +0100]: The EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL() macros can be used to export a symbol to a specific namespace. There are no _GPL_FUTURE and _UNUSED variants because these are currently

Re: [PATCH v3 04/11] modpost: add support for symbol namespaces

2019-08-27 Thread Matthias Maennich
On Mon, Aug 26, 2019 at 06:21:38PM +0200, Jessica Yu wrote: +++ Matthias Maennich [21/08/19 12:49 +0100]: Add support for symbols that are exported into namespaces. For that, extract any namespace suffix from the symbol name. In addition, emit a warning whenever a module refers to an exported

Re: [v2 08/10] scripts: Coccinelle script for namespace dependencies

2019-08-22 Thread Matthias Maennich
On Thu, Aug 15, 2019 at 03:50:38PM +0200, Markus Elfring wrote: +generate_deps_for_ns() { +$SPATCH --very-quiet --in-place --sp-file \ + $srctree/scripts/coccinelle/misc/add_namespace.cocci -D ns=$1 $2 +} * Where will the variable “srctree” be set for the file “scripts/nsdeps”?

Re: [PATCH v3 10/11] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-22 Thread Matthias Maennich
On Wed, Aug 21, 2019 at 04:13:29PM -0700, Christoph Hellwig wrote: On Wed, Aug 21, 2019 at 12:49:25PM +0100, Matthias Maennich wrote: Modules using these symbols are required to explicitly import the namespace. This patch was generated with the following steps and serves as a reference to use

[PATCH v3 07/11] modpost: add support for generating namespace dependencies

2019-08-21 Thread Matthias Maennich
g Kroah-Hartman Signed-off-by: Matthias Maennich --- .gitignore| 1 + Makefile | 2 +- scripts/mod/modpost.c | 54 +++ scripts/mod/modpost.h | 2 ++ 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.

[PATCH v3 09/11] usb-storage: remove single-use define for debugging

2019-08-21 Thread Matthias Maennich
USB_STORAGE was defined as "usb-storage: " and used in a single location as argument to printk. In order to be able to use the name 'USB_STORAGE', drop the definition and use the string directly for the printk call. Signed-off-by: Matthias Maennich --- drivers/usb/st

[PATCH v3 10/11] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-21 Thread Matthias Maennich
touching their respective EXPORT_SYMBOL macro expansion. Signed-off-by: Matthias Maennich --- drivers/usb/storage/Makefile| 2 ++ drivers/usb/storage/alauda.c| 1 + drivers/usb/storage/cypress_atacb.c | 1 + drivers/usb/storage/datafab.c | 1 + drivers/usb/storage/ene_ub6250

[PATCH v3 08/11] scripts: Coccinelle script for namespace dependencies.

2019-08-21 Thread Matthias Maennich
eloped-by: Martijn Coenen Signed-off-by: Martijn Coenen Acked-by: Julia Lawall Reviewed-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- MAINTAINERS | 5 ++ Makefile| 12 + scripts/Makefile.modpost

[PATCH v3 02/11] export: explicitly align struct kernel_symbol

2019-08-21 Thread Matthias Maennich
ected, the section contents didn't change, and the ELF section alignment only changed on x86_64 and m68k. Feedback from other archs more than welcome. Co-developed-by: Martijn Coenen Signed-off-by: Martijn Coenen Reviewed-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- arch/m

[PATCH v3 01/11] module: support reading multiple values per modinfo tag

2019-08-21 Thread Matthias Maennich
t of the symbol namespaces patch series to read the (potentially) multiple namespaces a module is importing. Reviewed-by: Joel Fernandes (Google) Reviewed-by: Martijn Coenen Reviewed-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- kernel/module.c | 17 +++-- 1 f

[PATCH v3 06/11] export: allow definition default namespaces in Makefiles or sources

2019-08-21 Thread Matthias Maennich
-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- include/linux/export.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/export.h b/include/linux/export.h index 8e12e05444d1..1fb243abdbc4 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -166,6

[PATCH v3 04/11] modpost: add support for symbol namespaces

2019-08-21 Thread Matthias Maennich
Reviewed-by: Joel Fernandes (Google) Reviewed-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- scripts/mod/modpost.c | 91 +-- scripts/mod/modpost.h | 7 2 files changed, 87 insertions(+), 11 deletions(-) diff --git a/scripts/mod

[PATCH v3 03/11] module: add support for symbol namespaces.

2019-08-21 Thread Matthias Maennich
mbols in their own section and use a separate 'struct namespaced_kernel_symbol' for that section, at the cost of making the module loader more complex. Co-developed-by: Martijn Coenen Signed-off-by: Martijn Coenen Reviewed-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- includ

[PATCH v3 05/11] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

2019-08-21 Thread Matthias Maennich
enforcement at module loading time and loading is denied if the module's imports are not satisfactory. Reviewed-by: Martijn Coenen Reviewed-by: Greg Kroah-Hartman Signed-off-by: Matthias Maennich --- init/Kconfig| 13 + kernel/module.c | 11 +-- 2 files change

Re: [PATCH v2 05/10] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

2019-08-14 Thread Matthias Maennich
On Tue, Aug 13, 2019 at 01:15:44PM -0700, Saravana Kannan wrote: On Tue, Aug 13, 2019 at 5:19 AM 'Matthias Maennich' via kernel-team wrote: If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the requirement for modules to import all namespaces that are used by the

Re: [Cocci] [PATCH v2 08/10] scripts: Coccinelle script for namespace dependencies.

2019-08-14 Thread Matthias Maennich
On Wed, Aug 14, 2019 at 12:06:11PM +0530, Himanshu Jha wrote: On Tue, Aug 13, 2019 at 01:17:05PM +0100, Matthias Maennich wrote: A script that uses the '.ns_deps' file generated by modpost to automatically add the required symbol namespace dependencies to each module. Usage: 1)

Re: [PATCH v2 10/10] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-13 Thread Matthias Maennich
On Tue, Aug 13, 2019 at 02:47:08PM +0200, Greg KH wrote: On Tue, Aug 13, 2019 at 01:17:07PM +0100, Matthias Maennich wrote: Modules using these symbols are required to explicitly import the namespace. This patch was generated with the following steps and serves as a reference to use the symbol

[PATCH v2 10/10] RFC: usb-storage: export symbols in USB_STORAGE namespace

2019-08-13 Thread Matthias Maennich
touching their respective EXPORT_SYMBOL macro expansion. Signed-off-by: Matthias Maennich --- drivers/usb/storage/Makefile| 2 ++ drivers/usb/storage/alauda.c| 1 + drivers/usb/storage/cypress_atacb.c | 1 + drivers/usb/storage/datafab.c | 1 + drivers/usb/storage/ene_ub6250

[PATCH v2 08/10] scripts: Coccinelle script for namespace dependencies.

2019-08-13 Thread Matthias Maennich
eloped-by: Martijn Coenen Signed-off-by: Martijn Coenen Signed-off-by: Matthias Maennich --- MAINTAINERS | 5 ++ Makefile| 12 + scripts/Makefile.modpost| 4 +- scripts/coccinelle/misc/add_namesp

[PATCH v2 09/10] usb-storage: remove single-use define for debugging

2019-08-13 Thread Matthias Maennich
USB_STORAGE was defined as "usb-storage: " and used in a single location as argument to printk. In order to be able to use the name 'USB_STORAGE', drop the definition and use the string directly for the printk call. Signed-off-by: Matthias Maennich --- drivers/usb/st

[PATCH v2 0/10] Symbol namespaces - RFC

2019-08-13 Thread Matthias Maennich
been simplified by using DEFAULT_SYMBOL_NAMESPACE=USB_STORAGE rather than explicitly exporting each and every symbol into that new namespace. This patch series was developed against v5.3-rc4. [1] git grep "^EXPORT_SYMBOL\w*(" v5.3-rc4 | wc -l [2] git grep "^EXPORT_SYMBOL\w*(" v4.17

[PATCH v2 07/10] modpost: add support for generating namespace dependencies

2019-08-13 Thread Matthias Maennich
'nsdeps' and a corresponding make target to automatically add missing MODULE_IMPORT_NS() definitions to the module's sources. For that it uses the information provided in the generated .ns_deps files. Co-developed-by: Martijn Coenen Signed-off-by: Martijn Coenen Signed-off-by: Ma

[PATCH v2 04/10] modpost: add support for symbol namespaces

2019-08-13 Thread Matthias Maennich
Reviewed-by: Joel Fernandes (Google) Signed-off-by: Matthias Maennich --- scripts/mod/modpost.c | 91 +-- scripts/mod/modpost.h | 7 2 files changed, 87 insertions(+), 11 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index

[PATCH v2 06/10] export: allow definition default namespaces in Makefiles or sources

2019-08-13 Thread Matthias Maennich
-by: Matthias Maennich --- include/linux/export.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/export.h b/include/linux/export.h index 8e12e05444d1..1fb243abdbc4 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -166,6 +166,12 @@ struct kernel_symbol

[PATCH v2 05/10] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

2019-08-13 Thread Matthias Maennich
enforcement at module loading time and loading is denied if the module's imports are not satisfactory. Reviewed-by: Martijn Coenen Signed-off-by: Matthias Maennich --- init/Kconfig| 14 ++ kernel/module.c | 11 +-- 2 files changed, 23 insertions(+), 2 deletions(-)

[PATCH v2 02/10] export: explicitly align struct kernel_symbol

2019-08-13 Thread Matthias Maennich
ected, the section contents didn't change, and the ELF section alignment only changed on x86_64 and m68k. Feedback from other archs more than welcome. Co-developed-by: Martijn Coenen Signed-off-by: Martijn Coenen Signed-off-by: Matthias Maennich --- arch/m68k/include/asm/export.h | 1 - incl

[PATCH v2 03/10] module: add support for symbol namespaces.

2019-08-13 Thread Matthias Maennich
mbols in their own section and use a separate 'struct namespaced_kernel_symbol' for that section, at the cost of making the module loader more complex. Co-developed-by: Martijn Coenen Signed-off-by: Martijn Coenen Signed-off-by: Matthias Maennich --- include/asm-gener

[PATCH v2 01/10] module: support reading multiple values per modinfo tag

2019-08-13 Thread Matthias Maennich
t of the symbol namespaces patch series to read the (potentially) multiple namespaces a module is importing. Reviewed-by: Joel Fernandes (Google) Reviewed-by: Martijn Coenen Signed-off-by: Matthias Maennich --- kernel/module.c | 17 +++-- 1 file changed, 15 insertions(+), 2 del