2024-03-06 10:26:20

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 0/9] um: Minor fixes and cleanups

A series of minor fixes and cleanups for UML.

Most changes in this series are very straightforward. Please consider
picking this series for v6.9.

There are still some remaining -Wmissing-prototypes warnings. I plan to
send a followup RFC series first to fix those warnings.

Feedbacks on this series would be appreciated. Thanks!

Changes since v2:
https://lore.kernel.org/lkml/[email protected]/
- Add "um: Move declarations to proper headers";
- Add "um: Fix -Wmissing-prototypes warnings for text_poke*";
- Add "um: Fix -Wmissing-prototypes warnings for __warp_* and foo";
- Make do_set_thread_area() static;
- Add the missing header for calibrate_delay_is_known;

Tiwei Bie (9):
um: Make local functions and variables static
um: Fix the declaration of vfree
um: Remove unused functions
um: Fix the return type of __switch_to
um: Add missing headers
um: Stop tracking host PID in cpu_tasks
um: Move declarations to proper headers
um: Fix -Wmissing-prototypes warnings for text_poke*
um: Fix -Wmissing-prototypes warnings for __warp_* and foo

arch/um/drivers/pcap_kern.c | 4 +-
arch/um/drivers/ubd_user.c | 2 +-
arch/um/include/asm/ptrace-generic.h | 3 ++
arch/um/include/shared/as-layout.h | 1 -
arch/um/include/shared/kern_util.h | 1 +
arch/um/include/shared/um_malloc.h | 2 +-
arch/um/kernel/kmsg_dump.c | 2 +-
arch/um/kernel/mem.c | 2 +
arch/um/kernel/physmem.c | 3 +-
arch/um/kernel/process.c | 48 +++++-----------------
arch/um/kernel/ptrace.c | 3 --
arch/um/kernel/reboot.c | 1 +
arch/um/kernel/skas/mmu.c | 1 +
arch/um/kernel/skas/process.c | 5 +--
arch/um/kernel/time.c | 7 ++--
arch/um/kernel/tlb.c | 7 +---
arch/um/kernel/um_arch.c | 1 +
arch/um/kernel/um_arch.h | 2 +
arch/um/os-Linux/drivers/ethertap_kern.c | 2 +-
arch/um/os-Linux/drivers/tuntap_kern.c | 2 +-
arch/um/os-Linux/main.c | 5 +++
arch/um/os-Linux/signal.c | 4 +-
arch/um/os-Linux/start_up.c | 1 +
arch/x86/um/asm/ptrace.h | 6 +++
arch/x86/um/bugs_32.c | 1 +
arch/x86/um/bugs_64.c | 1 +
arch/x86/um/elfcore.c | 1 +
arch/x86/um/fault.c | 1 +
arch/x86/um/os-Linux/mcontext.c | 1 +
arch/x86/um/os-Linux/registers.c | 2 +-
arch/x86/um/os-Linux/tls.c | 1 +
arch/x86/um/ptrace_32.c | 2 -
arch/x86/um/shared/sysdep/kernel-offsets.h | 3 ++
arch/x86/um/tls_32.c | 2 +-
arch/x86/um/user-offsets.c | 3 ++
35 files changed, 63 insertions(+), 70 deletions(-)

--
2.34.1



2024-03-06 10:26:29

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 4/9] um: Fix the return type of __switch_to

Make it match the declaration in asm-generic/switch_to.h. And
also include the header to allow the compiler to check it.

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/kernel/process.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 292c8014aaa6..a7607ef1b02f 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -26,6 +26,7 @@
#include <linux/resume_user_mode.h>
#include <asm/current.h>
#include <asm/mmu_context.h>
+#include <asm/switch_to.h>
#include <linux/uaccess.h>
#include <as-layout.h>
#include <kern_util.h>
@@ -73,7 +74,7 @@ static inline void set_current(struct task_struct *task)

extern void arch_switch_to(struct task_struct *to);

-void *__switch_to(struct task_struct *from, struct task_struct *to)
+struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to)
{
to->thread.prev_sched = from;
set_current(to);
--
2.34.1


2024-03-06 10:26:43

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 6/9] um: Stop tracking host PID in cpu_tasks

The host PID tracked in 'cpu_tasks' is no longer used. Stopping
tracking it will also save some cycles.

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/include/shared/as-layout.h | 1 -
arch/um/kernel/process.c | 12 ++----------
arch/um/kernel/skas/process.c | 4 ----
3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h
index 9ec3015bc5e2..c22f46a757dc 100644
--- a/arch/um/include/shared/as-layout.h
+++ b/arch/um/include/shared/as-layout.h
@@ -31,7 +31,6 @@
#include <sysdep/ptrace.h>

struct cpu_task {
- int pid;
void *task;
};

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 4235e2ca2664..1201c1a79b23 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -43,13 +43,7 @@
* cares about its entry, so it's OK if another processor is modifying its
* entry.
*/
-struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
-
-static inline int external_pid(void)
-{
- /* FIXME: Need to look up userspace_pid by cpu */
- return userspace_pid[0];
-}
+struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { NULL } };

void free_stack(unsigned long stack, int order)
{
@@ -70,8 +64,7 @@ unsigned long alloc_stack(int order, int atomic)

static inline void set_current(struct task_struct *task)
{
- cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task)
- { external_pid(), task });
+ cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) { task });
}

extern void arch_switch_to(struct task_struct *to);
@@ -208,7 +201,6 @@ void um_idle_sleep(void)

void arch_cpu_idle(void)
{
- cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
um_idle_sleep();
}

diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c
index fdd5922f9222..99a5cbb36083 100644
--- a/arch/um/kernel/skas/process.c
+++ b/arch/um/kernel/skas/process.c
@@ -18,12 +18,8 @@ extern void start_kernel(void);

static int __init start_kernel_proc(void *unused)
{
- int pid;
-
block_signals_trace();
- pid = os_getpid();

- cpu_tasks[0].pid = pid;
cpu_tasks[0].task = current;

start_kernel();
--
2.34.1


2024-03-06 10:35:48

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 7/9] um: Move declarations to proper headers

This will address below -Wmissing-prototypes warnings:

arch/um/kernel/initrd.c:18:12: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
arch/um/os-Linux/start_up.c:301:12: warning: no previous prototype for ‘parse_iomem’ [-Wmissing-prototypes]
arch/x86/um/ptrace_32.c:15:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
arch/x86/um/ptrace_32.c:101:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
arch/x86/um/ptrace_32.c:153:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
arch/x86/um/tls_32.c:184:5: warning: no previous prototype for ‘arch_switch_tls’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/include/asm/ptrace-generic.h | 3 +++
arch/um/include/shared/kern_util.h | 1 +
arch/um/kernel/physmem.c | 3 +--
arch/um/kernel/process.c | 2 --
arch/um/kernel/ptrace.c | 3 ---
arch/um/kernel/um_arch.h | 2 ++
arch/um/os-Linux/start_up.c | 1 +
arch/x86/um/asm/ptrace.h | 6 ++++++
arch/x86/um/ptrace_32.c | 2 --
9 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/um/include/asm/ptrace-generic.h b/arch/um/include/asm/ptrace-generic.h
index adf91ef553ae..4696f24d1492 100644
--- a/arch/um/include/asm/ptrace-generic.h
+++ b/arch/um/include/asm/ptrace-generic.h
@@ -36,6 +36,9 @@ extern long subarch_ptrace(struct task_struct *child, long request,
extern unsigned long getreg(struct task_struct *child, int regno);
extern int putreg(struct task_struct *child, int regno, unsigned long value);

+extern int poke_user(struct task_struct *child, long addr, long data);
+extern int peek_user(struct task_struct *child, long addr, long data);
+
extern int arch_set_tls(struct task_struct *new, unsigned long tls);
extern void clear_flushed_tls(struct task_struct *task);
extern int syscall_trace_enter(struct pt_regs *regs);
diff --git a/arch/um/include/shared/kern_util.h b/arch/um/include/shared/kern_util.h
index 789b83013f35..81bc38a2e3fc 100644
--- a/arch/um/include/shared/kern_util.h
+++ b/arch/um/include/shared/kern_util.h
@@ -41,6 +41,7 @@ extern void uml_pm_wake(void);

extern int start_uml(void);
extern void paging_init(void);
+extern int parse_iomem(char *str, int *add);

extern void uml_cleanup(void);
extern void do_uml_exitcalls(void);
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 91485119ae67..fb2adfb49945 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -12,6 +12,7 @@
#include <as-layout.h>
#include <init.h>
#include <kern.h>
+#include <kern_util.h>
#include <mem_user.h>
#include <os.h>

@@ -161,8 +162,6 @@ __uml_setup("mem=", uml_mem_setup,
" Example: mem=64M\n\n"
);

-extern int __init parse_iomem(char *str, int *add);
-
__uml_setup("iomem=", parse_iomem,
"iomem=<name>,<file>\n"
" Configure <file> as an IO memory region named <name>.\n\n"
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 1201c1a79b23..30bf7739ed0f 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -67,8 +67,6 @@ static inline void set_current(struct task_struct *task)
cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) { task });
}

-extern void arch_switch_to(struct task_struct *to);
-
struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to)
{
to->thread.prev_sched = from;
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 6600a2782796..2124624b7817 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -35,9 +35,6 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child);
}

-extern int peek_user(struct task_struct * child, long addr, long data);
-extern int poke_user(struct task_struct * child, long addr, long data);
-
long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
diff --git a/arch/um/kernel/um_arch.h b/arch/um/kernel/um_arch.h
index 1e07fb7ee35e..46e731ab9dfc 100644
--- a/arch/um/kernel/um_arch.h
+++ b/arch/um/kernel/um_arch.h
@@ -11,4 +11,6 @@ extern void __init uml_dtb_init(void);
static inline void uml_dtb_init(void) { }
#endif

+extern int __init read_initrd(void);
+
#endif
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 8b0e98ab842c..6b21061c431c 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -20,6 +20,7 @@
#include <asm/unistd.h>
#include <init.h>
#include <os.h>
+#include <kern_util.h>
#include <mem_user.h>
#include <ptrace_user.h>
#include <registers.h>
diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h
index 83822fd42204..2fef3da55533 100644
--- a/arch/x86/um/asm/ptrace.h
+++ b/arch/x86/um/asm/ptrace.h
@@ -54,6 +54,8 @@ extern int ptrace_get_thread_area(struct task_struct *child, int idx,
extern int ptrace_set_thread_area(struct task_struct *child, int idx,
struct user_desc __user *user_desc);

+extern int arch_switch_tls(struct task_struct *to);
+
#else

#define PT_REGS_R8(r) UPT_R8(&(r)->regs)
@@ -83,5 +85,9 @@ extern long arch_prctl(struct task_struct *task, int option,
unsigned long __user *addr);

#endif
+
#define user_stack_pointer(regs) PT_REGS_SP(regs)
+
+extern void arch_switch_to(struct task_struct *to);
+
#endif /* __UM_X86_PTRACE_H */
diff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c
index 7f1abde2c84b..b0a71c6cdc6e 100644
--- a/arch/x86/um/ptrace_32.c
+++ b/arch/x86/um/ptrace_32.c
@@ -10,8 +10,6 @@
#include <registers.h>
#include <skas.h>

-extern int arch_switch_tls(struct task_struct *to);
-
void arch_switch_to(struct task_struct *to)
{
int err = arch_switch_tls(to);
--
2.34.1


2024-03-06 10:36:18

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 3/9] um: Remove unused functions

These functions are not used anymore. Removing them will also address
below -Wmissing-prototypes warnings:

arch/um/kernel/process.c:51:5: warning: no previous prototype for ‘pid_to_processor_id’ [-Wmissing-prototypes]
arch/um/kernel/process.c:253:5: warning: no previous prototype for ‘copy_to_user_proc’ [-Wmissing-prototypes]
arch/um/kernel/process.c:263:5: warning: no previous prototype for ‘clear_user_proc’ [-Wmissing-prototypes]
arch/um/kernel/tlb.c:579:6: warning: no previous prototype for ‘flush_tlb_mm_range’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/kernel/process.c | 21 ---------------------
arch/um/kernel/tlb.c | 6 ------
2 files changed, 27 deletions(-)

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 20f3813143d8..292c8014aaa6 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -48,17 +48,6 @@ static inline int external_pid(void)
return userspace_pid[0];
}

-int pid_to_processor_id(int pid)
-{
- int i;
-
- for (i = 0; i < ncpus; i++) {
- if (cpu_tasks[i].pid == pid)
- return i;
- }
- return -1;
-}
-
void free_stack(unsigned long stack, int order)
{
free_pages(stack, order);
@@ -250,21 +239,11 @@ char *uml_strdup(const char *string)
}
EXPORT_SYMBOL(uml_strdup);

-int copy_to_user_proc(void __user *to, void *from, int size)
-{
- return copy_to_user(to, from, size);
-}
-
int copy_from_user_proc(void *to, void __user *from, int size)
{
return copy_from_user(to, from, size);
}

-int clear_user_proc(void __user *buf, int size)
-{
- return clear_user(buf, size);
-}
-
static atomic_t using_sysemu = ATOMIC_INIT(0);
int sysemu_supported;

diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 7d050ab0f78a..70b5e47e9761 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -576,12 +576,6 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
}
EXPORT_SYMBOL(flush_tlb_range);

-void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
- unsigned long end)
-{
- fix_range(mm, start, end, 0);
-}
-
void flush_tlb_mm(struct mm_struct *mm)
{
struct vm_area_struct *vma;
--
2.34.1


2024-03-06 10:36:34

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 8/9] um: Fix -Wmissing-prototypes warnings for text_poke*

The prototypes for text_poke* are declared in asm/text-patching.h
under arch/x86/include/. It's safe to include this header, as it's
UML-aware (by checking CONFIG_UML_X86).

This will address below -Wmissing-prototypes warnings:

arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes]
arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/kernel/um_arch.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 7a9820797eae..e95f805e5004 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -23,6 +23,7 @@
#include <asm/cpufeature.h>
#include <asm/sections.h>
#include <asm/setup.h>
+#include <asm/text-patching.h>
#include <as-layout.h>
#include <arch.h>
#include <init.h>
--
2.34.1


2024-03-06 10:36:41

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 9/9] um: Fix -Wmissing-prototypes warnings for __warp_* and foo

These functions are not called explicitly. Let's just workaround
the -Wmissing-prototypes warnings by declaring them locally similar
to what was done in arch/x86/kernel/asm-offsets_32.c.

This will address below -Wmissing-prototypes warnings:

/arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes]
arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/os-Linux/main.c | 5 +++++
arch/x86/um/shared/sysdep/kernel-offsets.h | 3 +++
arch/x86/um/user-offsets.c | 3 +++
3 files changed, 11 insertions(+)

diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index c8a42ecbd7a2..e82164f90288 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -184,6 +184,11 @@ int __init main(int argc, char **argv, char **envp)

extern void *__real_malloc(int);

+/* workaround for -Wmissing-prototypes warnings */
+void *__wrap_malloc(int size);
+void *__wrap_calloc(int n, int size);
+void __wrap_free(void *ptr);
+
void *__wrap_malloc(int size)
{
void *ret;
diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h
index a004bffb7b8d..48de3a71f845 100644
--- a/arch/x86/um/shared/sysdep/kernel-offsets.h
+++ b/arch/x86/um/shared/sysdep/kernel-offsets.h
@@ -6,6 +6,9 @@
#include <linux/kbuild.h>
#include <asm/mman.h>

+/* workaround for a warning with -Wmissing-prototypes */
+void foo(void);
+
void foo(void)
{
#include <common-offsets.h>
diff --git a/arch/x86/um/user-offsets.c b/arch/x86/um/user-offsets.c
index e54a9814ccf1..1c77d9946199 100644
--- a/arch/x86/um/user-offsets.c
+++ b/arch/x86/um/user-offsets.c
@@ -14,6 +14,9 @@
COMMENT(#val " / sizeof(unsigned long)"); \
DEFINE(sym, val / sizeof(unsigned long))

+/* workaround for a warning with -Wmissing-prototypes */
+void foo(void);
+
void foo(void)
{
#ifdef __i386__
--
2.34.1


2024-03-06 11:13:02

by Tiwei Bie

[permalink] [raw]
Subject: [PATCH v3 5/9] um: Add missing headers

This will address below -Wmissing-prototypes warnings:

arch/um/kernel/mem.c:202:8: warning: no previous prototype for ‘pgd_alloc’ [-Wmissing-prototypes]
arch/um/kernel/mem.c:215:7: warning: no previous prototype for ‘uml_kmalloc’ [-Wmissing-prototypes]
arch/um/kernel/process.c:207:6: warning: no previous prototype for ‘arch_cpu_idle’ [-Wmissing-prototypes]
arch/um/kernel/process.c:328:15: warning: no previous prototype for ‘arch_align_stack’ [-Wmissing-prototypes]
arch/um/kernel/reboot.c:45:6: warning: no previous prototype for ‘machine_restart’ [-Wmissing-prototypes]
arch/um/kernel/reboot.c:51:6: warning: no previous prototype for ‘machine_power_off’ [-Wmissing-prototypes]
arch/um/kernel/reboot.c:57:6: warning: no previous prototype for ‘machine_halt’ [-Wmissing-prototypes]
arch/um/kernel/skas/mmu.c:17:5: warning: no previous prototype for ‘init_new_context’ [-Wmissing-prototypes]
arch/um/kernel/skas/mmu.c:60:6: warning: no previous prototype for ‘destroy_context’ [-Wmissing-prototypes]
arch/um/kernel/skas/process.c:36:12: warning: no previous prototype for ‘start_uml’ [-Wmissing-prototypes]
arch/um/kernel/time.c:807:15: warning: no previous prototype for ‘calibrate_delay_is_known’ [-Wmissing-prototypes]
arch/um/kernel/tlb.c:594:6: warning: no previous prototype for ‘force_flush_all’ [-Wmissing-prototypes]
arch/x86/um/bugs_32.c:22:6: warning: no previous prototype for ‘arch_check_bugs’ [-Wmissing-prototypes]
arch/x86/um/bugs_32.c:44:6: warning: no previous prototype for ‘arch_examine_signal’ [-Wmissing-prototypes]
arch/x86/um/bugs_64.c:9:6: warning: no previous prototype for ‘arch_check_bugs’ [-Wmissing-prototypes]
arch/x86/um/bugs_64.c:13:6: warning: no previous prototype for ‘arch_examine_signal’ [-Wmissing-prototypes]
arch/x86/um/elfcore.c:10:12: warning: no previous prototype for ‘elf_core_extra_phdrs’ [-Wmissing-prototypes]
arch/x86/um/elfcore.c:15:5: warning: no previous prototype for ‘elf_core_write_extra_phdrs’ [-Wmissing-prototypes]
arch/x86/um/elfcore.c:42:5: warning: no previous prototype for ‘elf_core_write_extra_data’ [-Wmissing-prototypes]
arch/x86/um/elfcore.c:63:8: warning: no previous prototype for ‘elf_core_extra_data_size’ [-Wmissing-prototypes]
arch/x86/um/fault.c:18:5: warning: no previous prototype for ‘arch_fixup’ [-Wmissing-prototypes]
arch/x86/um/os-Linux/mcontext.c:7:6: warning: no previous prototype for ‘get_regs_from_mc’ [-Wmissing-prototypes]
arch/x86/um/os-Linux/tls.c:22:6: warning: no previous prototype for ‘check_host_supports_tls’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie <[email protected]>
---
arch/um/kernel/mem.c | 2 ++
arch/um/kernel/process.c | 2 ++
arch/um/kernel/reboot.c | 1 +
arch/um/kernel/skas/mmu.c | 1 +
arch/um/kernel/skas/process.c | 1 +
arch/um/kernel/time.c | 1 +
arch/um/kernel/tlb.c | 1 +
arch/x86/um/bugs_32.c | 1 +
arch/x86/um/bugs_64.c | 1 +
arch/x86/um/elfcore.c | 1 +
arch/x86/um/fault.c | 1 +
arch/x86/um/os-Linux/mcontext.c | 1 +
arch/x86/um/os-Linux/tls.c | 1 +
13 files changed, 15 insertions(+)

diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 38d5a71a579b..ca91accd64fc 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -12,12 +12,14 @@
#include <linux/slab.h>
#include <asm/fixmap.h>
#include <asm/page.h>
+#include <asm/pgalloc.h>
#include <as-layout.h>
#include <init.h>
#include <kern.h>
#include <kern_util.h>
#include <mem_user.h>
#include <os.h>
+#include <um_malloc.h>
#include <linux/sched/task.h>

#ifdef CONFIG_KASAN
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index a7607ef1b02f..4235e2ca2664 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -15,6 +15,7 @@
#include <linux/proc_fs.h>
#include <linux/ptrace.h>
#include <linux/random.h>
+#include <linux/cpu.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
@@ -27,6 +28,7 @@
#include <asm/current.h>
#include <asm/mmu_context.h>
#include <asm/switch_to.h>
+#include <asm/exec.h>
#include <linux/uaccess.h>
#include <as-layout.h>
#include <kern_util.h>
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index 48c0610d506e..25840eee1068 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -9,6 +9,7 @@
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/oom.h>
+#include <linux/reboot.h>
#include <kern_util.h>
#include <os.h>
#include <skas.h>
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 656fe16c9b63..aeed1c2aaf3c 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -10,6 +10,7 @@

#include <asm/pgalloc.h>
#include <asm/sections.h>
+#include <asm/mmu_context.h>
#include <as-layout.h>
#include <os.h>
#include <skas.h>
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c
index f2ac134c9752..fdd5922f9222 100644
--- a/arch/um/kernel/skas/process.c
+++ b/arch/um/kernel/skas/process.c
@@ -12,6 +12,7 @@
#include <kern.h>
#include <os.h>
#include <skas.h>
+#include <kern_util.h>

extern void start_kernel(void);

diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index efa5b9c97992..a8bfe8be1526 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -19,6 +19,7 @@
#include <asm/param.h>
#include <kern_util.h>
#include <os.h>
+#include <linux/delay.h>
#include <linux/time-internal.h>
#include <linux/um_timetravel.h>
#include <shared/init.h>
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 70b5e47e9761..8784f03fa4a6 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -8,6 +8,7 @@
#include <linux/sched/signal.h>

#include <asm/tlbflush.h>
+#include <asm/mmu_context.h>
#include <as-layout.h>
#include <mem_user.h>
#include <os.h>
diff --git a/arch/x86/um/bugs_32.c b/arch/x86/um/bugs_32.c
index 33daff4dade4..d29929efcc07 100644
--- a/arch/x86/um/bugs_32.c
+++ b/arch/x86/um/bugs_32.c
@@ -3,6 +3,7 @@
* Licensed under the GPL
*/

+#include <arch.h>
#include <signal.h>
#include <kern_util.h>
#include <longjmp.h>
diff --git a/arch/x86/um/bugs_64.c b/arch/x86/um/bugs_64.c
index 8cc8256c698d..b01295e8a676 100644
--- a/arch/x86/um/bugs_64.c
+++ b/arch/x86/um/bugs_64.c
@@ -4,6 +4,7 @@
* Licensed under the GPL
*/

+#include <arch.h>
#include <sysdep/ptrace.h>

void arch_check_bugs(void)
diff --git a/arch/x86/um/elfcore.c b/arch/x86/um/elfcore.c
index 650cdbbdaf45..ef50662fc40d 100644
--- a/arch/x86/um/elfcore.c
+++ b/arch/x86/um/elfcore.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/elf.h>
+#include <linux/elfcore.h>
#include <linux/coredump.h>
#include <linux/fs.h>
#include <linux/mm.h>
diff --git a/arch/x86/um/fault.c b/arch/x86/um/fault.c
index 84ac7f7b0257..0dde4d613a87 100644
--- a/arch/x86/um/fault.c
+++ b/arch/x86/um/fault.c
@@ -3,6 +3,7 @@
* Licensed under the GPL
*/

+#include <arch.h>
#include <sysdep/ptrace.h>

/* These two are from asm-um/uaccess.h and linux/module.h, check them. */
diff --git a/arch/x86/um/os-Linux/mcontext.c b/arch/x86/um/os-Linux/mcontext.c
index 49c3744cac37..e80ab7d28117 100644
--- a/arch/x86/um/os-Linux/mcontext.c
+++ b/arch/x86/um/os-Linux/mcontext.c
@@ -3,6 +3,7 @@
#define __FRAME_OFFSETS
#include <asm/ptrace.h>
#include <sysdep/ptrace.h>
+#include <sysdep/mcontext.h>

void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc)
{
diff --git a/arch/x86/um/os-Linux/tls.c b/arch/x86/um/os-Linux/tls.c
index 3e1b1bf6acbc..eed9efe29ade 100644
--- a/arch/x86/um/os-Linux/tls.c
+++ b/arch/x86/um/os-Linux/tls.c
@@ -6,6 +6,7 @@
#include <sys/syscall.h>
#include <unistd.h>

+#include <os.h>
#include <sysdep/tls.h>

#ifndef PTRACE_GET_THREAD_AREA
--
2.34.1


2024-03-26 14:17:39

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH v3 8/9] um: Fix -Wmissing-prototypes warnings for text_poke*

On Wed, Mar 06, 2024 at 06:19:24PM +0800, Tiwei Bie wrote:
>The prototypes for text_poke* are declared in asm/text-patching.h
>under arch/x86/include/. It's safe to include this header, as it's
>UML-aware (by checking CONFIG_UML_X86).

but would it work when building on something other than x86? Or is that
not a thing?

Lucas De Marchi

>
>This will address below -Wmissing-prototypes warnings:
>
>arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes]
>arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes]
>
>Signed-off-by: Tiwei Bie <[email protected]>
>---
> arch/um/kernel/um_arch.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
>index 7a9820797eae..e95f805e5004 100644
>--- a/arch/um/kernel/um_arch.c
>+++ b/arch/um/kernel/um_arch.c
>@@ -23,6 +23,7 @@
> #include <asm/cpufeature.h>
> #include <asm/sections.h>
> #include <asm/setup.h>
>+#include <asm/text-patching.h>
> #include <as-layout.h>
> #include <arch.h>
> #include <init.h>
>--
>2.34.1
>

2024-03-26 14:22:16

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH v3 0/9] um: Minor fixes and cleanups

On Tue, Mar 26, 2024 at 08:27:25PM +0800, Tiwei Bie wrote:
>Hi,
>
>Gentle ping.. Please take a look at this series if possible. The changes
>in this series are very straightforward, so it shouldn't require much effort
>to review. But they cover a wide area, making them prone to conflicts
>with other patches :/, e.g.
>
>https://lore.kernel.org/linux-um/[email protected]/T/#u
>
>Sorry to be impatient, but pinging this. This series was originally posted
>two months ago, and hasn't received a review yet. Just want to make sure that
>this series is not lost..
>
>PS. I have tested this series on both of 64bit and 32bit platforms manually.
>There is also a CI test report from [email protected]:
>
>https://lore.kernel.org/all/[email protected]/


yeah, it's a clear improvement.

For patches 1-5 and 7, feel free to add my Reviewed-by: Lucas De Marchi <[email protected]>
I commented on patch 8 as I'm not sure it's the right approach and same
thing applies to patch 9. Patch 6 I'm just not sure as it's the first
time I see that file, so I will leave it to others.

thanks
Lucas De Marchi

>
>Thanks,
>Tiwei
>
>On 3/6/24 6:19 PM, Tiwei Bie wrote:
>> A series of minor fixes and cleanups for UML.
>>
>> Most changes in this series are very straightforward. Please consider
>> picking this series for v6.9.
>>
>> There are still some remaining -Wmissing-prototypes warnings. I plan to
>> send a followup RFC series first to fix those warnings.
>>
>> Feedbacks on this series would be appreciated. Thanks!
>>
>> Changes since v2:
>> https://lore.kernel.org/lkml/[email protected]/
>> - Add "um: Move declarations to proper headers";
>> - Add "um: Fix -Wmissing-prototypes warnings for text_poke*";
>> - Add "um: Fix -Wmissing-prototypes warnings for __warp_* and foo";
>> - Make do_set_thread_area() static;
>> - Add the missing header for calibrate_delay_is_known;
>>
>> Tiwei Bie (9):
>> um: Make local functions and variables static
>> um: Fix the declaration of vfree
>> um: Remove unused functions
>> um: Fix the return type of __switch_to
>> um: Add missing headers
>> um: Stop tracking host PID in cpu_tasks
>> um: Move declarations to proper headers
>> um: Fix -Wmissing-prototypes warnings for text_poke*
>> um: Fix -Wmissing-prototypes warnings for __warp_* and foo
>>
>> arch/um/drivers/pcap_kern.c | 4 +-
>> arch/um/drivers/ubd_user.c | 2 +-
>> arch/um/include/asm/ptrace-generic.h | 3 ++
>> arch/um/include/shared/as-layout.h | 1 -
>> arch/um/include/shared/kern_util.h | 1 +
>> arch/um/include/shared/um_malloc.h | 2 +-
>> arch/um/kernel/kmsg_dump.c | 2 +-
>> arch/um/kernel/mem.c | 2 +
>> arch/um/kernel/physmem.c | 3 +-
>> arch/um/kernel/process.c | 48 +++++-----------------
>> arch/um/kernel/ptrace.c | 3 --
>> arch/um/kernel/reboot.c | 1 +
>> arch/um/kernel/skas/mmu.c | 1 +
>> arch/um/kernel/skas/process.c | 5 +--
>> arch/um/kernel/time.c | 7 ++--
>> arch/um/kernel/tlb.c | 7 +---
>> arch/um/kernel/um_arch.c | 1 +
>> arch/um/kernel/um_arch.h | 2 +
>> arch/um/os-Linux/drivers/ethertap_kern.c | 2 +-
>> arch/um/os-Linux/drivers/tuntap_kern.c | 2 +-
>> arch/um/os-Linux/main.c | 5 +++
>> arch/um/os-Linux/signal.c | 4 +-
>> arch/um/os-Linux/start_up.c | 1 +
>> arch/x86/um/asm/ptrace.h | 6 +++
>> arch/x86/um/bugs_32.c | 1 +
>> arch/x86/um/bugs_64.c | 1 +
>> arch/x86/um/elfcore.c | 1 +
>> arch/x86/um/fault.c | 1 +
>> arch/x86/um/os-Linux/mcontext.c | 1 +
>> arch/x86/um/os-Linux/registers.c | 2 +-
>> arch/x86/um/os-Linux/tls.c | 1 +
>> arch/x86/um/ptrace_32.c | 2 -
>> arch/x86/um/shared/sysdep/kernel-offsets.h | 3 ++
>> arch/x86/um/tls_32.c | 2 +-
>> arch/x86/um/user-offsets.c | 3 ++
>> 35 files changed, 63 insertions(+), 70 deletions(-)
>>
>

2024-03-26 14:35:06

by Tiwei Bie

[permalink] [raw]
Subject: Re: [PATCH v3 0/9] um: Minor fixes and cleanups

Hi,

Gentle ping.. Please take a look at this series if possible. The changes
in this series are very straightforward, so it shouldn't require much effort
to review. But they cover a wide area, making them prone to conflicts
with other patches :/, e.g.

https://lore.kernel.org/linux-um/[email protected]/T/#u

Sorry to be impatient, but pinging this. This series was originally posted
two months ago, and hasn't received a review yet. Just want to make sure that
this series is not lost..

PS. I have tested this series on both of 64bit and 32bit platforms manually.
There is also a CI test report from [email protected]:

https://lore.kernel.org/all/[email protected]/

Thanks,
Tiwei

On 3/6/24 6:19 PM, Tiwei Bie wrote:
> A series of minor fixes and cleanups for UML.
>
> Most changes in this series are very straightforward. Please consider
> picking this series for v6.9.
>
> There are still some remaining -Wmissing-prototypes warnings. I plan to
> send a followup RFC series first to fix those warnings.
>
> Feedbacks on this series would be appreciated. Thanks!
>
> Changes since v2:
> https://lore.kernel.org/lkml/[email protected]/
> - Add "um: Move declarations to proper headers";
> - Add "um: Fix -Wmissing-prototypes warnings for text_poke*";
> - Add "um: Fix -Wmissing-prototypes warnings for __warp_* and foo";
> - Make do_set_thread_area() static;
> - Add the missing header for calibrate_delay_is_known;
>
> Tiwei Bie (9):
> um: Make local functions and variables static
> um: Fix the declaration of vfree
> um: Remove unused functions
> um: Fix the return type of __switch_to
> um: Add missing headers
> um: Stop tracking host PID in cpu_tasks
> um: Move declarations to proper headers
> um: Fix -Wmissing-prototypes warnings for text_poke*
> um: Fix -Wmissing-prototypes warnings for __warp_* and foo
>
> arch/um/drivers/pcap_kern.c | 4 +-
> arch/um/drivers/ubd_user.c | 2 +-
> arch/um/include/asm/ptrace-generic.h | 3 ++
> arch/um/include/shared/as-layout.h | 1 -
> arch/um/include/shared/kern_util.h | 1 +
> arch/um/include/shared/um_malloc.h | 2 +-
> arch/um/kernel/kmsg_dump.c | 2 +-
> arch/um/kernel/mem.c | 2 +
> arch/um/kernel/physmem.c | 3 +-
> arch/um/kernel/process.c | 48 +++++-----------------
> arch/um/kernel/ptrace.c | 3 --
> arch/um/kernel/reboot.c | 1 +
> arch/um/kernel/skas/mmu.c | 1 +
> arch/um/kernel/skas/process.c | 5 +--
> arch/um/kernel/time.c | 7 ++--
> arch/um/kernel/tlb.c | 7 +---
> arch/um/kernel/um_arch.c | 1 +
> arch/um/kernel/um_arch.h | 2 +
> arch/um/os-Linux/drivers/ethertap_kern.c | 2 +-
> arch/um/os-Linux/drivers/tuntap_kern.c | 2 +-
> arch/um/os-Linux/main.c | 5 +++
> arch/um/os-Linux/signal.c | 4 +-
> arch/um/os-Linux/start_up.c | 1 +
> arch/x86/um/asm/ptrace.h | 6 +++
> arch/x86/um/bugs_32.c | 1 +
> arch/x86/um/bugs_64.c | 1 +
> arch/x86/um/elfcore.c | 1 +
> arch/x86/um/fault.c | 1 +
> arch/x86/um/os-Linux/mcontext.c | 1 +
> arch/x86/um/os-Linux/registers.c | 2 +-
> arch/x86/um/os-Linux/tls.c | 1 +
> arch/x86/um/ptrace_32.c | 2 -
> arch/x86/um/shared/sysdep/kernel-offsets.h | 3 ++
> arch/x86/um/tls_32.c | 2 +-
> arch/x86/um/user-offsets.c | 3 ++
> 35 files changed, 63 insertions(+), 70 deletions(-)
>


2024-03-26 15:12:46

by Tiwei Bie

[permalink] [raw]
Subject: Re: [PATCH v3 0/9] um: Minor fixes and cleanups

On 3/26/24 10:16 PM, Lucas De Marchi wrote:
> On Tue, Mar 26, 2024 at 08:27:25PM +0800, Tiwei Bie wrote:
>> Hi,
>>
>> Gentle ping.. Please take a look at this series if possible. The changes
>> in this series are very straightforward, so it shouldn't require much effort
>> to review. But they cover a wide area, making them prone to conflicts
>> with other patches :/, e.g.
>>
>> https://lore.kernel.org/linux-um/[email protected]/T/#u
>>
>> Sorry to be impatient, but pinging this. This series was originally posted
>> two months ago, and hasn't received a review yet. Just want to make sure that
>> this series is not lost..
>>
>> PS. I have tested this series on both of 64bit and 32bit platforms manually.
>> There is also a CI test report from [email protected]:
>>
>> https://lore.kernel.org/all/[email protected]/
>
>
> yeah, it's a clear improvement.
>
> For patches 1-5 and 7, feel free to add my Reviewed-by: Lucas De Marchi <[email protected]>
> I commented on patch 8 as I'm not sure it's the right approach and same
> thing applies to patch 9.  Patch 6 I'm just not sure as it's the first
> time I see that file, so I will leave it to others.

Thanks for the review! I do appreciate it. :)

Regards,
Tiwei

>
> thanks
> Lucas De Marchi
>
>>
>> Thanks,
>> Tiwei
>>
>> On 3/6/24 6:19 PM, Tiwei Bie wrote:
>>> A series of minor fixes and cleanups for UML.
>>>
>>> Most changes in this series are very straightforward. Please consider
>>> picking this series for v6.9.
>>>
>>> There are still some remaining -Wmissing-prototypes warnings. I plan to
>>> send a followup RFC series first to fix those warnings.
>>>
>>> Feedbacks on this series would be appreciated. Thanks!
>>>
>>> Changes since v2:
>>> https://lore.kernel.org/lkml/[email protected]/
>>> - Add "um: Move declarations to proper headers";
>>> - Add "um: Fix -Wmissing-prototypes warnings for text_poke*";
>>> - Add "um: Fix -Wmissing-prototypes warnings for __warp_* and foo";
>>> - Make do_set_thread_area() static;
>>> - Add the missing header for calibrate_delay_is_known;
>>>
>>> Tiwei Bie (9):
>>>   um: Make local functions and variables static
>>>   um: Fix the declaration of vfree
>>>   um: Remove unused functions
>>>   um: Fix the return type of __switch_to
>>>   um: Add missing headers
>>>   um: Stop tracking host PID in cpu_tasks
>>>   um: Move declarations to proper headers
>>>   um: Fix -Wmissing-prototypes warnings for text_poke*
>>>   um: Fix -Wmissing-prototypes warnings for __warp_* and foo
>>>
>>>  arch/um/drivers/pcap_kern.c                |  4 +-
>>>  arch/um/drivers/ubd_user.c                 |  2 +-
>>>  arch/um/include/asm/ptrace-generic.h       |  3 ++
>>>  arch/um/include/shared/as-layout.h         |  1 -
>>>  arch/um/include/shared/kern_util.h         |  1 +
>>>  arch/um/include/shared/um_malloc.h         |  2 +-
>>>  arch/um/kernel/kmsg_dump.c                 |  2 +-
>>>  arch/um/kernel/mem.c                       |  2 +
>>>  arch/um/kernel/physmem.c                   |  3 +-
>>>  arch/um/kernel/process.c                   | 48 +++++-----------------
>>>  arch/um/kernel/ptrace.c                    |  3 --
>>>  arch/um/kernel/reboot.c                    |  1 +
>>>  arch/um/kernel/skas/mmu.c                  |  1 +
>>>  arch/um/kernel/skas/process.c              |  5 +--
>>>  arch/um/kernel/time.c                      |  7 ++--
>>>  arch/um/kernel/tlb.c                       |  7 +---
>>>  arch/um/kernel/um_arch.c                   |  1 +
>>>  arch/um/kernel/um_arch.h                   |  2 +
>>>  arch/um/os-Linux/drivers/ethertap_kern.c   |  2 +-
>>>  arch/um/os-Linux/drivers/tuntap_kern.c     |  2 +-
>>>  arch/um/os-Linux/main.c                    |  5 +++
>>>  arch/um/os-Linux/signal.c                  |  4 +-
>>>  arch/um/os-Linux/start_up.c                |  1 +
>>>  arch/x86/um/asm/ptrace.h                   |  6 +++
>>>  arch/x86/um/bugs_32.c                      |  1 +
>>>  arch/x86/um/bugs_64.c                      |  1 +
>>>  arch/x86/um/elfcore.c                      |  1 +
>>>  arch/x86/um/fault.c                        |  1 +
>>>  arch/x86/um/os-Linux/mcontext.c            |  1 +
>>>  arch/x86/um/os-Linux/registers.c           |  2 +-
>>>  arch/x86/um/os-Linux/tls.c                 |  1 +
>>>  arch/x86/um/ptrace_32.c                    |  2 -
>>>  arch/x86/um/shared/sysdep/kernel-offsets.h |  3 ++
>>>  arch/x86/um/tls_32.c                       |  2 +-
>>>  arch/x86/um/user-offsets.c                 |  3 ++
>>>  35 files changed, 63 insertions(+), 70 deletions(-)
>>>
>>


2024-03-26 15:22:16

by Tiwei Bie

[permalink] [raw]
Subject: Re: [PATCH v3 8/9] um: Fix -Wmissing-prototypes warnings for text_poke*

On 3/26/24 10:13 PM, Lucas De Marchi wrote:
> On Wed, Mar 06, 2024 at 06:19:24PM +0800, Tiwei Bie wrote:
>> The prototypes for text_poke* are declared in asm/text-patching.h
>> under arch/x86/include/. It's safe to include this header, as it's
>> UML-aware (by checking CONFIG_UML_X86).
>
> but would it work when building on something other than x86? Or is that
> not a thing?

I think it doesn't matter, because uml is x86 only (i.e. uml only supports
x86 currently). And that's how uml works currently. I described the specific
header file to be included in the commit log just to make the changes easier
to review.

PS. The header is included via below search path set in arch/um/Makefile:

HEADER_ARCH := $(SUBARCH)

ifneq ($(filter $(SUBARCH),x86 x86_64 i386),)
HEADER_ARCH := x86
endif
.....
HOST_DIR := arch/$(HEADER_ARCH)
.....
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
-I$(srctree)/$(HOST_DIR)/include/uapi \
-I$(objtree)/$(HOST_DIR)/include/generated \
-I$(objtree)/$(HOST_DIR)/include/generated/uapi

Regards,
Tiwei

>
> Lucas De Marchi
>
>>
>> This will address below -Wmissing-prototypes warnings:
>>
>> arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes]
>> arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes]
>>
>> Signed-off-by: Tiwei Bie <[email protected]>
>> ---
>> arch/um/kernel/um_arch.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
>> index 7a9820797eae..e95f805e5004 100644
>> --- a/arch/um/kernel/um_arch.c
>> +++ b/arch/um/kernel/um_arch.c
>> @@ -23,6 +23,7 @@
>> #include <asm/cpufeature.h>
>> #include <asm/sections.h>
>> #include <asm/setup.h>
>> +#include <asm/text-patching.h>
>> #include <as-layout.h>
>> #include <arch.h>
>> #include <init.h>
>> -- 
>> 2.34.1
>>


2024-03-28 08:46:51

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v3 0/9] um: Minor fixes and cleanups

On Wed, 2024-03-06 at 18:19 +0800, Tiwei Bie wrote:
> A series of minor fixes and cleanups for UML.
>
> Most changes in this series are very straightforward. Please consider
> picking this series for v6.9.
>
> There are still some remaining -Wmissing-prototypes warnings. I plan to
> send a followup RFC series first to fix those warnings.
>
> Feedbacks on this series would be appreciated. Thanks!

LGTM, thanks.

For the series, including 8 and 9 that were discussed before
(but Richard, feel free not to add that individually):

Reviewed-by: Johannes Berg <[email protected]>

I also did build-testing for this, on 64-bit only though right now.

johannes