From nobody Mon Nov 25 03:03:57 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=1718650765; cv=none; d=zohomail.com; s=zohoarc; b=S6HOXqTff4D8jp5hHqgIvgAFGEiFbdynXCJROl5C83wcWrEjRnzlf6aNxBEft6fMv//A/9a1oAZ93dtw4A13Rs8LZDL1lLhM7UA3doeeY4yG23gH6mxUgGdvRZ4ulPflmcCfKl8JlHEu5UT05r7Y0i2BdOAzF2SUuA8ADD/tdyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718650765; 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=dwK71C7tTjhNtrxFdTarX2bhgrmlVdQhmyIGbCJ+smo=; b=P12K4dO4fP6PT1qoPb4Zhcskwsk3bhU5d4gK3ZrmxinypeWc14A0ZmHbD0oHlzoBFe9/CPRGvnrRqrzm6n/rxzoG6C25Sg8f+dC9RC9OQwBv84oAejDnzi8hXr/IWVtN8Gj8EC9WdsrEeCNY3/mM2wOxcaueABSYvcSLiMM77jQ= 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 1718650765673843.5948151567378; Mon, 17 Jun 2024 11:59:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJHYp-0004NL-FE; Mon, 17 Jun 2024 14:58:35 -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 1sJHYn-0004BA-0a for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:58:33 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJHYl-0004wq-6Z for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:58:32 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-705e9e193caso1749191b3a.2 for ; Mon, 17 Jun 2024 11:58:30 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 11:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718650709; x=1719255509; 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=dwK71C7tTjhNtrxFdTarX2bhgrmlVdQhmyIGbCJ+smo=; b=A8p3KcKiivlXvSuMdCceRgr/OiUbb/rKjx0CYD4zLmlOtMnwhBQtPbSRCGHZkgReXo MIVXbLMkP1mD+WKZ8D0Nol02nUWHORUizYhtxd/WxpyaIFhXPu9zmIBxnHoimGT+1Jn9 LqJapfBMZCCSMeK/KhIkl44Ho9egd4xhIFNwlOYFw2LnwaXXsZ4PXU9qaxbHouwkapNG bBGbJlKnQOmc2re/EhSwp2j1MLjViuPvVqRHPH436teQ1Za3Z5HaM3Aw+k0LLPHmS23/ fuKinW16K02vJZMq5gVncDZ192Ue6EFriLUze+eh+xopTrXfNP9/L6x1DAp73TLJLyD6 EUlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718650709; x=1719255509; 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=dwK71C7tTjhNtrxFdTarX2bhgrmlVdQhmyIGbCJ+smo=; b=Gn1ExcUaDa9nyLDf5L3ykwwPzb/0GASO1dCySUWKZUrqUD53sKN4uWt0yx27rVl0FX GcelUenhF/KgD33dx1utLOPrN89YHQUzre5ElSE0WjVoVRhVN62GdFunO5i330QKpM/w PB+KoPSQFi2NhmyuxY5/0X6dtDse8GkPqKuNoa4JNnnxRw6K5F7aTfGpA+H/Idbkeedw Fja5TqRT5wPMJKmE9I4Ud+bIIs1wZ0xJ/y3it9KJbTCoEXqP/XAzvKxfcPhUE6AqzXzI Evy9TWKaobFelPEFxAeqqDICVGJ4BX776BarWm7qGFXR4d4jG0nkukQd36K1eoqmUtLy u8KQ== X-Gm-Message-State: AOJu0YxUQvPYtMkZbwKS0+OwqlLnAxjgRIfy74x85v6F2KVy7XJI+BDi udft30ujMLxVfZ08RPA4XsuyCKowFAacHx/OU/SB0mpBxaYq/qm9Ctw5zs0GeyU= X-Google-Smtp-Source: AGHT+IFqgN6h2P/8K0byogXjl41jdzz+l0KsyXEjxQI9vH7AUIwNfcdLQUoHOhAtN3EkOIJFXsHPpg== X-Received: by 2002:a05:6a00:178e:b0:705:b0c0:d7d7 with SMTP id d2e1a72fcca58-705d70e3f01mr15639141b3a.7.1718650709331; Mon, 17 Jun 2024 11:58:29 -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 04/23] AArch64 specific CPU for bsd-user Date: Tue, 18 Jun 2024 00:27:45 +0530 Message-Id: <20240617185804.25075-5-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::430; envelope-from=itachis6234@gmail.com; helo=mail-pf1-x430.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: 1718650766185100009 Content-Type: text/plain; charset="utf-8" From: Stacey Son Function to set and recieve thread-local-storage value from tpidr_el0 register Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Reviewed-by: Richard Henderson --- bsd-user/aarch64/target_arch_cpu.c | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 bsd-user/aarch64/target_arch_cpu.c diff --git a/bsd-user/aarch64/target_arch_cpu.c b/bsd-user/aarch64/target_a= rch_cpu.c new file mode 100644 index 0000000000..70ef651827 --- /dev/null +++ b/bsd-user/aarch64/target_arch_cpu.c @@ -0,0 +1,34 @@ +/* + * ARM AArch64 specific CPU for bsd-user + * + * Copyright (c) 2015 Stacey Son + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ +#include "qemu/osdep.h" + +#include "target_arch.h" + +/* See cpu_set_user_tls() in arm64/arm64/vm_machdep.c */ +void target_cpu_set_tls(CPUARMState *env, target_ulong newtls) +{ + + env->cp15.tpidr_el[0] =3D newtls; +} + +target_ulong target_cpu_get_tls(CPUARMState *env) +{ + + return env->cp15.tpidr_el[0]; +} --=20 2.34.1