From 78624eb99e1ab1d16c8a7172ac9c6bdefb7befe3 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Wed, 27 Aug 2025 08:57:01 +0800 Subject: um: Remove unused offset and child_err fields from stub_data They are no longer used. Remove them. Signed-off-by: Tiwei Bie Signed-off-by: Johannes Berg --- arch/um/include/shared/skas/stub-data.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/um/include') 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 */ -- cgit From b765d69a1adf83b969f1f0c8353b80c3c18ef2f7 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Wed, 27 Aug 2025 08:57:02 +0800 Subject: um: Remove outdated comment about STUB_DATA_PAGES 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 Signed-off-by: Johannes Berg --- arch/um/include/shared/as-layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/um/include') 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__ -- cgit From e047f9af9d6948728614f7eea41ba53d5b767e9f Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Wed, 27 Aug 2025 08:57:03 +0800 Subject: um: Centralize stub size calculations 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 Signed-off-by: Johannes Berg --- arch/um/include/shared/as-layout.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/um/include') 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__ -- cgit From a73a9aad8a81934ab50201ba23107fd321612caf Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Sun, 10 Aug 2025 13:51:27 +0800 Subject: um: Stop tracking virtual CPUs via mm_cpumask() In UML, each user address space is represented as a separate stub process on the host. Therefore, user address spaces do not require TLB management on UML virtual CPUs, and it's unnecessary to track which virtual CPUs they have executed on. Signed-off-by: Tiwei Bie Signed-off-by: Johannes Berg --- arch/um/include/asm/mmu_context.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'arch/um/include') diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h index 0bbb24868557..c727e56ba116 100644 --- a/arch/um/include/asm/mmu_context.h +++ b/arch/um/include/asm/mmu_context.h @@ -13,20 +13,9 @@ #include #include -#define activate_mm activate_mm -static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) -{ -} - static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { - unsigned cpu = smp_processor_id(); - - if (prev != next) { - cpumask_clear_cpu(cpu, mm_cpumask(prev)); - cpumask_set_cpu(cpu, mm_cpumask(next)); - } } #define init_new_context init_new_context -- cgit From be6a0372be581b80a4f0083687d45c30289094ca Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Sun, 10 Aug 2025 13:51:28 +0800 Subject: um: Remove unused cpu_data and current_cpu_data macros These two macros have no users. Remove them. Signed-off-by: Tiwei Bie Signed-off-by: Johannes Berg --- arch/um/include/asm/processor-generic.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/um/include') diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index 8a789c17acd8..236fdfd7cdbe 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h @@ -81,8 +81,6 @@ struct cpuinfo_um { extern struct cpuinfo_um boot_cpu_data; -#define cpu_data(cpu) boot_cpu_data -#define current_cpu_data boot_cpu_data #define cache_line_size() (boot_cpu_data.cache_alignment) #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf) -- cgit From e66ae377fe219c98d3d5b8a0d35da4413a5390ca Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Sun, 10 Aug 2025 13:51:33 +0800 Subject: um: Remove unused ipi_pipe field from cpuinfo_um It's no longer used after the removal of the SMP implementation in TT mode by commit 28fa468f5316 ("um: Remove broken SMP support"). While at it, remove the outdated comment. Signed-off-by: Tiwei Bie Signed-off-by: Johannes Berg --- arch/um/include/asm/processor-generic.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/um/include') diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index 236fdfd7cdbe..7854d51b6639 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h @@ -71,7 +71,6 @@ extern void start_thread(struct pt_regs *regs, unsigned long entry, struct cpuinfo_um { unsigned long loops_per_jiffy; - int ipi_pipe[2]; int cache_alignment; union { __u32 x86_capability[NCAPINTS + NBUGINTS]; -- cgit