Skip to contentSkip to conversation

umd: Remove usermode driver framework

PATCH Applied Thomas Weißschuh 6 participants 16 messages Jul 21, 2025 – Jul 31, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover umd: Remove usermode driver framework

The code is unused, remove it.

---
Thomas Weißschuh (2):
bpf/preload: Don't select USERMODE_DRIVER
umd: Remove usermode driver framework

 include/linux/usermode_driver.h |  19 ----
 kernel/Makefile                 |   1 -
 kernel/bpf/preload/Kconfig      |   5 --
 kernel/usermode_driver.c        | 191 ----------------------------------------
 4 files changed, 216 deletions(-)

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250721-remove-usermode-driver-aecfe2950c59

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
#1 lore raw

PATCH 1/2 bpf/preload: Don't select USERMODE_DRIVER

The usermode driver framework is not used anymore by the BPF preload code.

Fixes cb80ddc67152 ("bpf: Convert bpf_preload.ko to use light skeleton.")
---
 kernel/bpf/preload/Kconfig | 1 -
 1 file changed, 1 deletion(-)
kernel/bpf/preload/Kconfig +0 -1
index c9d45c9d6918d1402dab634e280b56c5c929a858..f9b11d01c3b50d4e98a33c686b55015766d17902 100644
@@ -10,7 +10,6 @@ menuconfig BPF_PRELOAD
 	# The dependency on !COMPILE_TEST prevents it from being enabled
 	# in allmodconfig or allyesconfig configurations
 	depends on !COMPILE_TEST
-	select USERMODE_DRIVER
 	help
 	  This builds kernel module with several embedded BPF programs that are
 	  pinned into BPF FS mount point as human readable files that are
Signature · 1 line
2.50.1
#3 lore raw

PATCH 2/2 umd: Remove usermode driver framework

In reply to Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"), remove it.

---
 include/linux/usermode_driver.h |  19 ----
 kernel/Makefile                 |   1 -
 kernel/bpf/preload/Kconfig      |   4 -
 kernel/usermode_driver.c        | 191 ----------------------------------------
 4 files changed, 215 deletions(-)
include/linux/usermode_driver.h deleted +0 -19
deleted file mode 100644
index ad970416260dd208b43098e17df9ad49b4da7693..0000000000000000000000000000000000000000
@@ -1,19 +0,0 @@
-#ifndef __LINUX_USERMODE_DRIVER_H__
-#define __LINUX_USERMODE_DRIVER_H__
-
-#include <linux/umh.h>
-#include <linux/path.h>
-
-struct umd_info {
-	const char *driver_name;
-	struct file *pipe_to_umh;
-	struct file *pipe_from_umh;
-	struct path wd;
-	struct pid *tgid;
-};
-int umd_load_blob(struct umd_info *info, const void *data, size_t len);
-int umd_unload_blob(struct umd_info *info);
-int fork_usermode_driver(struct umd_info *info);
-void umd_cleanup_helper(struct umd_info *info);
-
-#endif /* __LINUX_USERMODE_DRIVER_H__ */
kernel/Makefile +0 -1
index 32e80dd626af07d0c43290e3f5c64af5bff07b51..4332de7ffdee40f6a1cf77ff4b422b51142838e9 100644
@@ -12,7 +12,6 @@ obj-y     = fork.o exec_domain.o panic.o \
 	    notifier.o ksysfs.o cred.o reboot.o \
 	    async.o range.o smpboot.o ucount.o regset.o ksyms_common.o
 
-obj-$(CONFIG_USERMODE_DRIVER) += usermode_driver.o
 obj-$(CONFIG_MULTIUSER) += groups.o
 obj-$(CONFIG_VHOST_TASK) += vhost_task.o
 
kernel/bpf/preload/Kconfig +0 -4
index f9b11d01c3b50d4e98a33c686b55015766d17902..aef7b0bc96d6113dbca7ab4b9510c3dcf39a97f4 100644
@@ -1,8 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-config USERMODE_DRIVER
-	bool
-	default n
-
 menuconfig BPF_PRELOAD
 	bool "Preload BPF file system with kernel specific program and map iterators"
 	depends on BPF
kernel/usermode_driver.c deleted +0 -191

191 lines not on this page · raw message

Signature · 1 line
2.50.1
#4 lore raw
Quoted 3 lines · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"), remove it.

Correct, but we have plans to use it.
Since it's not causing any problems we prefer to keep it to avoid reverting the removal later.

#5 lore raw
Quoted 9 lines · Alexei Starovoitov
Quoted 3 lines · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"), remove it.

Correct, but we have plans to use it.
Since it's not causing any problems we prefer to keep it to avoid reverting the removal later.

Plans to eventually use something are no reason to keep code that's been unused for almost 2 years around. Unless the removal would conflict with currently queued up in linux-next code it is always better to just drop it and reinstate it when (or rather usually IFF) it is used again.

#6 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines · Alexei Starovoitov
Quoted 3 lines · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"), remove it.

Quoted 8 lines
Quoted 3 lines

Correct, but we have plans to use it.
Since it's not causing any problems we prefer to keep it to avoid reverting the removal later.

Plans to eventually use something are no reason to keep code that's been unused for almost 2 years around. Unless the removal would conflict with currently queued up in linux-next code it is always better to just drop it and reinstate it when (or rather usually IFF) it is used again.

I wonder if those are the same plans that existed in June of 2020 when I split out the usermode driver code from user mode helper?

As far as I know this code has never been seriously used, so I am in favor of simplifying the maintenance burden.

Eric

#8 lore raw
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"),

Overly long commit message here.

75 characters are allowed, no?

Quoted 5 lines
Quoted 1 line

remove it.

Otherwise looks good:

Thanks!

#9 lore raw
Quoted 7 lines · Thomas Weißschuh
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"),

Overly long commit message here.

75 characters are allowed, no?

73.

#10 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 7 lines · Thomas Weißschuh
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"),

Overly long commit message here.

75 characters are allowed, no?

73.

Documentation/process/submitting-patches.rst:

The canonical patch message body contains the following:

(...)

- The body of the explanation, line wrapped at 75 columns, which will be copied to the permanent changelog to describe this patch.

scripts/checkpatch.pl:

	# Check for line lengths > 75 in commit log, warn once
			if ($in_commit_log && !$commit_log_long_line &&
			    length($line) > 75 &&
			      (...)) {
				WARN("COMMIT_LOG_LONG_LINE",
				     "Prefer a maximum 75 chars per line (possible unwrapped commit description?)\n" . $herecurr);
				$commit_log_long_line = 1;
			}

What am I missing?

#11 lore raw
Quoted 8 lines · Thomas Weißschuh

Documentation/process/submitting-patches.rst:

The canonical patch message body contains the following:

(...)

- The body of the explanation, line wrapped at 75 columns, which will be copied to the permanent changelog to describe this patch.

Hmm, weird. I always through we stuck to the usual email length, because in the end that's what commit messages actually are.

But I guess I was wrong, at least since people added this.

#13 lore raw
Quoted 7 lines · Christian Brauner
Quoted 5 lines · Christoph Hellwig
Quoted 1 line · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"),

Overly long commit message here.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

remove it.

Otherwise looks good:

Fair enough. Democracy wins.
Will apply once I'm back from pto.

#14 lore raw
Quoted 10 lines · Alexei Starovoitov
Quoted 9 lines · Christian Brauner
Quoted 7 lines · Christoph Hellwig
Quoted 1 line · Thomas Weißschuh

The code is unused since commit 98e20e5e13d2 ("bpfilter: remove bpfilter"),

Overly long commit message here.

Quoted 1 line

remove it.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Otherwise looks good:

Fair enough. Democracy wins.
Will apply once I'm back from pto.

Fwiw, I honestly don't care that much. I think the removal makes sense precisely because having unused code is usually not a good idea. If you really want that infra you can always reintroduce it once someone actually ends up using it.

#15 lore raw
In reply to Thomas Weißschuh
This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Quoted 9 lines · On Mon, 21 Jul 2025 11:04:40 +0200 you wrote:

The code is unused, remove it.

---
Thomas Weißschuh (2):
bpf/preload: Don't select USERMODE_DRIVER
umd: Remove usermode driver framework

[...]

Here is the summary with links:
- [bpf-next,1/2] bpf/preload: Don't select USERMODE_DRIVER

    https://git.kernel.org/bpf/bpf-next/c/2b03164eee20
  - [bpf-next,2/2] umd: Remove usermode driver framework
    https://git.kernel.org/bpf/bpf-next/c/b7b3500bd4ee

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html