All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] [v3]: nvme: fixup module compilation
@ 2023-10-25  8:12 Hannes Reinecke
  2023-10-25  8:12 ` [PATCH 1/2] nvme: common: make keyring and auth separate modules Hannes Reinecke
  2023-10-25  8:12 ` [PATCH 2/2] nvme: keyring: fix conditional compilation Hannes Reinecke
  0 siblings, 2 replies; 27+ messages in thread
From: Hannes Reinecke @ 2023-10-25  8:12 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

Hi all,

Arnd noticed that the module selection between keyring and
host/target code fails under certain combinations.
This patchset addresses this by making 'keyring' into a
'proper' module by adding module_init()/module_exit() functions.

Arnd Bergmann (1):
  nvme: common: make keyring and auth separate modules
  nvme: keyring: fix conditional compilation

 drivers/nvme/Makefile         |  2 +-
 drivers/nvme/common/Kconfig   |  7 ++-----
 drivers/nvme/common/Makefile  |  7 ++++---
 drivers/nvme/common/keyring.c | 11 +++++++----
 drivers/nvme/host/Kconfig     |  2 --
 drivers/nvme/host/core.c      |  9 +--------
 drivers/nvme/target/Kconfig   |  2 --
 include/linux/nvme-keyring.h  | 10 +---------
 8 files changed, 16 insertions(+), 34 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH 0/2] [v4] nvme: fixup module compilation
@ 2023-10-26 13:08 Hannes Reinecke
  2023-10-26 13:08 ` [PATCH 2/2] nvme: keyring: fix conditional compilation Hannes Reinecke
  0 siblings, 1 reply; 27+ messages in thread
From: Hannes Reinecke @ 2023-10-26 13:08 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

Hi all,

Arnd noticed that the module selection between keyring and
host/target code fails under certain combinations.
This patchset addresses this by making 'keyring' into a
'proper' module by adding module_init()/module_exit() functions
and ensure that the module will always be compiled in when
one of the dependent modules are selected.

Arnd Bergmann (1):
  nvme: common: make keyring and auth separate modules

Hannes Reinecke (1):
  nvme: keyring: fix conditional compilation

 drivers/nvme/Makefile         |  2 +-
 drivers/nvme/common/Kconfig   |  5 +----
 drivers/nvme/common/Makefile  |  7 ++++---
 drivers/nvme/common/keyring.c | 11 +++++++----
 drivers/nvme/host/Kconfig     |  4 +---
 drivers/nvme/host/core.c      |  9 +--------
 drivers/nvme/target/Kconfig   |  4 +---
 include/linux/nvme-keyring.h  |  8 --------
 8 files changed, 16 insertions(+), 34 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 27+ messages in thread
* [PATCH 1/2] nvme: common: make keyring and auth separate modules
@ 2023-10-20 13:05 Arnd Bergmann
  2023-10-20 13:05 ` [PATCH 2/2] nvme: keyring: fix conditional compilation Arnd Bergmann
  0 siblings, 1 reply; 27+ messages in thread
From: Arnd Bergmann @ 2023-10-20 13:05 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Hannes Reinecke
  Cc: Arnd Bergmann, linux-kernel, linux-nvme

From: Arnd Bergmann <arnd@arndb.de>

When only the keyring module is included but auth is not, modpost
complains about the lack of a module license tag:

ERROR: modpost: missing MODULE_LICENSE() in drivers/nvme/common/nvme-common.o

Address this by making both modules buildable standalone,
removing the now unnecessary CONFIG_NVME_COMMON symbol
in the process.

Fixes: 9d77eb5277849 ("nvme-keyring: register '.nvme' keyring")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/nvme/Makefile         | 2 +-
 drivers/nvme/common/Kconfig   | 4 ++--
 drivers/nvme/common/Makefile  | 7 ++++---
 drivers/nvme/common/keyring.c | 2 ++
 drivers/nvme/host/Kconfig     | 2 --
 drivers/nvme/target/Kconfig   | 2 --
 include/linux/nvme-keyring.h  | 2 +-
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/nvme/Makefile b/drivers/nvme/Makefile
index eedca8c720983..74f59ceed3d5a 100644
--- a/drivers/nvme/Makefile
+++ b/drivers/nvme/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-obj-$(CONFIG_NVME_COMMON)		+= common/
+obj-y		+= common/
 obj-y		+= host/
 obj-y		+= target/
diff --git a/drivers/nvme/common/Kconfig b/drivers/nvme/common/Kconfig
index 06c8df00d1e21..63d4fd45999dc 100644
--- a/drivers/nvme/common/Kconfig
+++ b/drivers/nvme/common/Kconfig
@@ -4,11 +4,11 @@ config NVME_COMMON
        tristate
 
 config NVME_KEYRING
-       bool
+       tristate
        select KEYS
 
 config NVME_AUTH
-	bool
+	tristate
 	select CRYPTO
 	select CRYPTO_HMAC
 	select CRYPTO_SHA256
diff --git a/drivers/nvme/common/Makefile b/drivers/nvme/common/Makefile
index 0cbd0b0b8d499..681514cf2e2f5 100644
--- a/drivers/nvme/common/Makefile
+++ b/drivers/nvme/common/Makefile
@@ -2,7 +2,8 @@
 
 ccflags-y			+= -I$(src)
 
-obj-$(CONFIG_NVME_COMMON)	+= nvme-common.o
+obj-$(CONFIG_NVME_AUTH)		+= nvme-auth.o
+obj-$(CONFIG_NVME_KEYRING)	+= nvme-keyring.o
 
-nvme-common-$(CONFIG_NVME_AUTH)	+= auth.o
-nvme-common-$(CONFIG_NVME_KEYRING) += keyring.o
+nvme-auth-y			+= auth.o
+nvme-keyring-y			+= keyring.o
diff --git a/drivers/nvme/common/keyring.c b/drivers/nvme/common/keyring.c
index f8d9a208397b4..46d7a537dbc2e 100644
--- a/drivers/nvme/common/keyring.c
+++ b/drivers/nvme/common/keyring.c
@@ -180,3 +180,5 @@ void nvme_keyring_exit(void)
 	key_put(nvme_keyring);
 }
 EXPORT_SYMBOL_GPL(nvme_keyring_exit);
+
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 48f7d72de5e9a..8fe2dd619e80e 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -95,7 +95,6 @@ config NVME_TCP
 config NVME_TCP_TLS
 	bool "NVMe over Fabrics TCP TLS encryption support"
 	depends on NVME_TCP
-	select NVME_COMMON
 	select NVME_KEYRING
 	select NET_HANDSHAKE
 	select KEYS
@@ -110,7 +109,6 @@ config NVME_TCP_TLS
 config NVME_HOST_AUTH
 	bool "NVM Express over Fabrics In-Band Authentication"
 	depends on NVME_CORE
-	select NVME_COMMON
 	select NVME_AUTH
 	help
 	  This provides support for NVMe over Fabrics In-Band Authentication.
diff --git a/drivers/nvme/target/Kconfig b/drivers/nvme/target/Kconfig
index fa479c9f5c3d3..31633da9427c7 100644
--- a/drivers/nvme/target/Kconfig
+++ b/drivers/nvme/target/Kconfig
@@ -87,7 +87,6 @@ config NVME_TARGET_TCP
 config NVME_TARGET_TCP_TLS
 	bool "NVMe over Fabrics TCP target TLS encryption support"
 	depends on NVME_TARGET_TCP
-	select NVME_COMMON
 	select NVME_KEYRING
 	select NET_HANDSHAKE
 	select KEYS
@@ -102,7 +101,6 @@ config NVME_TARGET_TCP_TLS
 config NVME_TARGET_AUTH
 	bool "NVMe over Fabrics In-band Authentication support"
 	depends on NVME_TARGET
-	select NVME_COMMON
 	select NVME_AUTH
 	help
 	  This enables support for NVMe over Fabrics In-band Authentication
diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h
index 4efea9dd967c1..6cc0696625f36 100644
--- a/include/linux/nvme-keyring.h
+++ b/include/linux/nvme-keyring.h
@@ -6,7 +6,7 @@
 #ifndef _NVME_KEYRING_H
 #define _NVME_KEYRING_H
 
-#ifdef CONFIG_NVME_KEYRING
+#if IS_ENABLED(CONFIG_NVME_KEYRING)
 
 key_serial_t nvme_tls_psk_default(struct key *keyring,
 		const char *hostnqn, const char *subnqn);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-11-07 17:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25  8:12 [PATCH 0/2] [v3]: nvme: fixup module compilation Hannes Reinecke
2023-10-25  8:12 ` [PATCH 1/2] nvme: common: make keyring and auth separate modules Hannes Reinecke
2023-10-26 11:50   ` Christoph Hellwig
2023-10-25  8:12 ` [PATCH 2/2] nvme: keyring: fix conditional compilation Hannes Reinecke
2023-10-25  8:20   ` Arnd Bergmann
2023-10-25  9:11     ` Hannes Reinecke
2023-10-25 12:16       ` Arnd Bergmann
2023-10-25 15:00         ` Hannes Reinecke
2023-10-25 15:35           ` Arnd Bergmann
2023-10-26 11:58             ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2023-10-26 13:08 [PATCH 0/2] [v4] nvme: fixup module compilation Hannes Reinecke
2023-10-26 13:08 ` [PATCH 2/2] nvme: keyring: fix conditional compilation Hannes Reinecke
2023-10-26 13:37   ` Arnd Bergmann
2023-10-26 14:20     ` Hannes Reinecke
2023-10-26 14:44       ` Arnd Bergmann
2023-10-27  5:21       ` Christoph Hellwig
2023-10-27  6:01         ` Hannes Reinecke
2023-10-27  8:12           ` Arnd Bergmann
2023-10-27  8:30             ` Christoph Hellwig
2023-10-27  8:54               ` Hannes Reinecke
2023-10-27  8:56                 ` Christoph Hellwig
2023-10-27  9:08                   ` Hannes Reinecke
2023-10-27  9:14                     ` Arnd Bergmann
2023-10-27  9:21                     ` Christoph Hellwig
2023-11-07 17:49                       ` Keith Busch
2023-10-20 13:05 [PATCH 1/2] nvme: common: make keyring and auth separate modules Arnd Bergmann
2023-10-20 13:05 ` [PATCH 2/2] nvme: keyring: fix conditional compilation Arnd Bergmann
2023-10-20 13:50   ` Hannes Reinecke
2023-10-20 14:56     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.