From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F3F2C4346E for ; Thu, 24 Sep 2020 07:14:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1EB72396D for ; Thu, 24 Sep 2020 07:14:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C41INqRQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbgIXHOq (ORCPT ); Thu, 24 Sep 2020 03:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726929AbgIXHOp (ORCPT ); Thu, 24 Sep 2020 03:14:45 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F73C0613CE for ; Thu, 24 Sep 2020 00:14:45 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id md22so3879244pjb.0 for ; Thu, 24 Sep 2020 00:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uaZaINJO8RTX0sihp8PXPyj8BsV/dJ4sIfFZwNQgCoc=; b=C41INqRQL9wXKNEMfa2Cq9gnH6tyU2aaAcWC397Yxc+X4rbSPPDuT66/6sfi0KWWiT AV3W/hiYgfEi7XEvgRLQHFGN+ClX5VSYAGb+czXbF0QvJFcUcEy8uC8efnlgsJxn6QwE wExB+u9FVWDObRSI8l6Yn6/IWedlC0TTpsCC/yHTLrr9ayV5jt/FiPRL0YbuzkF3zp/9 z7A1A/C+OQeVCNntpiqOrcndO4LluVX7E/gAthh1z6+i8ZgFHrCTPYuJ7cHctzeIz1Kl maTHGbAbHeMgLeIg1DQRmAwQU1GCGzRdTqETNRbZMscyGlhpQ3VWu8JlIzBcZVG4nsij Hlqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uaZaINJO8RTX0sihp8PXPyj8BsV/dJ4sIfFZwNQgCoc=; b=ilYK7AhSI9iQDwH0WFJcQLpJ/RZitC6CWP/VDgBQmxLiYQG7p4XehkAJbPQ9LgK3cw pivhXwTynaLUvHJvD4W3Km2MSaYHzGltP+B/WVv/eX3MQUyhFgQrlQrrMrnlNE/l4TIO 9+8SjnpttATwMrNPYLvhysctPuD/h5w69KYqZH5tFHDNemz/bjU9/OaEmfRGIqNQJBG1 rLls1jWyULmL1E+EEA50YNIfzN27kQfThx1dPTOJxsgUD8JAqnTIubsZ6OQjqAyh1/rr jaagjYkuhWlQKPu/EDjbZ1Rf/0ZIqE19sO8SnLdw1bRWGNSRi3ERsMN2FCuTLg72/0yb tNhQ== X-Gm-Message-State: AOAM533CnOBpIuzdBF4UuCbd4r+f1XlAfSAFCbX3VeBr9AnVlzCihzQ9 kOpfk7z/AFJphjgyFlP6xeY= X-Google-Smtp-Source: ABdhPJzq28mbtDOOoVJ8ZaXyYQry4wEm+ND0PGC2ggHIOU4euhMPSKxxXqQqIPUN5c589bjLvrdp5A== X-Received: by 2002:a17:902:ba8c:b029:d1:e5e7:be6a with SMTP id k12-20020a170902ba8cb02900d1e5e7be6amr3375156pls.68.1600931685359; Thu, 24 Sep 2020 00:14:45 -0700 (PDT) Received: from earth-mac.local (219x123x138x129.ap219.ftth.ucom.ne.jp. [219.123.138.129]) by smtp.gmail.com with ESMTPSA id v8sm1950402pgg.58.2020.09.24.00.14.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Sep 2020 00:14:44 -0700 (PDT) Received: by earth-mac.local (Postfix, from userid 501) id 0CC762037C2080; Thu, 24 Sep 2020 16:14:43 +0900 (JST) From: Hajime Tazaki To: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com Cc: tavi.purdila@gmail.com, retrage01@gmail.com, linux-kernel-library@freelists.org, linux-arch@vger.kernel.org, Hajime Tazaki Subject: [RFC v6 07/21] um: extend arch_switch_to for alternate SUBARCH Date: Thu, 24 Sep 2020 16:12:47 +0900 Message-Id: <4a3090dbb622a5892739573441bbc12a1a849330.1600922528.git.thehajime@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org This commit introduces additional argument of previous task when context switch happens. New SUBARCH can use the new information to switch tasks in a subarch-specific manner. The patch is particularly required by nommu mode implemented as a SUBARCH of UML. Signed-off-by: Hajime Tazaki --- arch/um/kernel/process.c | 6 +++--- arch/x86/um/ptrace_32.c | 2 +- arch/x86/um/syscalls_64.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 26b5e243d3fc..87a8cfa228ca 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -80,7 +80,7 @@ static inline void set_current(struct task_struct *task) { external_pid(), task }); } -extern void arch_switch_to(struct task_struct *to); +extern void arch_switch_to(struct task_struct *from, struct task_struct *to); void *__switch_to(struct task_struct *from, struct task_struct *to) { @@ -88,7 +88,7 @@ void *__switch_to(struct task_struct *from, struct task_struct *to) set_current(to); switch_threads(&from->thread.switch_buf, &to->thread.switch_buf); - arch_switch_to(current); + arch_switch_to(from, to); return current->thread.prev_sched; } @@ -145,7 +145,7 @@ void fork_handler(void) * arch_switch_to isn't needed. We could want to apply this to * improve performance. -bb */ - arch_switch_to(current); + arch_switch_to(NULL, current); current->thread.prev_sched = NULL; diff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c index 2497bac56066..0f184710d4ca 100644 --- a/arch/x86/um/ptrace_32.c +++ b/arch/x86/um/ptrace_32.c @@ -11,7 +11,7 @@ extern int arch_switch_tls(struct task_struct *to); -void arch_switch_to(struct task_struct *to) +void arch_switch_to(struct task_struct *from, struct task_struct *to) { int err = arch_switch_tls(to); if (!err) diff --git a/arch/x86/um/syscalls_64.c b/arch/x86/um/syscalls_64.c index 58f51667e2e4..2ef9474d2bd2 100644 --- a/arch/x86/um/syscalls_64.c +++ b/arch/x86/um/syscalls_64.c @@ -80,7 +80,7 @@ SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2) return arch_prctl(current, option, (unsigned long __user *) arg2); } -void arch_switch_to(struct task_struct *to) +void arch_switch_to(struct task_struct *from, struct task_struct *to) { if ((to->thread.arch.fs == 0) || (to->mm == NULL)) return; -- 2.21.0 (Apple Git-122.2) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLLSp-0003Lq-Ea for linux-um@lists.infradead.org; Thu, 24 Sep 2020 07:14:48 +0000 Received: by mail-pl1-x642.google.com with SMTP id d19so1214826pld.0 for ; Thu, 24 Sep 2020 00:14:47 -0700 (PDT) From: Hajime Tazaki Subject: [RFC v6 07/21] um: extend arch_switch_to for alternate SUBARCH Date: Thu, 24 Sep 2020 16:12:47 +0900 Message-Id: <4a3090dbb622a5892739573441bbc12a1a849330.1600922528.git.thehajime@gmail.com> In-Reply-To: References: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com Cc: tavi.purdila@gmail.com, linux-kernel-library@freelists.org, linux-arch@vger.kernel.org, Hajime Tazaki , retrage01@gmail.com This commit introduces additional argument of previous task when context switch happens. New SUBARCH can use the new information to switch tasks in a subarch-specific manner. The patch is particularly required by nommu mode implemented as a SUBARCH of UML. Signed-off-by: Hajime Tazaki --- arch/um/kernel/process.c | 6 +++--- arch/x86/um/ptrace_32.c | 2 +- arch/x86/um/syscalls_64.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 26b5e243d3fc..87a8cfa228ca 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -80,7 +80,7 @@ static inline void set_current(struct task_struct *task) { external_pid(), task }); } -extern void arch_switch_to(struct task_struct *to); +extern void arch_switch_to(struct task_struct *from, struct task_struct *to); void *__switch_to(struct task_struct *from, struct task_struct *to) { @@ -88,7 +88,7 @@ void *__switch_to(struct task_struct *from, struct task_struct *to) set_current(to); switch_threads(&from->thread.switch_buf, &to->thread.switch_buf); - arch_switch_to(current); + arch_switch_to(from, to); return current->thread.prev_sched; } @@ -145,7 +145,7 @@ void fork_handler(void) * arch_switch_to isn't needed. We could want to apply this to * improve performance. -bb */ - arch_switch_to(current); + arch_switch_to(NULL, current); current->thread.prev_sched = NULL; diff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c index 2497bac56066..0f184710d4ca 100644 --- a/arch/x86/um/ptrace_32.c +++ b/arch/x86/um/ptrace_32.c @@ -11,7 +11,7 @@ extern int arch_switch_tls(struct task_struct *to); -void arch_switch_to(struct task_struct *to) +void arch_switch_to(struct task_struct *from, struct task_struct *to) { int err = arch_switch_tls(to); if (!err) diff --git a/arch/x86/um/syscalls_64.c b/arch/x86/um/syscalls_64.c index 58f51667e2e4..2ef9474d2bd2 100644 --- a/arch/x86/um/syscalls_64.c +++ b/arch/x86/um/syscalls_64.c @@ -80,7 +80,7 @@ SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2) return arch_prctl(current, option, (unsigned long __user *) arg2); } -void arch_switch_to(struct task_struct *to) +void arch_switch_to(struct task_struct *from, struct task_struct *to) { if ((to->thread.arch.fs == 0) || (to->mm == NULL)) return; -- 2.21.0 (Apple Git-122.2) _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um