Skip to contentSkip to conversation

um: Some parameter cleanups

PATCH New Tiwei Bie 1 participant 10 messages Oct 11, 2024 User-mode Linux (UML)

lore
Share & tools
lore

Tiwei Bie

author
#0 lore raw

cover um: Some parameter cleanups

Tiwei Bie (9):
um: Remove UML specific debug parameter
um: Do not propagate mem parameter to kernel
um: Do not propagate uml_dir parameter to kernel
um: Do not propagate dtb parameter to kernel
um: Do not propagate noreboot parameter to kernel
hostfs: Do not propagate hostfs parameter to kernel
um: hostaudio: Do not propagate dsp parameter to kernel
um: hostaudio: Do not propagate mixer parameter to kernel
um: Do not propagate initrd parameter to kernel

 arch/um/drivers/hostaudio_kern.c |  2 ++
 arch/um/kernel/dtb.c             |  1 +
 arch/um/kernel/initrd.c          |  1 +
 arch/um/kernel/physmem.c         |  2 ++
 arch/um/kernel/um_arch.c         | 13 -------------
 arch/um/os-Linux/skas/process.c  |  1 +
 arch/um/os-Linux/umid.c          |  2 ++
 fs/hostfs/hostfs_kern.c          |  1 +
 8 files changed, 10 insertions(+), 13 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/9 um: Remove UML specific debug parameter

It does nothing but emit a warning when 'debug' is provided in the kernel command line. It can be a bit annoying, as 'debug' is also a valid kernel parameter to enable kernel debugging.

---
 arch/um/kernel/um_arch.c | 13 -------------
 1 file changed, 13 deletions(-)
arch/um/kernel/um_arch.c +0 -13
index 38cbb41a64bc..6d755a37d5c4 100644
@@ -167,19 +167,6 @@ __uml_setup("root=", uml_root_setup,
 "        root=/dev/ubd5\n\n"
 );
 
-static int __init no_skas_debug_setup(char *line, int *add)
-{
-	os_warn("'debug' is not necessary to gdb UML in skas mode - run\n");
-	os_warn("'gdb linux'\n");
-
-	return 0;
-}
-
-__uml_setup("debug", no_skas_debug_setup,
-"debug\n"
-"    this flag is not needed to run gdb on UML in skas mode\n\n"
-);
-
 static int __init uml_console_setup(char *line, int *add)
 {
 	have_console = 1;
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/9 um: Do not propagate mem parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it will be passed to user space as an environment option by kernel with a warning like:

Unknown kernel command line parameters "mem=2G", will be passed to user space.

---
 arch/um/kernel/physmem.c | 2 ++
 1 file changed, 2 insertions(+)
arch/um/kernel/physmem.c +2 -0
index 636830fe00f2..d60df3626727 100644
@@ -139,6 +139,8 @@ EXPORT_SYMBOL(phys_mapping);
 static int __init uml_mem_setup(char *line, int *add)
 {
 	char *retptr;
+
+	*add = 0;
 	physmem_size = memparse(line,&retptr);
 	return 0;
 }
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 3/9 um: Do not propagate uml_dir parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it will be passed to user space as an environment option by kernel with a warning like:

Unknown kernel command line parameters "uml_dir=/foo", will be passed to user space.

---
 arch/um/os-Linux/umid.c | 2 ++
 1 file changed, 2 insertions(+)
arch/um/os-Linux/umid.c +2 -0
index e09d65b05d1c..eb523ab1e218 100644
@@ -358,6 +358,8 @@ char *get_umid(void)
 
 static int __init set_uml_dir(char *name, int *add)
 {
+	*add = 0;
+
 	if (*name == '\0') {
 		os_warn("uml_dir can't be an empty string\n");
 		return 0;
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH 4/9 um: Do not propagate dtb parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it will be passed to user space as an environment option by kernel with a warning like:

Unknown kernel command line parameters "dtb=/foo", will be passed to user space.

---
 arch/um/kernel/dtb.c | 1 +
 1 file changed, 1 insertion(+)
arch/um/kernel/dtb.c +1 -0
index 4954188a6a09..73369446ed1e 100644
@@ -31,6 +31,7 @@ void uml_dtb_init(void)
 
 static int __init uml_dtb_setup(char *line, int *add)
 {
+	*add = 0;
 	dtb = line;
 	return 0;
 }
Signature · 1 line
2.34.1
author
#5 lore raw

PATCH 5/9 um: Do not propagate noreboot parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it could be passed to user space as a command line option by kernel with a warning like:

Unknown kernel command line parameters "noreboot", will be passed to user space.

---
 arch/um/os-Linux/skas/process.c | 1 +
 1 file changed, 1 insertion(+)
arch/um/os-Linux/skas/process.c +1 -0
index 2286486bb0f3..8b328eb9d1f7 100644
@@ -622,6 +622,7 @@ static bool noreboot;
 
 static int __init noreboot_cmd_param(char *str, int *add)
 {
+	*add = 0;
 	noreboot = true;
 	return 0;
 }
Signature · 1 line
2.34.1
author
#6 lore raw

PATCH 6/9 hostfs: Do not propagate hostfs parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it will be passed to user space as an environment option by kernel with a warning like:

Unknown kernel command line parameters "hostfs=/foo", will be passed to user space.

---
 fs/hostfs/hostfs_kern.c | 1 +
 1 file changed, 1 insertion(+)
fs/hostfs/hostfs_kern.c +1 -0
index 6d1cf2436ead..8d47c6b70c9f 100644
@@ -57,6 +57,7 @@ static int __init hostfs_args(char *options, int *add)
 {
 	char *ptr;
 
+	*add = 0;
 	ptr = strchr(options, ',');
 	if (ptr != NULL)
 		*ptr++ = '\0';
Signature · 1 line
2.34.1
author
#7 lore raw

PATCH 7/9 um: hostaudio: Do not propagate dsp parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it will trigger a warning and be passed to user space as an environment option.

---
 arch/um/drivers/hostaudio_kern.c | 1 +
 1 file changed, 1 insertion(+)
arch/um/drivers/hostaudio_kern.c +1 -0
index 9d228878cea2..09af903b75ae 100644
@@ -48,6 +48,7 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
 #ifndef MODULE
 static int set_dsp(char *name, int *add)
 {
+	*add = 0;
 	dsp = name;
 	return 0;
 }
Signature · 1 line
2.34.1
author
#8 lore raw

PATCH 8/9 um: hostaudio: Do not propagate mixer parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific and is unknown to kernel. It should not be propagated to kernel, otherwise it will trigger a warning and be passed to user space as an environment option.

---
 arch/um/drivers/hostaudio_kern.c | 1 +
 1 file changed, 1 insertion(+)
arch/um/drivers/hostaudio_kern.c +1 -0
index 09af903b75ae..0ac149de1ac0 100644
@@ -57,6 +57,7 @@ __uml_setup("dsp=", set_dsp, "dsp=<dsp device>\n" DSP_HELP);
 
 static int set_mixer(char *name, int *add)
 {
+	*add = 0;
 	mixer = name;
 	return 0;
 }
Signature · 1 line
2.34.1
author
#9 lore raw

PATCH 9/9 um: Do not propagate initrd parameter to kernel

In reply to Tiwei Bie

This parameter is UML specific. It specifies the name of the file containing the initrd image, which is unknown to kernel.

---
 arch/um/kernel/initrd.c | 1 +
 1 file changed, 1 insertion(+)
arch/um/kernel/initrd.c +1 -0
index 47b8cb1a1156..99dba827461c 100644
@@ -34,6 +34,7 @@ int __init read_initrd(void)
 
 static int __init uml_initrd_setup(char *line, int *add)
 {
+	*add = 0;
 	initrd = line;
 	return 0;
 }
Signature · 1 line
2.34.1