From patchwork Mon Feb 5 11:47:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 196760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp818643dyb; Mon, 5 Feb 2024 03:48:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcVIX/7Zt6n2k8t8H9d0yp4rHHbzCGwRuarEnjvQpJphr0S2aAJJR3G6NOX1mK1/HKZVV9 X-Received: by 2002:a05:6808:7c5:b0:3bd:cddd:7634 with SMTP id f5-20020a05680807c500b003bdcddd7634mr9330467oij.29.1707133715623; Mon, 05 Feb 2024 03:48:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707133715; cv=pass; d=google.com; s=arc-20160816; b=UD4iTRHd+4KfsT7tGqOiXqsTiw/lqZvL48NdxXarTGVrgQZhDYD2GMQG0uHba5RnD2 MUwZPB8CgRFmew12NZddgYyBwE3Ys61Uy/jByQkGG2PfdkDp7XjcIhd8qMdmk4KbbswK K8nHtDxsTCWk9g3caATX2jS7wO5D1XgFfdMY+LRdWSw6PH8HkQQbowiP5xpRoNlx255g izrtzxT38MaIfh7qjVzzmQJO68qbqf/s5//IzqbulMcwEo3LkoT2flqM40SnwV1fX4Yh SQ9lXfCESlm53DF5JESzdrurW/K29kGTaWv6+g1mmWF/4RP9z7e6sHM2SSojKWdf+BW2 gDcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=thGngCGzJUMo1GZHVFzXxkSEN7RL4c5M22VIb9paXp4=; fh=jQteE8U3uu9g2zbimCvvpgEitkksmcLXSa4poj0r/ZM=; b=IZeETHo7Ws2O/FAvUrI5IgIJYQe5oWZFPEeYktiMzqnfaX2IyCoOYPBh+C69H01fcv yQRDLlJtm46yKKN8SGUZ3Y0DYYTuEoV9ZPQIzBOlaPSokvqRUTktjrcMwv1pxFS6m1Vv cyqqKKfvlMnA4zQBKnoyz7PUhdVZiqxdv+M3NkiEcdyjaZIsDVNPP+vf4oFwkmkhxfZV W3oC0ZVsw6tLVWSfDXynVxiauuJrSd+bv7z1Dcy5sGSKLXlBrP0lfraqPK+g+uA2izOT PjaDh499odLQR1gjc960QxbSaGIVuKMH6rrUkDr3zZmQ7uR5fKnG91m9JoOX/hZxl6Qs aQPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52517-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52517-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com X-Forwarded-Encrypted: i=1; AJvYcCVviWofYFe/3eXRzVOVbIoxrX1ADP8vD+Yp0ms3sakBMjCjvFg8hoI3vJh+2w4nvNaeWNe8t2e1hy+Uotige8tRSBIlnw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w19-20020a056a0014d300b006e052ed9a62si13093pfu.148.2024.02.05.03.48.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:48:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52517-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52517-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52517-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5DCE328B1B9 for ; Mon, 5 Feb 2024 11:48:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A26E1BC40; Mon, 5 Feb 2024 11:47:40 +0000 (UTC) Received: from out187-19.us.a.mail.aliyun.com (out187-19.us.a.mail.aliyun.com [47.90.187.19]) (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 875881BC26 for ; Mon, 5 Feb 2024 11:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.187.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133658; cv=none; b=ihd8nX5HWbcwH1cw/cG0A4tOxmJ044FW3y/Ol4dpcZo+lX1lBt+LDgCgnD21GCgTU3aBkAXItLeyo6od4bdDb3Rhpq1K8g5zKWNRNg86nkp8ficJZVE+6J3DvUhr+6MdGSP9sS+ebiSJFeL4AGudg9ikzPJghwzmZpEvLXoA+qo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133658; c=relaxed/simple; bh=1sr2sdDMijyrY3fpb7f0Qr+PhaKz1rnNX0kYmghypxM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ZaWWa4doAzFAlBzT2i9AH4ZPi+pAp/terPlzPDQ4E2AUOoAFcEPplHT1+LWxV+4/3Mog1tD1uTCdmJqXAy/kpt3sjuiO70D2HXK1hmR88uuW++N3Iv3BFEsUyY0zlhd02dwwAwgUpojeBXmQdMD6881Pvn4iR9z7SGdB0pjNoOw= 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=47.90.187.19 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=01201311R961e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047212;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WNt.Hlx_1707133638; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WNt.Hlx_1707133638) by smtp.aliyun-inc.com; Mon, 05 Feb 2024 19:47:18 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v2 1/6] um: Make local functions and variables static Date: Mon, 05 Feb 2024 19:47:03 +0800 Message-Id: <20240205114708.25235-2-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205114708.25235-1-tiwei.btw@antgroup.com> References: <20240205114708.25235-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790059443318924750 X-GMAIL-MSGID: 1790059443318924750 This will also fix the warnings like: warning: no previous prototype for ‘fork_handler’ [-Wmissing-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; }; -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 = { .write = pcap_write, }; -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 = data; char *remain, *host_if = NULL, *options[2] = { 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 -struct pollfd kernel_pollfd; +static struct pollfd kernel_pollfd; 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 = { .dump = kmsg_dumper_stdout }; -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) } /* Called magically, see new_thread_handler above */ -void fork_handler(void) +static void fork_handler(void) { force_flush_all(); @@ -268,14 +268,14 @@ int clear_user_proc(void __user *buf, int size) static atomic_t using_sysemu = ATOMIC_INIT(0); int sysemu_supported; -void set_using_sysemu(int value) +static void set_using_sysemu(int value) { if (value > sysemu_supported) return; atomic_set(&using_sysemu, value); } -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 = { .proc_write = sysemu_proc_write, }; -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); } -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; } -int setup_time_travel(char *str) +static int setup_time_travel(char *str) { if (strcmp(str, "=inf-cpu") == 0) { time_travel_mode = 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"); -int setup_time_travel_start(char *str) +static int setup_time_travel_start(char *str) { int err; diff --git a/arch/um/os-Linux/drivers/ethertap_kern.c b/arch/um/os-Linux/drivers/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 = { .write = etap_write, }; -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 = data; diff --git a/arch/um/os-Linux/drivers/tuntap_kern.c b/arch/um/os-Linux/drivers/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 = { .write = tuntap_write, }; -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 = data; 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 = 0; -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 = signals_enabled; @@ -108,7 +108,7 @@ static void timer_real_alarm_handler(mcontext_t *mc) timer_handler(SIGALRM, NULL, ®s); } -void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc) +static void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc) { int enabled; diff --git a/arch/x86/um/os-Linux/registers.c b/arch/x86/um/os-Linux/registers.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 -int have_xstate_support; +static int have_xstate_support; int save_i387_registers(int pid, unsigned long *fp_regs) { From patchwork Mon Feb 5 11:47:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 196766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp820591dyb; Mon, 5 Feb 2024 03:53:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo+nfq3W0IFY6B2PCDPqk7MDvvS1b0va8+cHrcZu2dvu+jsB71Dl4LA0Tc56NMVNzpIy4h X-Received: by 2002:a62:ce86:0:b0:6e0:3769:eb92 with SMTP id y128-20020a62ce86000000b006e03769eb92mr2864683pfg.25.1707134033656; Mon, 05 Feb 2024 03:53:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707134033; cv=pass; d=google.com; s=arc-20160816; b=mX0nXVWmP0dLVMqmDIn2loqMUgmSv1rmbQRRVoGhZiPt/lBa/MGElhdxAKb05vMaNi I1RsblzuJvZ6pJ8rSUtyxozyFqn5aXapQO62jPpqxMg/ZUXllx9UM27LgeqV0JAZn0pT 3RLAWcBWf4y5kabFc802DzdX5CT1ZcOhAwez8dw97RoK3BpN1LrNSpycmaB3v0bE3QTL bCSFXIzm5DSh3FNexmTwjXTAbraBYpjLKGX85MMws1XS0PH9riVblXnGf64X1WoDMz61 G4XAnOPOvRQ4LIW5r+4fBI1S/cVtLbCn35ronA/+K1vwzxDTBFBwlSY6ZaJfoHemzG7T ZiBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6wBb4qQBTjRG4qCKgqlX5rEI/gvPtNFtR103JaQWAfU=; fh=+mDGpLu/QkNxKSzz6D1neN9IVVUP84owHI7YGD5I4dc=; b=qN6hZ1Epmj75NcpCncPOHQ/Wku2ScI6UYhC0XLF5Y5PK0SRb+7BonfqBZWTAvfVJ+r inXeVRs8oijXCNbmMLup6wvlz9UrnrsVX/iODJ/B1XAmGrjT1IqpUI+tavzH1xX+zKdr tjtK5ZsNUZchSF9C3b6e7+YBiH81Xnq5EmLx1/14kMccC5HUcslh1WtSmqzGAqP7eXqf xJ/1mO+RsRMUAtjJD5tXdx8sFkQvptMiU0MlAmYkYogdRttpAgL8pqJ75er+bxOzGmuq 7RqgBRKCNMLrtggcZNsTHctNotbge0Ij4/sCB57BrMKx6SB+dcDMaODGicwZ0T3Ns5A+ Jhhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52514-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52514-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com X-Forwarded-Encrypted: i=1; AJvYcCU4MdgTV6rYOU/Fg7T8UZ88QiDqUJ7QobZF62cTrk5qvJPNo0DHCLLTomWQhrPjUQ4veOlDd/vY1WRMvCTG0L83uoLT5g== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bv4-20020a632e04000000b005d6fe985541si5810846pgb.293.2024.02.05.03.53.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:53:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52514-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52514-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52514-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7BCF428B00A for ; Mon, 5 Feb 2024 11:48:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FFBD1B959; Mon, 5 Feb 2024 11:47:32 +0000 (UTC) Received: from out0-212.mail.aliyun.com (out0-212.mail.aliyun.com [140.205.0.212]) (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 39FBA1AACA for ; Mon, 5 Feb 2024 11:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.212 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133650; cv=none; b=pbcwER9ebHBseJweqqQ6dVpj+KLR2XXLGa5sNPB84dgSGrrbXAVuzG5u1HmDMeCtC/z9Q0jpEqjlGyo7kmOx4VkRp7sGhocrXStla9TmzB8nDIQNewMPxyXEaRO/+yA449DdmjIz2qTCIGz0Q9EBfjdNptgPL9d0Tun7527gnVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133650; c=relaxed/simple; bh=IPelaOlLNzUGstOhPXdkzDn7BzmoqqeZFdhJ5KOY6+A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eXsqZLvRgwlpHdENzkpSHT1GWlL19738y7KTx4zKldUdgNAOrKSIp48rADDu1s9/WmUh738+BlLRXld6vyJsB5F1Ujp7dtkMlqBwOuh9ZyefHXm6pPmnCmVA0npXo2fqzFeZRFlO0bWiMv3lHnKVyEtedWxMmpNwWZG49Mp+xXE= 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.212 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=01201311R601e4;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_---.WNt.Hm._1707133638; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WNt.Hm._1707133638) by smtp.aliyun-inc.com; Mon, 05 Feb 2024 19:47:18 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v2 2/6] um: Fix the declaration of vfree Date: Mon, 05 Feb 2024 19:47:04 +0800 Message-Id: <20240205114708.25235-3-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205114708.25235-1-tiwei.btw@antgroup.com> References: <20240205114708.25235-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790059776246534588 X-GMAIL-MSGID: 1790059776246534588 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); extern void *vmalloc(unsigned long size); -extern void vfree(void *ptr); +extern void vfree(const void *ptr); #endif /* __UM_MALLOC_H__ */ From patchwork Mon Feb 5 11:47:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 196763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp820283dyb; Mon, 5 Feb 2024 03:53:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQmVWH+SYkZocgf2bOyIxqibWKLDbY1WFzeOebp7m+KZScPkWS8s9yoH51vK3JtWLk/5u4 X-Received: by 2002:a17:906:b754:b0:a35:fd93:8be3 with SMTP id fx20-20020a170906b75400b00a35fd938be3mr8133410ejb.2.1707133983507; Mon, 05 Feb 2024 03:53:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707133983; cv=pass; d=google.com; s=arc-20160816; b=Rk/v95VtVuY8XA0brZlrb6uIh4Sy2pNq4qId6VXdyy7L+LKBsJWh9RxUXJrgPSSB40 4iISCMUPi0+6aAV2TiNC2lXsrWCaS1puT8UZn5b9lawj3A6dMnza1bWQV4NmSpZI0A/u jNpdAdUs0IPd+K0SiaRep6JfJ71uB4q4itIU0mvWzugJA7suxrZI+voFHJs6oYbg3e23 CbIN1brFBpkM2DI4/rYflSedSZTn24u/8MrIbkVOUSxFUrnr9emUi+gIL3dI4gOXVc5H YJha5LWzrY1NAm6Q+3ESs+CxITq4OVIJy8YqiT3/XugjUQaSx7rhRwJw71d/DeVLnafD W85g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=4+a6MSyPXgEKom2aMNv4B3aI5DSh2DcgVCjXb8KtvOY=; fh=PWHxm1357uCYvpt+BrtH5O1/xzqKWuvwu1BwYxUfVl0=; b=BgpvLPPbo7wjPLeZOAGjpnI+8GQeKfEuEfP5xcQoKy5glxPjrqbIjxADDDaUaHU7r9 DG7Sf4SimnYpMdC0BDMAAaSS6x7qw9IXDBU4tED/aR+mm/b7+htysZpWNRs8pFF1qbum Vroek2+PP5pK9+tJuVE9ZoUEVFEkhN4gC3egO84zX/weTrX2g09rcyVeQyhQTLxVpz2L 2UU8vVts2RdFh7l+XLSQ7VbVciGKpIo++knPnCCUOAQ4VaaTMpCrqhP0Rsgx992Wa+hd De5ELsRe8kNdVxtLAogjfEOalxsUNVjMFQZpY3W+MvWciYXuGMiv1vg0fo/z0OPQOfut jOdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52522-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52522-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com X-Forwarded-Encrypted: i=1; AJvYcCUpLZ3/voB10m8rqgHGmNvAL2tJi8x43afg3+dh8j7jaAbQVBBs8CmfPiW4uGfcR6eLxYYC7oA0Ahfj+9Vrx71hlzqrow== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h19-20020a170906719300b00a3064ce6062si3825773ejk.388.2024.02.05.03.53.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:53:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52522-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52522-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52522-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 220321F227E5 for ; Mon, 5 Feb 2024 11:53:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25371199DC; Mon, 5 Feb 2024 11:52:48 +0000 (UTC) Received: from out0-195.mail.aliyun.com (out0-195.mail.aliyun.com [140.205.0.195]) (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 683F218EB2 for ; Mon, 5 Feb 2024 11:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133966; cv=none; b=eqP/ooutg7ky25lFh/9McCsOHbAOyRDEpaXgCNQJdvumVfM67d+OCET/zrKen6RzEiGshHv11TFgppnfzpVtzPk9T9pvWwCfjxdroxqid6KUYCksjjH+OBvGj5BVBTTlNAUCz9QxD1bbsYGzHOF9bXMAemekUBiXX/uxqTzPGdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133966; c=relaxed/simple; bh=5BvnaK+Q3e30bHwbnZ/Zuza3SgyqFfcHiBGD0cfTfMY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=fRfPy+StFX8L96KhD6NmQJZwnF+seZZ76Lkl1Qo6FCkDJAIbSAUB4+xW+CDrMbpuu0GNBiC2hYOhx+hTZnJuj5hBilLI6Vvcwq1kvi9bMnR1RrETX8GONmPliT/PEJfOAi4ROkoCoG9/sjF0DWhH+KwMMbENfXbzurKFzrLSteo= 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.195 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=01201311R671e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047203;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WNt.Hm5_1707133638; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WNt.Hm5_1707133638) by smtp.aliyun-inc.com; Mon, 05 Feb 2024 19:47:19 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v2 3/6] um: Remove unused functions Date: Mon, 05 Feb 2024 19:47:05 +0800 Message-Id: <20240205114708.25235-4-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205114708.25235-1-tiwei.btw@antgroup.com> References: <20240205114708.25235-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790059723832663129 X-GMAIL-MSGID: 1790059723832663129 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 --- 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; From patchwork Mon Feb 5 11:47:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 196759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp818540dyb; Mon, 5 Feb 2024 03:48:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYy+uZiFGQ26NwOgUBflXL9IP3r+eXYu0x0RiJ6a+siNc1pdQK9TwSdGrcXRLPurZ5eHuZ X-Received: by 2002:aa7:d854:0:b0:560:d8f:7def with SMTP id f20-20020aa7d854000000b005600d8f7defmr5159483eds.17.1707133703188; Mon, 05 Feb 2024 03:48:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707133703; cv=pass; d=google.com; s=arc-20160816; b=DLG0LHb7qbAYWkoi9gnqSzBdGZ8QZ8Z/Pu4gx7Qd9oLzfZshMlYWd/1b2CbF5pGS/4 VZZN3iZhKJ9gysGLmybRqol34/8ITlUlR5FTIc7Ug/6jLBFBLt79VsRH1FldfBwZIxj+ 97VyU4Y6TRPkFKKgDRDaHbsY1UluBvZWrmZSKzuGbhs/SRf70xKcLXAvAclqiWtDsSoH 6btVdghpJXfrUT4TApDFwbH2TnsKq5tzOwfDffvjcE1lX1wpZsvVjtDz+7BlstwmW/Fy sO/uFHGIjI+a3W9KKIsBh8fun4CZOvqy811yZ9VO2dfGxfbyyYWg9BGXW0OjaoB+bIk5 zs1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=gr7z/SlPhRJd7tsl4kQkoTMn2fox0E9luuadMesY+gA=; fh=dBZXBP1Ije55bomAbPc+4rdrqUurKdIX4p3q3I6erAo=; b=H7/M7Cj8cFQ1IdKdOixBQqNhcuvutOGiCfuMafx8pZMaJRSr2QdZdH/FgS0+dAiuwE pMhV7xG2VDsoKloMlF/jt4S8SiagaWAfaeDArPkEJdRXPtakcK98vNCO4RZPklm3zcci KKYJhMH4Zm0GJWm98TKB8iZ1PsE4GalDystMT8WLhg3S5Rl6/QfLmobHL+CvDhQ4n2an qYxSbQH7uot8HE0dtJlf6ls/OPPL1TN0/nLCTWPqhzHp+Qp7b5LKb0qKvNdfnPt4sgtQ yEystV3tw25WnudUmxkhDsr0U2zM7KtNTyF5DMJPpRYbxzLEs6ONK+sOgnTCeNMmgue1 ooGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52516-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52516-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com X-Forwarded-Encrypted: i=1; AJvYcCXMGL5aqECMICuJJIZGHPtivqGw3E+GzLqvrxNjX+A3rmG7Wf1DYKEp9v1dTFUH61C2S0H5OpzslvyVJcUesRcsgeNymg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j10-20020a50d00a000000b0055d33a14abasi3875419edf.367.2024.02.05.03.48.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:48:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52516-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52516-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52516-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C379E1F23A7C for ; Mon, 5 Feb 2024 11:48:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32F721B97C; Mon, 5 Feb 2024 11:47:33 +0000 (UTC) Received: from out0-197.mail.aliyun.com (out0-197.mail.aliyun.com [140.205.0.197]) (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 B4B441AAB1 for ; Mon, 5 Feb 2024 11:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133651; cv=none; b=BeExNfAOzTXlkM6Fc0mDHm46ZhB9Pcz43z98yeQLQJePRx2PjTnYqAM4PzOhsnQ3MmeS7w42+H5VH94QrmByFkZv5OyhXzF5D7LctnvMVLw727fEd3yzyrfoUohsDxhD/fVivIXEN22RmS5zZ+jr8B0STme9NHlHRuInzDZqvJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133651; c=relaxed/simple; bh=e5W/30uahPxnnobqPEw5qPDCHBhsj0fyCzs0F+PD/V8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B0NrkC+TJbfLU1lCHlOhh8K2c8chUTRcXRkyKLMaO4G56j0wDHOnhIzf6pRSiF2n1U9doirHHD1lofVEUDHCjJXQO9JlzGyzVeEbtSB5xpflGDulNKDmm9AywiCbvi/tcjf4eoOvFyuoQS04ol5J1I+juRynPDWascFbIgwGGz8= 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.197 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=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047193;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WNt.HmC_1707133639; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WNt.HmC_1707133639) by smtp.aliyun-inc.com; Mon, 05 Feb 2024 19:47:19 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v2 4/6] um: Fix the return type of __switch_to Date: Mon, 05 Feb 2024 19:47:06 +0800 Message-Id: <20240205114708.25235-5-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205114708.25235-1-tiwei.btw@antgroup.com> References: <20240205114708.25235-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790059430367178586 X-GMAIL-MSGID: 1790059430367178586 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) 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); From patchwork Mon Feb 5 11:47:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 196764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp820373dyb; Mon, 5 Feb 2024 03:53:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUKBJJlH9DK/ol2gfPm3/QtNk2/FwWA7/u4I+50vybkJjGv0h6UNJkDXsi7cxuvquSR+1/ X-Received: by 2002:a17:902:d2d1:b0:1d9:5ce0:224 with SMTP id n17-20020a170902d2d100b001d95ce00224mr15866912plc.0.1707133997353; Mon, 05 Feb 2024 03:53:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707133997; cv=pass; d=google.com; s=arc-20160816; b=PgVUxhZw4+q96Qa8f3S2kScbp8RQkUbky2E78IvhzL7DpY+lrcd4PMBqPgZ8x80jWA UCDO0YgwStYc5Jqjmb/Lo46mB4t3NWL14oJMS+Ynj7RAm+Xc4hv9CX2aElUexONLU18u q3ztNDVXLVEP8YpRdr8JfkGIw5ydlbITIQqDyA8khtfbBaSK2ftWLpRTaXjAEq/cn1N/ UxlaMlqHlbikacLRyR92sV7rBCaiDf1Aw3Q49ji6+OlvYxAOnRdpPpSkYs7Ij16kFhHV eVinKlcZJL6xwDc2mUBkbIruE5Ke98OUf8A3ES3jJRiIGq25rbFSYmpFfUhWe2eF0ih1 Z5wQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=frsTSfnbtdY0EwKKmgBZlH7qjZ5z3lr4ZV/9EOlionA=; fh=kqhUzT5H3GrGIDlnd2x+EoRvJ0VupRenbWrh7UAt3hA=; b=gtf1kCNP35n57zKbdLPelyzdOGTVRm0njjVKqlhRTzhLiEMNrAPYasqeZQe5udc2HM kSkwV9vshh6ggyr1jbPq+TEInUYgGb9BL59uXcvtrq90IA/ymcU6o3uZKM+EIRhKxRxz 3g+V1NeRJQgmLXVmbNoNVG02uYSWb8UfsJtv57GXJPfWoyQzifZ/LfO36uYGOhZSzVT0 yoS3382a2RY9d33tLNYgZ2HOK7dqAE+F3GGJDY3cjKA+69sSc0AJRQLAhqD+7P6fgwZS qnQQdu+B+w/C0e8PV/07q5goXp/cf+t9YISzGGeZziIEHijKGU3HCaJ1k2cVfsQs8yW9 W94Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52523-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52523-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com X-Forwarded-Encrypted: i=1; AJvYcCUx6/NB27+QKadfhLAE7hhLacYlVL6wZHyZ1H5QFrQm8lfxhWO4RLBqIevRZJ7kVYdoBFwJNjYwRjN3WLAZBlJXPb1rDQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w17-20020a170902d11100b001d91e56ea5esi6021972plw.242.2024.02.05.03.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52523-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52523-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52523-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 07E9C2811EE for ; Mon, 5 Feb 2024 11:53:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44AD71B597; Mon, 5 Feb 2024 11:52:58 +0000 (UTC) Received: from out187-18.us.a.mail.aliyun.com (out187-18.us.a.mail.aliyun.com [47.90.187.18]) (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 B81A21A5BA for ; Mon, 5 Feb 2024 11:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.187.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133976; cv=none; b=VhFOd+BYDoL/0Wk3e8zkZazST7D/4fgzsplqljT68exw8XYuWIOlxrszgrQk5ol0gadZWC9rU6eyz+HQFlgo+cybz38oRyjpq29ES6t4tI7BV5xcUNyNb7SCLAcU7lJPGPEHoZI+/e84OboMOZzixRYZK2D66YCUK2ELH8mu7Zw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133976; c=relaxed/simple; bh=5QDpZzhiE/3GWfDd1mWBtLqh/MBq9MNvFNphZMB8Phc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=etcW8Q5UCxHAozX9uOsxCOac4sFA0/HleCCb1TtWBKT8ANZbhtiy33fdvETHGz0xQGYwRnMG+Qy5BWeoC6C0CGAimKMMn9Dk6xCNDHVK07uHx0P92A3L3EbyOPc2la9XPdCbnUFRyiNuGSgqkKR5tC4Y1cKjZHJJMsVTV6AxOFc= 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=47.90.187.18 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=01201311R511e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047192;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WNt.HmH_1707133639; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WNt.HmH_1707133639) by smtp.aliyun-inc.com; Mon, 05 Feb 2024 19:47:19 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v2 5/6] um: Add missing headers Date: Mon, 05 Feb 2024 19:47:07 +0800 Message-Id: <20240205114708.25235-6-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205114708.25235-1-tiwei.btw@antgroup.com> References: <20240205114708.25235-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790059738362569001 X-GMAIL-MSGID: 1790059738362569001 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/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 --- 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/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 + 12 files changed, 14 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 #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 @@ #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 extern void start_kernel(void); 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 #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 */ +#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 */ +#include #include 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 +#include #include #include #include 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 #include /* 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 #include +#include 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 #include +#include #include #ifndef PTRACE_GET_THREAD_AREA From patchwork Mon Feb 5 11:47:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 196758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp818472dyb; Mon, 5 Feb 2024 03:48:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFREDcDrX5OhGqrn+XGhLGCLsI9F+qEzGQDpvwvcBG1dBPz+lZ/nnzV6DnCuWRnOQnje9Tz X-Received: by 2002:a05:620a:2093:b0:785:6099:cf2d with SMTP id e19-20020a05620a209300b007856099cf2dmr7758396qka.26.1707133694319; Mon, 05 Feb 2024 03:48:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707133694; cv=pass; d=google.com; s=arc-20160816; b=ADSb2WW/4kJ1+liHTsOEfVQ+RBmYj8fVwx6ylBVi8rC2Hvak+vEW25pzPSNtogGnBC vF9X8U6ifpxU+TwcLNExwdQhzPD7xSavQQ0gLu4sCRAs8cbGsmP80uW9P1wVqpqeMA1C 5xGqRXq/IJ0N/mgDRQwhWL4CVqjqI5rBNNo67oenzG1C4bBQLowq588o9o6KDLCyjxvy 09w6KMBxNJbn8nXKzmSH1FmBXgxnTnvupWY366AVQNHuINpVLYJvBGTtZPoc2EglZdM/ vvbNa/JcpcCHXbRJ/KyO3mEjya39Cu4hra8xcTESsH9v+TiZnShYuzWxpu1WyQXvoXKE a0Qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=h1sc6HXuCrxiSnNkExDrDx4LaNTePU3zIJt7nkVPy0U=; fh=yFzozlSegErbxvaZWVQqmx/bvvVWuskL+/JUIgnb+9A=; b=KV1vJHQLlpRlKTt6gCDi3YE1MAkG1RUt2RyQeJ1WNJBHzVwm3HBuZR022DyPggbaJk 4wVjrhf7xwE4bmXsPPjVA9xo4MUgGQFn08RM4cVMaD82CFReHjAUC7MfMghmn/pxF5Zy DgymyQxUAUC4BbQqSnYEb8fD3a7YjjE7YidLgluaC5hjGdMP94pDspTu/I52uSQx4gwd r/E0l2mo3jwUxlwAa6OJ8vJHk1SAVy7yOtpyans8yR5rJRU0ppt8yT73dB5fj8MBsJEr 0IAqr1B1A+DGrD8RRF8mmF/A+LdN8oGuBMJ71Eah9TiJ0LVFbO7HXQDyxlDIEd7DDf2L txuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52515-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52515-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com X-Forwarded-Encrypted: i=1; AJvYcCWJ3skrWz33RSuHLYQIaitHhHBVVEnMRBqmex2ynLgepUD9LeRONkl1vgoexT0KOUwsNZ4Tb1pKxy0Wwcp2Ut8ZpW5JhA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id os28-20020a05620a811c00b0078114cc3893si8085301qkn.37.2024.02.05.03.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:48:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52515-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-52515-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52515-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 20D771C225AD for ; Mon, 5 Feb 2024 11:48:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91FB91B95E; Mon, 5 Feb 2024 11:47:32 +0000 (UTC) Received: from out0-193.mail.aliyun.com (out0-193.mail.aliyun.com [140.205.0.193]) (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 BC0461AACE for ; Mon, 5 Feb 2024 11:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133650; cv=none; b=muhoiyAFzPcM05/C4pgzaK1Suj92RxkGe/yT19OqBVUDpd7+AfU6iKksVcrJNhQMMfGjuANkepst8ob5WFzYuajywjOnLnjR67Q2iZ8LXCZ4LYE5WXZjIKunaKZDYGt7qPov1JBAE5IZgQyvcu/c2Kyy2/gUt+ad9HI1n3BbmGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133650; c=relaxed/simple; bh=aeIv3sGdCkzoeZ0Sga2roNKU5ZWZgPhlxgVKkJoerUE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ot0KaQSIiveJspK9+ho7umyc07K4MH2Wrc/NXGA0XPIrOVY27vxqLmh4qx0nTfPhoVco8TTNLtRA64a52xD4JPQ1/DXIlwVf2UY5Aht+AjQWEmRMvsWybSFO7JynmrRHh97um0CcWC0LqcoqYgActTBZ5t74PuGGLAXNnqLVH2M= 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.193 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=ay29a033018047188;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.WNt.HmM_1707133639; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.WNt.HmM_1707133639) by smtp.aliyun-inc.com; Mon, 05 Feb 2024 19:47:20 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v2 6/6] um: Stop tracking host PID in cpu_tasks Date: Mon, 05 Feb 2024 19:47:08 +0800 Message-Id: <20240205114708.25235-7-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205114708.25235-1-tiwei.btw@antgroup.com> References: <20240205114708.25235-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790059420779658073 X-GMAIL-MSGID: 1790059420779658073 The host PID tracked in 'cpu_tasks' is no longer used. Stopping tracking it will also save some cycles. Signed-off-by: Tiwei Bie --- 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 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();