[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH v5 6/7] xen/arm: add and call tee_free_domain_ctx()
- To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Fri, 31 May 2024 14:17:20 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dITFB1iRQXWXAw/4BmCnEF2oLlLW8hTxmBdl72Izwns=; b=FdqhbyWSl0BKnV+nB/87IWkgOEnV2hVGsBrd37ELqCSNAX41wQEdGPr6wtkBV+xQDAqwguFohpaFvExSod/tj58QjsiIjTXnGgfW4CD/un0+L9YXOjNW6pz3/C5I3ZmrmYNmfTO0HdPA20fcxSLTis3jDxD1BdhTlBtAyVDslz2iQN/0EgFADkH7aCv5Gev3wlIXapZBSodCr19Vkm/WMgpL+GKHwbUGwsNZYL2GCtZPfGb3xQXnzGngcoPt0ruSiROCXEHpvTU5bcVzn2XMu8dQEryLLSq9f67LErEbMWdihPr4Sflmj855wIMAH8Adqrip2ROEhOPPvbFwT5iiyA==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dITFB1iRQXWXAw/4BmCnEF2oLlLW8hTxmBdl72Izwns=; b=IMjpDJ+jCyhv37PonIsePur9b8UMYhtv/hGXybgBF93iXwLgfIC85Ayrtpxnmjg8JIGSol6tyoHqsuS9I49Xq8PKXyJzX5B/NZW7XL23+OxCy8QRsgKVui4UY8rGU68XQTkWvPIkNqSM0HBimsU4uFXijL57l4sXcNKKDYDRyEpNiEQpuvjfaIeSHulyG/rneyyjOefBQPuNgn6xG/PTQB0k4fQWyW8k3oWkYnZ9VPeDBV+Kft6/f+Teu9Hqm3+574DWsfVs6T4mwJ8SRSnwALSH8C5qsPNzQnULXDgraIYKtqMvDXGCMIO0EK6gFakNcQ0sby+GX+fWuHxBg7N30g==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=GNJZbCGIgDIGDdAj6CqWZRAyhG8ggKWFC0d1tCidm/orur47Ut2C8FYusq5KtUiX14/MIwRx4SV71fKZTPAYMC/o8jo0OKdIt9Fmu9Pf/phVCh+ZDchSYZrl2PiDdVNn6KFVHXyL4BBmN2Il/5400RHXBmNsk9cPDMej0l0fwKND5JN0m2rTr/wtGVo1fedTmwD2mab/pmUm45fWdG74/0CT7S9COwuWxQcbM8aHh4Ybb9k94wEwqz2EXDZ04cRXAJ0vzrm4boQz0w4L37YhZ/OBv64kzaPhOBamYZt5g6a2Q0Uc+G2nYUs+1v/oq6W2KEYQ0YDrh6evtxAC0BcYUw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XrHWc6/GB+vsdX0ua8y90pAuBOkxHjG2Qn10ZatW9ZaY9jH4Nr/fTGv2+J4iuchOv7d1vZd4GMy2ByMGx4guhWS4LKbwYBLjSirvqgM1vbkPDHaVnZWweoir9GFN1qVawUcYkLF98IKTop1EQIQPOeeQrqn4+yRMdeGdRYiakjA/D1i5qVSgQb1TsbLehqfPh8d6V1fnY5ln49pZwrSG4HXEgAEb5/bIwrWHKYi46ujdQ1zr8hryNE1rHQm6yWt/YCxJz30NHX9HrWaxhSjrlNb4TyIjZRTa8V4tSlRV/folX5Dw4EzCEJeCyo1GdySmwccjDSh5TrXMMJtUJn0OTA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "patches@xxxxxxxxxx" <patches@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 31 May 2024 14:17:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHasZmGvrbSer/b/kmljSykDWQao7GxZz6A
- Thread-topic: [XEN PATCH v5 6/7] xen/arm: add and call tee_free_domain_ctx()
Hi Jens,
> On 29 May 2024, at 09:25, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
>
> Add tee_free_domain_ctx() to the TEE mediator framework.
> tee_free_domain_ctx() is called from arch_domain_destroy() to allow late
> freeing of the d->arch.tee context. This will simplify access to
> d->arch.tee for domains retrieved with rcu_lock_domain_by_id().
>
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Cheers
Bertrand
> ---
> xen/arch/arm/domain.c | 1 +
> xen/arch/arm/include/asm/tee/tee.h | 6 ++++++
> xen/arch/arm/tee/tee.c | 6 ++++++
> 3 files changed, 13 insertions(+)
>
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 34cbfe699a68..61e46a157ccc 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -837,6 +837,7 @@ int arch_domain_teardown(struct domain *d)
>
> void arch_domain_destroy(struct domain *d)
> {
> + tee_free_domain_ctx(d);
> /* IOMMU page table is shared with P2M, always call
> * iommu_domain_destroy() before p2m_final_teardown().
> */
> diff --git a/xen/arch/arm/include/asm/tee/tee.h
> b/xen/arch/arm/include/asm/tee/tee.h
> index eda8a8aa38f2..2e99a38184be 100644
> --- a/xen/arch/arm/include/asm/tee/tee.h
> +++ b/xen/arch/arm/include/asm/tee/tee.h
> @@ -38,6 +38,7 @@ struct tee_mediator_ops {
> */
> int (*domain_init)(struct domain *d);
> int (*domain_teardown)(struct domain *d);
> + void (*free_domain_ctx)(struct domain *d);
>
> /*
> * Called during domain destruction to relinquish resources used
> @@ -70,6 +71,7 @@ int tee_domain_teardown(struct domain *d);
> int tee_relinquish_resources(struct domain *d);
> uint16_t tee_get_type(void);
> void init_tee_interrupt(void);
> +void tee_free_domain_ctx(struct domain *d);
>
> #define REGISTER_TEE_MEDIATOR(_name, _namestr, _type, _ops) \
> static const struct tee_mediator_desc __tee_desc_##_name __used \
> @@ -113,6 +115,10 @@ static inline void init_tee_interrupt(void)
> {
> }
>
> +static inline void tee_free_domain_ctx(struct domain *d)
> +{
> +}
> +
> #endif /* CONFIG_TEE */
>
> #endif /* __ARCH_ARM_TEE_TEE_H__ */
> diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
> index 8117fd55123e..cb65f187f51f 100644
> --- a/xen/arch/arm/tee/tee.c
> +++ b/xen/arch/arm/tee/tee.c
> @@ -102,6 +102,12 @@ void __init init_tee_interrupt(void)
> cur_mediator->ops->init_interrupt();
> }
>
> +void tee_free_domain_ctx(struct domain *d)
> +{
> + if ( cur_mediator && cur_mediator->ops->free_domain_ctx)
> + cur_mediator->ops->free_domain_ctx(d);
> +}
> +
> /*
> * Local variables:
> * mode: C
> --
> 2.34.1
>
|