From nobody Tue Feb 10 13:01:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1689578540; cv=none; d=zohomail.com; s=zohoarc; b=lA5FOlTNwmXWvZhhsphXviIeQRThpXNu4tXaGlFGJ9jwAQXmzB4HxiPUzCQyLMn7OCk0odDNFArazK9MFtHM6nPE6JI5JUCGL8XPuGe1z5UhhRJSA/9Tbc4Ow1HxWqZ+HLiobFh5B2VTxUt58R51zxz+kxiRxNRXuu6+KKoOFvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689578540; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=; b=IaVaybzyoa4g2N3223YD+7FstQIoshQGhDtY+DMAiotdokBc6W6OEhHEYoHWTt2BTGBIHc3EGmbIk6yv1n5tkWl3VzhErzB0vjwe8u8XjAbu4Sw69/wMCOsRbYfgGXvBsxXy4BcTi6gKuJrHxgyJHTB+T95tPRqqqDUWE0RuMjA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1689578540963588.5201809930605; Mon, 17 Jul 2023 00:22:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.564190.881592 (Exim 4.92) (envelope-from ) id 1qLIYA-0000oa-1p; Mon, 17 Jul 2023 07:21:42 +0000 Received: by outflank-mailman (output) from mailman id 564190.881592; Mon, 17 Jul 2023 07:21:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLIY9-0000lq-59; Mon, 17 Jul 2023 07:21:41 +0000 Received: by outflank-mailman (input) for mailman id 564190; Mon, 17 Jul 2023 07:21:39 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLIY7-0005A9-IP for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:39 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 916f14b0-2472-11ee-8611-37d641c3527e; Mon, 17 Jul 2023 09:21:38 +0200 (CEST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f954d7309fso5144996e87.1 for ; Mon, 17 Jul 2023 00:21:38 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 00:21:36 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 916f14b0-2472-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689578497; x=1692170497; 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=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=; b=wQrqM2t2606UV0OnFoV2KErLEwJQoYnzx747nLlbR+U3DbAlXjM5LrRtBVRMkkn8HC HyJCITUZwZy/XJoFrplzmTu86j9+Skn8tQWH+CA5fP9jNJ+/cef22S1L5ZxngOSoQwXU Yb3kOKHIPp6Wm4jqDcBdsnkWWSN7tT1o/hc8xCWOUjCfXUK+kxCWnYYuBGRa42w8MrLX gahOCC3tC2itPq/xZNawqqziBj+B0/5oaZyT0Z7U6GDXTb4qOvinb0uvBS6TQatVz5wc 6d+bz1SDyGdrr62YUY2pakJq/2Sqy5Vvk6jSJ/iZnysncboTmTGJ6aH+j4zPHxkxjnrk Peqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689578497; x=1692170497; 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=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=; b=FFjZhhdOb9HGORWAvEMvaT61YON7PziuucYsxhMTilrS0Uib9uRtZUTC7CXqtBLwya QmSg1GRIfVQrEXQ0X5L14ZK7FjK5pjuI0tu0jAUNxYNu0ooX1mtQI6T2ffKKq//ZpEgh eQh8uzIrCmeZvCzBiO8HLzopRimawI71BNC09gt0l8AWz8XlYxImwsQUWkb9Y1l0l38w C0/7CDDsUhGdCthqZSALCNoFsRf3Gak5/kfwxEsF8KJyYKKAGmdbGXP9kr6IMg1WdSRi OwHSjrOjT3rzu9Bc6f6SvUdzEvfIfxl/ZwW/9FhvFonbxfvFAh3GZICKb75DJ4brOt0x eybA== X-Gm-Message-State: ABy/qLYrwMCNLm4FG4BmyZEZ5vgU2IL5M3eyfDTWsvjBf/u+4hHgaaIu JH3NXRDBlzQtWKtVtqSvqr1sA3rhMgo77CAg4PE= X-Google-Smtp-Source: APBJJlGGxa+H0X6sEoILtlGCpBLd3sxIME8YJaVhY4CqTPoCQVaCTJ+SwgtDIbXAAAlhE+ON3Le2mw== X-Received: by 2002:a19:4f05:0:b0:4fb:c9e1:5286 with SMTP id d5-20020a194f05000000b004fbc9e15286mr2707204lfb.7.1689578497391; Mon, 17 Jul 2023 00:21:37 -0700 (PDT) From: Jens Wiklander To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand.Marquis@arm.com, Anthony PERARD , Juergen Gross , Wei Liu , Marc Bonnici , Achin Gupta , Jens Wiklander , Bertrand Marquis , Michal Orzel , Henry Wang Subject: [XEN PATCH v10 15/24] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h Date: Mon, 17 Jul 2023 09:20:58 +0200 Message-Id: <20230717072107.753304-16-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org> References: <20230717072107.753304-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1689578542874100001 Content-Type: text/plain; charset="utf-8" Moves the two helper functions regpair_to_uint64() and uint64_to_regpair() from xen/arch/arm/tee/optee.c to the common arm specific regs.h. This enables reuse of these functions in the FF-A mediator in a subsequent patch. Signed-off-by: Jens Wiklander Reviewed-by: Michal Orzel Reviewed-by: Bertrand Marquis Reviewed-by: Henry Wang --- xen/arch/arm/include/asm/regs.h | 12 ++++++++++++ xen/arch/arm/tee/optee.c | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/reg= s.h index ef34b38aa171..8a0db9541507 100644 --- a/xen/arch/arm/include/asm/regs.h +++ b/xen/arch/arm/include/asm/regs.h @@ -60,6 +60,18 @@ static inline bool guest_mode(const struct cpu_user_regs= *r) register_t get_user_reg(struct cpu_user_regs *regs, int reg); void set_user_reg(struct cpu_user_regs *regs, int reg, register_t value); =20 +static inline uint64_t regpair_to_uint64(register_t reg0, register_t reg1) +{ + return ((uint64_t)reg0 << 32) | (uint32_t)reg1; +} + +static inline void uint64_to_regpair(register_t *reg0, register_t *reg1, + uint64_t val) +{ + *reg0 =3D val >> 32; + *reg1 =3D (uint32_t)val; +} + #endif =20 #endif /* __ARM_REGS_H__ */ diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c index c91bd7d5ac25..5151bd90ed02 100644 --- a/xen/arch/arm/tee/optee.c +++ b/xen/arch/arm/tee/optee.c @@ -273,17 +273,6 @@ static int optee_domain_teardown(struct domain *d) return 0; } =20 -static uint64_t regpair_to_uint64(register_t reg0, register_t reg1) -{ - return ((uint64_t)reg0 << 32) | (uint32_t)reg1; -} - -static void uint64_to_regpair(register_t *reg0, register_t *reg1, uint64_t= val) -{ - *reg0 =3D val >> 32; - *reg1 =3D (uint32_t)val; -} - static struct page_info *get_domain_ram_page(gfn_t gfn) { struct page_info *page; --=20 2.34.1