From nobody Wed Dec 24 23:49:44 2025 Received: from out0-205.mail.aliyun.com (out0-205.mail.aliyun.com [140.205.0.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F2595D725 for ; Tue, 23 Jan 2024 11:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.205 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008159; cv=none; b=LueeFDrAAov4xv1HKCjFbXZLnNK+wi0ozlBtXuMPJsKaThQwjpZ1jE8on1bIwony2dLDyTGL9Zw17g1/B0g8OD34pcMWhdxFHBiN6qHKoQJmHC6yLj3a9jBWZoJsWweUuVWpJBm2yzon02kkThkNu8CPd1zT0s369uOpxsp51Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008159; c=relaxed/simple; bh=1sr2sdDMijyrY3fpb7f0Qr+PhaKz1rnNX0kYmghypxM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ZErlpClVIFZoJwrSzZGtynpVcd3A3rgK7nQcl0M553K5Q16OmurFGCh5hhOo3yV4NydalPQgm6vK6LxCLl48Sm1teODBg67IVtWUSL/wj4OFYGfx6iCBEoFiTiAiAKbKBVgrxrA4kYbMDrBr8emkpbSAB/shycq5cU0orPoA7BM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=140.205.0.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047211;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WDCKTjh_1706007835; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WDCKTjh_1706007835) by smtp.aliyun-inc.com; Tue, 23 Jan 2024 19:03:55 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 1/5] um: Make local functions and variables static Date: Tue, 23 Jan 2024 19:03:43 +0800 Message-Id: <20240123110347.1274217-2-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123110347.1274217-1-tiwei.btw@antgroup.com> References: <20240123110347.1274217-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This will also fix the warnings like: warning: no previous prototype for =E2=80=98fork_handler=E2=80=99 [-Wmissin= g-prototypes] 140 | void fork_handler(void) | ^~~~~~~~~~~~ Signed-off-by: Tiwei Bie --- arch/um/drivers/pcap_kern.c | 4 ++-- arch/um/drivers/ubd_user.c | 2 +- arch/um/kernel/kmsg_dump.c | 2 +- arch/um/kernel/process.c | 8 ++++---- arch/um/kernel/time.c | 6 +++--- arch/um/os-Linux/drivers/ethertap_kern.c | 2 +- arch/um/os-Linux/drivers/tuntap_kern.c | 2 +- arch/um/os-Linux/signal.c | 4 ++-- arch/x86/um/os-Linux/registers.c | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/um/drivers/pcap_kern.c b/arch/um/drivers/pcap_kern.c index 25ee2c97ca21..d9bf95d7867b 100644 --- a/arch/um/drivers/pcap_kern.c +++ b/arch/um/drivers/pcap_kern.c @@ -15,7 +15,7 @@ struct pcap_init { char *filter; }; =20 -void pcap_init_kern(struct net_device *dev, void *data) +static void pcap_init_kern(struct net_device *dev, void *data) { struct uml_net_private *pri; struct pcap_data *ppri; @@ -50,7 +50,7 @@ static const struct net_kern_info pcap_kern_info =3D { .write =3D pcap_write, }; =20 -int pcap_setup(char *str, char **mac_out, void *data) +static int pcap_setup(char *str, char **mac_out, void *data) { struct pcap_init *init =3D data; char *remain, *host_if =3D NULL, *options[2] =3D { NULL, NULL }; diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c index a1afe414ce48..b4f8b8e60564 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c @@ -23,7 +23,7 @@ #include #include =20 -struct pollfd kernel_pollfd; +static struct pollfd kernel_pollfd; =20 int start_io_thread(unsigned long sp, int *fd_out) { diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c index 427dd5a61a38..4382cf02a6d1 100644 --- a/arch/um/kernel/kmsg_dump.c +++ b/arch/um/kernel/kmsg_dump.c @@ -57,7 +57,7 @@ static struct kmsg_dumper kmsg_dumper =3D { .dump =3D kmsg_dumper_stdout }; =20 -int __init kmsg_dumper_stdout_init(void) +static int __init kmsg_dumper_stdout_init(void) { return kmsg_dump_register(&kmsg_dumper); } diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index ab95648e93e1..20f3813143d8 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -137,7 +137,7 @@ void new_thread_handler(void) } =20 /* Called magically, see new_thread_handler above */ -void fork_handler(void) +static void fork_handler(void) { force_flush_all(); =20 @@ -268,14 +268,14 @@ int clear_user_proc(void __user *buf, int size) static atomic_t using_sysemu =3D ATOMIC_INIT(0); int sysemu_supported; =20 -void set_using_sysemu(int value) +static void set_using_sysemu(int value) { if (value > sysemu_supported) return; atomic_set(&using_sysemu, value); } =20 -int get_using_sysemu(void) +static int get_using_sysemu(void) { return atomic_read(&using_sysemu); } @@ -313,7 +313,7 @@ static const struct proc_ops sysemu_proc_ops =3D { .proc_write =3D sysemu_proc_write, }; =20 -int __init make_proc_sysemu(void) +static int __init make_proc_sysemu(void) { struct proc_dir_entry *ent; if (!sysemu_supported) diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 3e270da6b6f6..efa5b9c97992 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -319,7 +319,7 @@ void time_travel_add_event_rel(struct time_travel_event= *e, time_travel_add_event(e, time_travel_time + delay_ns); } =20 -void time_travel_periodic_timer(struct time_travel_event *e) +static void time_travel_periodic_timer(struct time_travel_event *e) { time_travel_add_event(&time_travel_timer_event, time_travel_time + time_travel_timer_interval); @@ -812,7 +812,7 @@ unsigned long calibrate_delay_is_known(void) return 0; } =20 -int setup_time_travel(char *str) +static int setup_time_travel(char *str) { if (strcmp(str, "=3Dinf-cpu") =3D=3D 0) { time_travel_mode =3D TT_MODE_INFCPU; @@ -862,7 +862,7 @@ __uml_help(setup_time_travel, "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"); =20 -int setup_time_travel_start(char *str) +static int setup_time_travel_start(char *str) { int err; =20 diff --git a/arch/um/os-Linux/drivers/ethertap_kern.c b/arch/um/os-Linux/dr= ivers/ethertap_kern.c index 3182e759d8de..5e5ee40680ce 100644 --- a/arch/um/os-Linux/drivers/ethertap_kern.c +++ b/arch/um/os-Linux/drivers/ethertap_kern.c @@ -63,7 +63,7 @@ const struct net_kern_info ethertap_kern_info =3D { .write =3D etap_write, }; =20 -int ethertap_setup(char *str, char **mac_out, void *data) +static int ethertap_setup(char *str, char **mac_out, void *data) { struct ethertap_init *init =3D data; =20 diff --git a/arch/um/os-Linux/drivers/tuntap_kern.c b/arch/um/os-Linux/driv= ers/tuntap_kern.c index adcb6717be6f..ff022d9cf0dd 100644 --- a/arch/um/os-Linux/drivers/tuntap_kern.c +++ b/arch/um/os-Linux/drivers/tuntap_kern.c @@ -53,7 +53,7 @@ const struct net_kern_info tuntap_kern_info =3D { .write =3D tuntap_write, }; =20 -int tuntap_setup(char *str, char **mac_out, void *data) +static int tuntap_setup(char *str, char **mac_out, void *data) { struct tuntap_init *init =3D data; =20 diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index 24a403a70a02..787cfb9a0308 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c @@ -72,7 +72,7 @@ static int signals_blocked; static unsigned int signals_pending; static unsigned int signals_active =3D 0; =20 -void sig_handler(int sig, struct siginfo *si, mcontext_t *mc) +static void sig_handler(int sig, struct siginfo *si, mcontext_t *mc) { int enabled =3D signals_enabled; =20 @@ -108,7 +108,7 @@ static void timer_real_alarm_handler(mcontext_t *mc) timer_handler(SIGALRM, NULL, ®s); } =20 -void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *m= c) +static void timer_alarm_handler(int sig, struct siginfo *unused_si, mconte= xt_t *mc) { int enabled; =20 diff --git a/arch/x86/um/os-Linux/registers.c b/arch/x86/um/os-Linux/regist= ers.c index df8f4b4bf98b..f3638dd09cec 100644 --- a/arch/x86/um/os-Linux/registers.c +++ b/arch/x86/um/os-Linux/registers.c @@ -17,7 +17,7 @@ #include #include =20 -int have_xstate_support; +static int have_xstate_support; =20 int save_i387_registers(int pid, unsigned long *fp_regs) { --=20 2.34.1 From nobody Wed Dec 24 23:49:44 2025 Received: from out0-218.mail.aliyun.com (out0-218.mail.aliyun.com [140.205.0.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 729EF5C8EE for ; Tue, 23 Jan 2024 11:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008775; cv=none; b=GBeFsBgz8ZjGcUWW84c+u9kbTlrJqAC7DBmb1JOiM6Ignp0Ve7aW/BG1qiEMr6zQ4HetZtAWWZN/roF0nLiySz07N9iE3wl9MmpvD8RrcHrv5HDoAL9Ef+ePcyslaVZcemz0QHkqsqZHPvJPu023yfjSCV7OI3O8B8RQZhWWkU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008775; c=relaxed/simple; bh=IPelaOlLNzUGstOhPXdkzDn7BzmoqqeZFdhJ5KOY6+A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ThW3C3S/f5vYDBV3YGzU0z/P2qE/Tn5PhltSReoXDRMDoCd/pMiNvR9GaJRA/uZd9seF0G9QFPEhq0BdGWVHX3uyJg8JQxlDMfoWnzVBnvTVPUxLLTnJX2vYZdA0OX4u/lrxSMaxgtOWVhi+4ij12w3N3Pqqjoag6jzK5k9BszY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=140.205.0.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R571e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047187;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WDCKTjv_1706007836; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WDCKTjv_1706007836) by smtp.aliyun-inc.com; Tue, 23 Jan 2024 19:03:56 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 2/5] um: Fix the declaration of vfree Date: Tue, 23 Jan 2024 19:03:44 +0800 Message-Id: <20240123110347.1274217-3-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123110347.1274217-1-tiwei.btw@antgroup.com> References: <20240123110347.1274217-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The definition of vfree has changed since commit b3bdda02aa54 ("vmalloc: add const to void* parameters"). Update the declaration of vfree in um_malloc.h to match the latest definition. Signed-off-by: Tiwei Bie --- arch/um/include/shared/um_malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/include/shared/um_malloc.h b/arch/um/include/shared/um= _malloc.h index 13da93284c2c..d25084447c69 100644 --- a/arch/um/include/shared/um_malloc.h +++ b/arch/um/include/shared/um_malloc.h @@ -12,7 +12,7 @@ extern void *uml_kmalloc(int size, int flags); extern void kfree(const void *ptr); =20 extern void *vmalloc(unsigned long size); -extern void vfree(void *ptr); +extern void vfree(const void *ptr); =20 #endif /* __UM_MALLOC_H__ */ =20 --=20 2.34.1 From nobody Wed Dec 24 23:49:44 2025 Received: from out0-205.mail.aliyun.com (out0-205.mail.aliyun.com [140.205.0.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31E8B5D72F for ; Tue, 23 Jan 2024 11:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.205 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008775; cv=none; b=i9FaBP7/EBNE9DaG/sqnY3/gAX8IbFBOmKzENobCVWlsfeVtR9FpwyIPgLjOf5mcPoXOOpV1vQM2vhqbhyNt50BHQ58E64/hpHRSbPyGhIDlO7MbJNrFPHsG217O1ypqIrZhO3Fdpva+bzJ7wUDMh9GEt8/Run4SiLQilyPJNuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008775; c=relaxed/simple; bh=5BvnaK+Q3e30bHwbnZ/Zuza3SgyqFfcHiBGD0cfTfMY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=nTLuuKU9eMPNXBzGCK8RZl29KOtsrHwszWBDajJSjQ+vB9KN8BiklSWYX6Pg4DhbSuxxh4gRME8pd2pV2u+yIl1E1bM1uaFxP9RLRjwop+FbEKKcqZBrjP387ffylsa0vqISZMaXHMvg4DkZ52em0UEwYSYUAF9yn+46elRlxzs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=140.205.0.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047190;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WDCKTk0_1706007836; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WDCKTk0_1706007836) by smtp.aliyun-inc.com; Tue, 23 Jan 2024 19:03:56 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 3/5] um: Remove unused functions Date: Tue, 23 Jan 2024 19:03:45 +0800 Message-Id: <20240123110347.1274217-4-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123110347.1274217-1-tiwei.btw@antgroup.com> References: <20240123110347.1274217-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 =E2=80=98= pid_to_processor_id=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/process.c:253:5: warning: no previous prototype for =E2=80= =98copy_to_user_proc=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/process.c:263:5: warning: no previous prototype for =E2=80= =98clear_user_proc=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/tlb.c:579:6: warning: no previous prototype for =E2=80=98flu= sh_tlb_mm_range=E2=80=99 [-Wmissing-prototypes] Signed-off-by: Tiwei Bie --- 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]; } =20 -int pid_to_processor_id(int pid) -{ - int i; - - for (i =3D 0; i < ncpus; i++) { - if (cpu_tasks[i].pid =3D=3D 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); =20 -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); } =20 -int clear_user_proc(void __user *buf, int size) -{ - return clear_user(buf, size); -} - static atomic_t using_sysemu =3D ATOMIC_INIT(0); int sysemu_supported; =20 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, unsig= ned long start, } EXPORT_SYMBOL(flush_tlb_range); =20 -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; --=20 2.34.1 From nobody Wed Dec 24 23:49:44 2025 Received: from out0-218.mail.aliyun.com (out0-218.mail.aliyun.com [140.205.0.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A5E15D72E for ; Tue, 23 Jan 2024 11:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008159; cv=none; b=nwZP9SQmAK68DOdwNdBwjHcjG1R0eYSQ5YoWksnXuOwLrlS2U/IoMI1KXqMVSiSyihHtN9WotE40YylFfCbovqZE0Hkzy4zAj2rOczhPIypU4gs2PpLdI8x4VBSlzbrZ2AJQ9ZJT2Ku17gBYyWvUD2uG6bhjKsp3JainEA4b5JE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008159; c=relaxed/simple; bh=e5W/30uahPxnnobqPEw5qPDCHBhsj0fyCzs0F+PD/V8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kZFw8QVM0hXZifY1uSSPdpg1i6HbieVrHKSLlvg+ZaGt8hXjB84uVR/R0jpI1k1J2S+WWOGFrDhbuakp7KeR/plTO5vGtiiYiDRsZICUfe3bLVRzDquE8t/WEyg/bjuU8BlxRJQZIPWDL6FnB4k2Kpgi6AD0rM9ThNCLPa0xRic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=140.205.0.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047199;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WDCKTk8_1706007836; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WDCKTk8_1706007836) by smtp.aliyun-inc.com; Tue, 23 Jan 2024 19:03:57 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 4/5] um: Fix the return type of __switch_to Date: Tue, 23 Jan 2024 19:03:46 +0800 Message-Id: <20240123110347.1274217-5-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123110347.1274217-1-tiwei.btw@antgroup.com> References: <20240123110347.1274217-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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 #include #include +#include #include #include #include @@ -73,7 +74,7 @@ static inline void set_current(struct task_struct *task) =20 extern void arch_switch_to(struct task_struct *to); =20 -void *__switch_to(struct task_struct *from, struct task_struct *to) +struct task_struct *__switch_to(struct task_struct *from, struct task_stru= ct *to) { to->thread.prev_sched =3D from; set_current(to); --=20 2.34.1 From nobody Wed Dec 24 23:49:44 2025 Received: from out0-201.mail.aliyun.com (out0-201.mail.aliyun.com [140.205.0.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 223645DF3D for ; Tue, 23 Jan 2024 11:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008164; cv=none; b=hc+U5Lq3vavuPL2YiaVeSnMQnhgrLn/g5ZTDOZci2E+c2MgIPAxAPXT4oMGyOkRHBtpW5nmlWOPqYz+oZLFdgASGaJ5+OFWjO8sx1RlA9ERCWCgp188+C6WYLKJPQ4DO1cAdV0/m56/VL2qpO8yzde8FV88NRULmQpMGOqWdV2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706008164; c=relaxed/simple; bh=awK4ouFeeJNCU3Mx7RTOrJMX6P6PIS34KaVNNCUJsFQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=aODY4nqJjK47KHukY2hq9miRF5DciNhcFgMRnBKB2bokRpFNoQ7vJkBGELqXuiW06WC1v6ApZkL8IBmS8p/Q2Rk7kO+JlrcuLB/Us3fWA5IrWsOlCuXdBMyJtPcnqp5ajalv+Non9YSoW3dvJy+WvesVdSLDj5JqYSkRoSKkvcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=140.205.0.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047205;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WDCKTkS_1706007837; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WDCKTkS_1706007837) by smtp.aliyun-inc.com; Tue, 23 Jan 2024 19:03:57 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 5/5] um: Add missing headers Date: Tue, 23 Jan 2024 19:03:47 +0800 Message-Id: <20240123110347.1274217-6-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123110347.1274217-1-tiwei.btw@antgroup.com> References: <20240123110347.1274217-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This will address below -Wmissing-prototypes warnings: arch/um/kernel/mem.c:202:8: warning: no previous prototype for =E2=80=98pgd= _alloc=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/mem.c:215:7: warning: no previous prototype for =E2=80=98uml= _kmalloc=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/process.c:207:6: warning: no previous prototype for =E2=80= =98arch_cpu_idle=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/process.c:328:15: warning: no previous prototype for =E2=80= =98arch_align_stack=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/reboot.c:45:6: warning: no previous prototype for =E2=80=98m= achine_restart=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/reboot.c:51:6: warning: no previous prototype for =E2=80=98m= achine_power_off=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/reboot.c:57:6: warning: no previous prototype for =E2=80=98m= achine_halt=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/skas/mmu.c:17:5: warning: no previous prototype for =E2=80= =98init_new_context=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/skas/mmu.c:60:6: warning: no previous prototype for =E2=80= =98destroy_context=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/skas/process.c:36:12: warning: no previous prototype for =E2= =80=98start_uml=E2=80=99 [-Wmissing-prototypes] arch/um/kernel/tlb.c:594:6: warning: no previous prototype for =E2=80=98for= ce_flush_all=E2=80=99 [-Wmissing-prototypes] arch/x86/um/bugs_64.c:9:6: warning: no previous prototype for =E2=80=98arch= _check_bugs=E2=80=99 [-Wmissing-prototypes] arch/x86/um/bugs_64.c:13:6: warning: no previous prototype for =E2=80=98arc= h_examine_signal=E2=80=99 [-Wmissing-prototypes] arch/x86/um/fault.c:18:5: warning: no previous prototype for =E2=80=98arch_= fixup=E2=80=99 [-Wmissing-prototypes] arch/x86/um/os-Linux/mcontext.c:7:6: warning: no previous prototype for =E2= =80=98get_regs_from_mc=E2=80=99 [-Wmissing-prototypes] Signed-off-by: Tiwei Bie --- 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/tlb.c | 1 + arch/x86/um/bugs_32.c | 1 + arch/x86/um/bugs_64.c | 1 + arch/x86/um/fault.c | 1 + arch/x86/um/os-Linux/mcontext.c | 1 + 10 files changed, 12 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 #include #include +#include #include #include #include #include #include #include +#include #include =20 #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 #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include 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 #include #include +#include #include #include #include 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 @@ =20 #include #include +#include #include #include #include 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 #include #include +#include =20 extern void start_kernel(void); =20 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 =20 #include +#include #include #include #include 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 */ =20 +#include #include #include #include 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 */ =20 +#include #include =20 void arch_check_bugs(void) 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 */ =20 +#include #include =20 /* 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/mcontex= t.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 #include +#include =20 void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc) { --=20 2.34.1