Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2295523iob; Sun, 15 May 2022 14:04:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweXgOfCxrMdY6kRRB+LgvUK9frq3yU4hiUHyjWY6u7M0ZSVr35NycrF7b20gknlp+I69xg X-Received: by 2002:a05:600c:2113:b0:394:54ff:415c with SMTP id u19-20020a05600c211300b0039454ff415cmr23828028wml.7.1652648687105; Sun, 15 May 2022 14:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652648687; cv=none; d=google.com; s=arc-20160816; b=zXDFa62ExiaLfcpyB1CXNxiOjh9SpSgnd5GkG0qLJgkRVHzJeZGdSXwj7S3ZxYrE3W LI4HpR/GMdP7O4WSNXRCFA3bbw4DBrYMXkXcrcOZAXANDAD+V2i2ab2UphXvlNlrwCVC rNq1V8gj9YSnqL/eCVoCpv1hdUsOcvs9xyuRGP3NGgtAQHtg+p6K/5ESnH069WR3LiCP 07nlb3LKaqgkbH42fKhBUMJ19uTVGxIrGf5j00VoJ3fkrcfgMci04pcnLVCos/cbLNyj umX5QclasjSlGcDpqToP+Vfw8SkmqjyobANptAYDIC2jbAHuyFvvliHhGbFA4bYuCLOl EqpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=o8WfAImteGnWxWXnrv362LkrmqukwS/k0sn0wCFHvQg=; b=HRst1R2noZ+h3XJ2FkBymT5OKCce4Biuss5nG+hdBpFxaI5tNKRTFFMINIYzty0d9J 9EZpsGu0G6WX0UsfLQ5VwRDhv036D4M/L701flm69C3UIUK4nlAPFP5b2VOuWh61/ACW OkeVQEOj/92In4m02cHKf7+ndIX5WYqqtT6atIfmDoBJ+xu6iqG+W+856lWaH1G3NoOl Zne+POv1euXGct9EiGRL4Jm+nlN3YJy4WV5pB3QmhsAVFPE0smt45RQvKEv8z3pyXCi2 irKoAivUYDu1h4c2SAHpIUN1R1cIO5WLCC791eWVEhnjA8L+27OQMuJvpIqHq0gTX0j/ dkQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=QnP7oL+r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020a05600003c800b0020d08e20f6bsi1183112wrg.638.2022.05.15.14.04.20; Sun, 15 May 2022 14:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=QnP7oL+r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233340AbiEOJUb (ORCPT + 99 others); Sun, 15 May 2022 05:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbiEOJU3 (ORCPT ); Sun, 15 May 2022 05:20:29 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8AC18E0C; Sun, 15 May 2022 02:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1652606422; bh=K+t+73P0OJHpvhXeE0o3aQOX0ORvL1BWBaZ6rStzBaQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QnP7oL+rFHqI00ojDu4Q4L1nWt0PWmGubZJOgzXJTRtPlCMft9TZVnNf0XquLd+8Y cAYnLuwAKfD/pHYJj/FLXAxftqsXDmrmO0Po9AOu0v4dVI3Qpb9GF/tnoa1At44/is VlZVLTxOM32t8Y5jJDhgVF+UEIYcG0z7BIcxfuYo= Received: from [192.168.9.172] (unknown [101.88.28.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id AE210600B5; Sun, 15 May 2022 17:20:21 +0800 (CST) Message-ID: <8c6b0c27-26e3-6668-06b2-57dd27f77496@xen0n.name> Date: Sun, 15 May 2022 17:20:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0a1 Subject: Re: [PATCH V10 11/22] LoongArch: Add process management Content-Language: en-US To: Huacai Chen , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds Cc: linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , Yanteng Si , Huacai Chen , Guo Ren , Xuerui Wang , Jiaxun Yang , Stephen Rothwell References: <20220514080402.2650181-1-chenhuacai@loongson.cn> <20220514080402.2650181-12-chenhuacai@loongson.cn> From: WANG Xuerui In-Reply-To: <20220514080402.2650181-12-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/14/22 16:03, Huacai Chen wrote: > Add process management support for LoongArch, including: thread info > definition, context switch and process tracing. > > Signed-off-by: Huacai Chen > --- > arch/loongarch/include/asm/fpu.h | 129 +++++++ > arch/loongarch/include/asm/idle.h | 9 + > arch/loongarch/include/asm/mmu.h | 16 + > arch/loongarch/include/asm/mmu_context.h | 152 ++++++++ > arch/loongarch/include/asm/processor.h | 209 +++++++++++ > arch/loongarch/include/asm/ptrace.h | 152 ++++++++ > arch/loongarch/include/asm/switch_to.h | 37 ++ > arch/loongarch/include/asm/thread_info.h | 106 ++++++ > arch/loongarch/include/uapi/asm/ptrace.h | 52 +++ > arch/loongarch/kernel/fpu.S | 264 ++++++++++++++ > arch/loongarch/kernel/idle.c | 16 + > arch/loongarch/kernel/process.c | 260 ++++++++++++++ > arch/loongarch/kernel/ptrace.c | 431 +++++++++++++++++++++++ > arch/loongarch/kernel/switch.S | 35 ++ > 14 files changed, 1868 insertions(+) > create mode 100644 arch/loongarch/include/asm/fpu.h > create mode 100644 arch/loongarch/include/asm/idle.h > create mode 100644 arch/loongarch/include/asm/mmu.h > create mode 100644 arch/loongarch/include/asm/mmu_context.h > create mode 100644 arch/loongarch/include/asm/processor.h > create mode 100644 arch/loongarch/include/asm/ptrace.h > create mode 100644 arch/loongarch/include/asm/switch_to.h > create mode 100644 arch/loongarch/include/asm/thread_info.h > create mode 100644 arch/loongarch/include/uapi/asm/ptrace.h > create mode 100644 arch/loongarch/kernel/fpu.S > create mode 100644 arch/loongarch/kernel/idle.c > create mode 100644 arch/loongarch/kernel/process.c > create mode 100644 arch/loongarch/kernel/ptrace.c > create mode 100644 arch/loongarch/kernel/switch.S The context handling code already saw use in released version of strace [1] [2], so it appears appropriate to consider the user-space additions to be in a reasonably good shape already. Reviewed-by: WANG Xuerui [1]: https://github.com/strace/strace/pull/205 [2]: https://github.com/strace/strace/pull/207