* [PATCH 0/7] um: Misc cleanups
@ 2025-08-24 15:44 Tiwei Bie
2025-08-24 15:44 ` [PATCH 1/7] um: Add missing trailing newline to help messages Tiwei Bie
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
Tiwei Bie (7):
um: Add missing trailing newline to help messages
um: vector: Fix indentation for help message
um: Fix help message for ssl-non-raw
um: Indent time-travel help messages
um: Remove unused offset and child_err fields from stub_data
um: Remove outdated comment about STUB_DATA_PAGES
um: Centralize stub size calculations
arch/um/drivers/ssl.c | 5 +++-
arch/um/drivers/ubd_kern.c | 2 +-
arch/um/drivers/vector_kern.c | 2 +-
arch/um/include/shared/as-layout.h | 5 ++--
arch/um/include/shared/skas/stub-data.h | 3 +-
arch/um/kernel/dtb.c | 2 +-
arch/um/kernel/time.c | 37 +++++++++++++------------
arch/um/kernel/um_arch.c | 4 +--
arch/um/os-Linux/skas/process.c | 2 +-
arch/x86/um/shared/sysdep/stub_32.h | 2 +-
arch/x86/um/shared/sysdep/stub_64.h | 2 +-
11 files changed, 34 insertions(+), 32 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/7] um: Add missing trailing newline to help messages
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
2025-08-24 15:44 ` [PATCH 2/7] um: vector: Fix indentation for help message Tiwei Bie
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
Some help messages are missing a trailing newline. They should
end with two newlines, but only one is present. Add the missing
newline to make the --help output more readable.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/drivers/ubd_kern.c | 2 +-
arch/um/kernel/dtb.c | 2 +-
arch/um/kernel/time.c | 5 +++--
arch/um/os-Linux/skas/process.c | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 4de6613e7468..01bbd39722c0 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -370,7 +370,7 @@ __uml_help(ubd_setup,
" useful when a unique number should be given to the device. Note when\n"
" specifying a label, the filename2 must be also presented. It can be\n"
" an empty string, in which case the backing file is not used:\n"
-" ubd0=File,,Serial\n"
+" ubd0=File,,Serial\n\n"
);
static int udb_setup(char *str)
diff --git a/arch/um/kernel/dtb.c b/arch/um/kernel/dtb.c
index 15c342426489..47cd3d869fb2 100644
--- a/arch/um/kernel/dtb.c
+++ b/arch/um/kernel/dtb.c
@@ -38,5 +38,5 @@ static int __init uml_dtb_setup(char *line, int *add)
__uml_setup("dtb=", uml_dtb_setup,
"dtb=<file>\n"
-" Boot the kernel with the devicetree blob from the specified file.\n"
+" Boot the kernel with the devicetree blob from the specified file.\n\n"
);
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index ae0fa2173778..cce5e3371e9f 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -1005,7 +1005,7 @@ __uml_help(setup_time_travel,
"have more than one system simultaneously be on simulated time. The virtio\n"
"driver code in UML knows about this so you can also simulate networks and\n"
"devices using it, assuming the device has the right capabilities.\n"
-"The optional ID is a 64-bit integer that's sent to the central scheduler.\n");
+"The optional ID is a 64-bit integer that's sent to the central scheduler.\n\n");
static int setup_time_travel_start(char *str)
{
@@ -1023,7 +1023,8 @@ __setup("time-travel-start=", setup_time_travel_start);
__uml_help(setup_time_travel_start,
"time-travel-start=<nanoseconds>\n"
"Configure the UML instance's wall clock to start at this value rather than\n"
-"the host's wall clock at the time of UML boot.\n");
+"the host's wall clock at the time of UML boot.\n\n");
+
static struct kobject *bc_time_kobject;
static ssize_t bc_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 78f48fa9db8b..0bc10cd4cbed 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -895,7 +895,7 @@ __uml_setup("noreboot", noreboot_cmd_param,
"noreboot\n"
" Rather than rebooting, exit always, akin to QEMU's -no-reboot option.\n"
" This is useful if you're using CONFIG_PANIC_TIMEOUT in order to catch\n"
-" crashes in CI\n");
+" crashes in CI\n\n");
void reboot_skas(void)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/7] um: vector: Fix indentation for help message
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
2025-08-24 15:44 ` [PATCH 1/7] um: Add missing trailing newline to help messages Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
2025-08-24 15:44 ` [PATCH 3/7] um: Fix help message for ssl-non-raw Tiwei Bie
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
As with other help messages, use four spaces instead of a single
tab for indentation.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/drivers/vector_kern.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 9bbbddfe866b..25d9258fa592 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1721,7 +1721,7 @@ static int __init vector_setup(char *str)
__setup("vec", vector_setup);
__uml_help(vector_setup,
"vec[0-9]+:<option>=<value>,<option>=<value>\n"
-" Configure a vector io network device.\n\n"
+" Configure a vector io network device.\n\n"
);
late_initcall(vector_init);
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/7] um: Fix help message for ssl-non-raw
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
2025-08-24 15:44 ` [PATCH 1/7] um: Add missing trailing newline to help messages Tiwei Bie
2025-08-24 15:44 ` [PATCH 2/7] um: vector: Fix indentation for help message Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
2025-08-24 15:44 ` [PATCH 4/7] um: Indent time-travel help messages Tiwei Bie
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
Add the missing option name in the help message. Additionally,
switch to __uml_help(), because this is a global option rather
than a per-channel option.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/drivers/ssl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index 277cea3d30eb..8006a5bd578c 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -199,4 +199,7 @@ static int ssl_non_raw_setup(char *str)
return 1;
}
__setup("ssl-non-raw", ssl_non_raw_setup);
-__channel_help(ssl_non_raw_setup, "set serial lines to non-raw mode");
+__uml_help(ssl_non_raw_setup,
+"ssl-non-raw\n"
+" Set serial lines to non-raw mode.\n\n"
+);
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/7] um: Indent time-travel help messages
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
` (2 preceding siblings ...)
2025-08-24 15:44 ` [PATCH 3/7] um: Fix help message for ssl-non-raw Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
2025-08-24 15:44 ` [PATCH 5/7] um: Remove unused offset and child_err fields from stub_data Tiwei Bie
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
Indent the help messages for time-travel to make them consistent
with the format of other help messages.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/kernel/time.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index cce5e3371e9f..17da0a870650 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -986,26 +986,26 @@ static int setup_time_travel(char *str)
__setup("time-travel", setup_time_travel);
__uml_help(setup_time_travel,
"time-travel\n"
-"This option just enables basic time travel mode, in which the clock/timers\n"
-"inside the UML instance skip forward when there's nothing to do, rather than\n"
-"waiting for real time to elapse. However, instance CPU speed is limited by\n"
-"the real CPU speed, so e.g. a 10ms timer will always fire after ~10ms wall\n"
-"clock (but quicker when there's nothing to do).\n"
+" This option just enables basic time travel mode, in which the clock/timers\n"
+" inside the UML instance skip forward when there's nothing to do, rather than\n"
+" waiting for real time to elapse. However, instance CPU speed is limited by\n"
+" the real CPU speed, so e.g. a 10ms timer will always fire after ~10ms wall\n"
+" clock (but quicker when there's nothing to do).\n"
"\n"
"time-travel=inf-cpu\n"
-"This enables time travel mode with infinite processing power, in which there\n"
-"are no wall clock timers, and any CPU processing happens - as seen from the\n"
-"guest - instantly. This can be useful for accurate simulation regardless of\n"
-"debug overhead, physical CPU speed, etc. but is somewhat dangerous as it can\n"
-"easily lead to getting stuck (e.g. if anything in the system busy loops).\n"
+" This enables time travel mode with infinite processing power, in which there\n"
+" are no wall clock timers, and any CPU processing happens - as seen from the\n"
+" guest - instantly. This can be useful for accurate simulation regardless of\n"
+" debug overhead, physical CPU speed, etc. but is somewhat dangerous as it can\n"
+" easily lead to getting stuck (e.g. if anything in the system busy loops).\n"
"\n"
"time-travel=ext:[ID:]/path/to/socket\n"
-"This enables time travel mode similar to =inf-cpu, except the system will\n"
-"use the given socket to coordinate with a central scheduler, in order to\n"
-"have more than one system simultaneously be on simulated time. The virtio\n"
-"driver code in UML knows about this so you can also simulate networks and\n"
-"devices using it, assuming the device has the right capabilities.\n"
-"The optional ID is a 64-bit integer that's sent to the central scheduler.\n\n");
+" This enables time travel mode similar to =inf-cpu, except the system will\n"
+" use the given socket to coordinate with a central scheduler, in order to\n"
+" have more than one system simultaneously be on simulated time. The virtio\n"
+" driver code in UML knows about this so you can also simulate networks and\n"
+" devices using it, assuming the device has the right capabilities.\n"
+" The optional ID is a 64-bit integer that's sent to the central scheduler.\n\n");
static int setup_time_travel_start(char *str)
{
@@ -1022,8 +1022,8 @@ static int setup_time_travel_start(char *str)
__setup("time-travel-start=", setup_time_travel_start);
__uml_help(setup_time_travel_start,
"time-travel-start=<nanoseconds>\n"
-"Configure the UML instance's wall clock to start at this value rather than\n"
-"the host's wall clock at the time of UML boot.\n\n");
+" Configure the UML instance's wall clock to start at this value rather than\n"
+" the host's wall clock at the time of UML boot.\n\n");
static struct kobject *bc_time_kobject;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/7] um: Remove unused offset and child_err fields from stub_data
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
` (3 preceding siblings ...)
2025-08-24 15:44 ` [PATCH 4/7] um: Indent time-travel help messages Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
2025-08-24 15:44 ` [PATCH 6/7] um: Remove outdated comment about STUB_DATA_PAGES Tiwei Bie
2025-08-24 15:44 ` [PATCH 7/7] um: Centralize stub size calculations Tiwei Bie
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
They are no longer used. Remove them.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/include/shared/skas/stub-data.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/um/include/shared/skas/stub-data.h b/arch/um/include/shared/skas/stub-data.h
index c261a77a32f6..27db38e95df9 100644
--- a/arch/um/include/shared/skas/stub-data.h
+++ b/arch/um/include/shared/skas/stub-data.h
@@ -53,8 +53,7 @@ struct stub_syscall {
};
struct stub_data {
- unsigned long offset;
- long err, child_err;
+ long err;
int syscall_data_len;
/* 128 leaves enough room for additional fields in the struct */
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/7] um: Remove outdated comment about STUB_DATA_PAGES
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
` (4 preceding siblings ...)
2025-08-24 15:44 ` [PATCH 5/7] um: Remove unused offset and child_err fields from stub_data Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
2025-08-24 15:44 ` [PATCH 7/7] um: Centralize stub size calculations Tiwei Bie
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
STUB_DATA_PAGES is no longer required to be a power of two since
commit 91f0a0c5cc5b ("um: Calculate stub data address relative to
stub code"). Remove the outdated comment.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/include/shared/as-layout.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h
index 2f9bfd99460a..eacf18ec9d0c 100644
--- a/arch/um/include/shared/as-layout.h
+++ b/arch/um/include/shared/as-layout.h
@@ -23,7 +23,7 @@
#define STUB_START stub_start
#define STUB_CODE STUB_START
#define STUB_DATA (STUB_CODE + UM_KERN_PAGE_SIZE)
-#define STUB_DATA_PAGES 2 /* must be a power of two */
+#define STUB_DATA_PAGES 2
#define STUB_END (STUB_DATA + STUB_DATA_PAGES * UM_KERN_PAGE_SIZE)
#ifndef __ASSEMBLER__
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 7/7] um: Centralize stub size calculations
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
` (5 preceding siblings ...)
2025-08-24 15:44 ` [PATCH 6/7] um: Remove outdated comment about STUB_DATA_PAGES Tiwei Bie
@ 2025-08-24 15:44 ` Tiwei Bie
6 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2025-08-24 15:44 UTC (permalink / raw)
To: richard, anton.ivanov, johannes; +Cc: linux-um, tiwei.btw, tiwei.bie
From: Tiwei Bie <tiwei.btw@antgroup.com>
Currently, the stub size is calculated in multiple places. Define
a macro that performs the calculation so that the code is easier
to read and maintain.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
---
arch/um/include/shared/as-layout.h | 3 ++-
arch/um/kernel/um_arch.c | 4 +---
arch/x86/um/shared/sysdep/stub_32.h | 2 +-
arch/x86/um/shared/sysdep/stub_64.h | 2 +-
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h
index eacf18ec9d0c..7c7e17bce403 100644
--- a/arch/um/include/shared/as-layout.h
+++ b/arch/um/include/shared/as-layout.h
@@ -24,7 +24,8 @@
#define STUB_CODE STUB_START
#define STUB_DATA (STUB_CODE + UM_KERN_PAGE_SIZE)
#define STUB_DATA_PAGES 2
-#define STUB_END (STUB_DATA + STUB_DATA_PAGES * UM_KERN_PAGE_SIZE)
+#define STUB_SIZE ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE)
+#define STUB_END (STUB_START + STUB_SIZE)
#ifndef __ASSEMBLER__
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 2f5ee045bc7a..6cd464c9095f 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -331,9 +331,7 @@ int __init linux_main(int argc, char **argv, char **envp)
host_task_size = get_top_address(envp);
/* reserve a few pages for the stubs */
- stub_start = host_task_size - STUB_DATA_PAGES * PAGE_SIZE;
- /* another page for the code portion */
- stub_start -= PAGE_SIZE;
+ stub_start = host_task_size - STUB_SIZE;
host_task_size = stub_start;
/* Limit TASK_SIZE to what is addressable by the page table */
diff --git a/arch/x86/um/shared/sysdep/stub_32.h b/arch/x86/um/shared/sysdep/stub_32.h
index df568fc3ceb4..9dc2efaf5df1 100644
--- a/arch/x86/um/shared/sysdep/stub_32.h
+++ b/arch/x86/um/shared/sysdep/stub_32.h
@@ -129,7 +129,7 @@ static __always_inline void *get_stub_data(void)
"subl %0,%%esp ;" \
"movl %1, %%eax ; " \
"call *%%eax ;" \
- :: "i" ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE), \
+ :: "i" (STUB_SIZE), \
"i" (&fn))
static __always_inline void
diff --git a/arch/x86/um/shared/sysdep/stub_64.h b/arch/x86/um/shared/sysdep/stub_64.h
index 9cfd31afa769..9fd56954e2e0 100644
--- a/arch/x86/um/shared/sysdep/stub_64.h
+++ b/arch/x86/um/shared/sysdep/stub_64.h
@@ -133,7 +133,7 @@ static __always_inline void *get_stub_data(void)
"subq %0,%%rsp ;" \
"movq %1,%%rax ;" \
"call *%%rax ;" \
- :: "i" ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE), \
+ :: "i" (STUB_SIZE), \
"i" (&fn))
static __always_inline void
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-08-24 15:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 15:44 [PATCH 0/7] um: Misc cleanups Tiwei Bie
2025-08-24 15:44 ` [PATCH 1/7] um: Add missing trailing newline to help messages Tiwei Bie
2025-08-24 15:44 ` [PATCH 2/7] um: vector: Fix indentation for help message Tiwei Bie
2025-08-24 15:44 ` [PATCH 3/7] um: Fix help message for ssl-non-raw Tiwei Bie
2025-08-24 15:44 ` [PATCH 4/7] um: Indent time-travel help messages Tiwei Bie
2025-08-24 15:44 ` [PATCH 5/7] um: Remove unused offset and child_err fields from stub_data Tiwei Bie
2025-08-24 15:44 ` [PATCH 6/7] um: Remove outdated comment about STUB_DATA_PAGES Tiwei Bie
2025-08-24 15:44 ` [PATCH 7/7] um: Centralize stub size calculations Tiwei Bie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).