From nobody Mon Nov 25 02:33:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1718650973; cv=none; d=zohomail.com; s=zohoarc; b=O/Fg5kCbh5AEgHKDZijoppOmhwHy/xynSLva7K4bvxmraSr+Rf7pG8lNf41GgroU0+Qh5gLdSRSjSPcofQLC7ySSWkTJvvnG/9Ac/dQm1pM5O5fBqzgsoS6CWtqHD9u0lsGDJK4kYqjDg0JDOIOz1Qz5ToVkHmme/bIv/qzmlpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718650973; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kmiGU0XGOgkNkeKrlW4wG8IDU2PioKKg7Y5d+i/ULYE=; b=VzFEph4+mXELuLN/Kyn2Vb/flFXfsbaCHz7RGdp+plo0sX5zZvqKVlWYHSq6k8FENAyK4V9XBR9a20PmrWweFLfBXDMlgR+P842ogrM4ac0G+cicwwy6KyebR76MW2fgEpy87Od3UD0g0t6NsZDiSSC0ApzTFyMDNNutIFJvXvE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718650973349960.0717116708913; Mon, 17 Jun 2024 12:02:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJHYm-00049T-NW; Mon, 17 Jun 2024 14:58:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJHYk-00044p-Jy for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:58:30 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJHYj-0004wY-3A for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:58:30 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-705c739b878so3731708b3a.1 for ; Mon, 17 Jun 2024 11:58:28 -0700 (PDT) Received: from localhost.localdomain ([106.222.222.115]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705ccb4aa4fsm7660637b3a.131.2024.06.17.11.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 11:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718650707; x=1719255507; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kmiGU0XGOgkNkeKrlW4wG8IDU2PioKKg7Y5d+i/ULYE=; b=jTxHPqyQQkEFVako2s8NLJbsDmO0eX6kJgKcKVJ7WR40DguifIJ1aFPQ0Fbqh514Xz Q1exrHYZWb0ZOgs8XGFRG5dpz4bWXpiVfvh7RH81A6SwpV1x4LzMLL/17TApRq6zXKzz 9sEAKNbRrNjXmVhIn1D2A3MUksmqTd5Nh7ndzUu9VwMw/K8gVWj47yqKd/KjNy+bbJoJ g2STylLymFR9iddLtB50jEIKWXqIz+Y4YeE01m/0FN+welvkG+2cmiYo33kIiAhyWpZH AXJCiXBLvdCpeaD//4Qxw4frODyVwAu9bQ/YsjkRnbNyZ2tue7Y8Boj2J7VQHh5nTKEf 7gXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718650707; x=1719255507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kmiGU0XGOgkNkeKrlW4wG8IDU2PioKKg7Y5d+i/ULYE=; b=nA/572UE2sFb5lkdZxqFV1TVYtcVW9G+7nV/FrLiGN1Qo/MTvoOBUXqXKwJAHZVc9K XPcTwGMrHULte/i4Y9wwga5nF+7ignJ7ToOw9rA2HVh7LxFU7TiIjs+bhp2J4MZOHOsG Pvi+FA8Ddod/EI985/vg4Ki1Ttwv5cK/grZ+Fb+9rZDWdQNgW4R3EHCo0rcW+nRBqrPg nk7i1cFWiLV+ZhsSQXUWYHdGnncs2V63x1AYmezPB5bU+y8MMpSZ4DMd8y+u4SZq+Ixh poG/UMMee8HaVptrz63AGA3Owv0q98iMKZAM/ddzrfNJoHi/XGMYUp9VABQVjZ7EPR0f OHCw== X-Gm-Message-State: AOJu0YxKKhmiHbdJSancrzoU9Insv027DNYbWub64JWWr1v4nCwPKBFK D5y0l2e+7lE3FpTeWCMGOL7lW1AWqH2bWsOyRLmYc73WFGTNv+qqAlnsFfqbU1I= X-Google-Smtp-Source: AGHT+IFK2TgqUuHnvf3PHdJbDqbq54NEpzQq5HOcHRcDHcrV1+l1KI4ggxTOxN8svyLso7qjSTt+9A== X-Received: by 2002:a05:6a20:a924:b0:1ba:ee32:e7f0 with SMTP id adf61e73a8af0-1bcaafaf6dfmr694283637.4.1718650707243; Mon, 17 Jun 2024 11:58:27 -0700 (PDT) From: Ajeet Singh X-Google-Original-From: Ajeet Singh To: qemu-devel@nongnu.org Cc: Warner Losh , Ajeet Singh , Stacey Son , Ajeet Singh Subject: [PATCH 03/23] Added function to clone CPU state Date: Tue, 18 Jun 2024 00:27:44 +0530 Message-Id: <20240617185804.25075-4-itachis@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240617185804.25075-1-itachis@FreeBSD.org> References: <20240617185804.25075-1-itachis@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=itachis6234@gmail.com; helo=mail-pf1-x434.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1718650975207100003 Content-Type: text/plain; charset="utf-8" From: Stacey Son Function can copy cpu state to create new thread Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Reviewed-by: Richard Henderson --- bsd-user/aarch64/target_arch_cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bsd-user/aarch64/target_arch_cpu.h b/bsd-user/aarch64/target_a= rch_cpu.h index 1962d2c99b..4e950305d3 100644 --- a/bsd-user/aarch64/target_arch_cpu.h +++ b/bsd-user/aarch64/target_arch_cpu.h @@ -171,4 +171,21 @@ static inline void target_cpu_loop(CPUARMState *env) } /* for (;;) */ } =20 + +/* See arm64/arm64/vm_machdep.c cpu_fork() */ +static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong ne= wsp) +{ + if (newsp) { + env->xregs[31] =3D newsp; + } + env->regs[0] =3D 0; + env->regs[1] =3D 0; + pstate_write(env, 0); +} + +static inline void target_cpu_reset(CPUArchState *env) +{ +} + + #endif /* TARGET_ARCH_CPU_H */ --=20 2.34.1