[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 1/4] xen/arm: ffa: Introduce VM to VM support
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Mon, 4 Nov 2024 08:06:37 +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=arcselector10001; 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=4Z1hpBIDy2slJcSESPQiMzH7oHSvsq0gGPgg4e9XOm0=; b=jgds4KQMl3pGv9C39RoMRXDb08eOSJelWxcLMPd5tOrp2Vp4tQkf79FpqsMu3RF5MqSYPCf+zplLh776vAO/vM+3CMkIyxKOZ6T60zxngU/Rlre0k7m0karUKeClF36N9lcxmYfQ1q6guC8UmcS3+zC7TA3l3FRrAsLuDx/wV5XM/QOr4l2ut+DuSS3S89FyzGc1c7a3e57TOepjP72wm00EBFpBAQ17daVv5dw37hF8LWH3W9lpCM9GU9xnp8w1qDIE65UPOha7fj7PMmlUasK8OfOeq387MaJpMNo7dH/xRicO6lcrCo7Jx3hQLdkSdSzGhK4e6/sJxU1uugQ2Kw==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=4Z1hpBIDy2slJcSESPQiMzH7oHSvsq0gGPgg4e9XOm0=; b=VT5TZv2kOizUE19lLskVxNZaqPyzpDxWCZnzpsx9h526uUjPodk/COh/ARKjjLHQ8rm4QTTHGqNni7FMJ0P9Kj08TTkI4AKHPooxplQgkXA0L2k1jyS05vxTYlGVUu/xxmzxrHs9Lmfxq2tcEgK750LC4hS+vY/X7wW9gT2bbNCiVbvlvIDfQUOWhayG7ww9tw6x8abLiuFaWmEoJQAkWTEYAxXwGHiZvh/JU8cmvQUhy8wOjcDvi7bHw2oNVDdUMXaFw3QQoyKEyL9c+NbUokD7r3nB+DVwfX+7OVRFrL4x/bdQ8t3nbwbZcxgHVZLPfCHqiRNto0nWaNMwRQB8/A==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=fT+foLyNSMVazAT9umpyet3ws9pUqMCLYpJyHDqPgQ/CwZzFX2SVL9YCSb7y+N8J/eliZ7Y8FvA2MRRVuJfAnYXXwhmzisjUvHlflSt7zKrxO/FV8+5M3+TXDxWxzzTllc9dRIqrpeTkj/XELm8v7IDndXrOXCkMpFwtmjmJId0ORWZxQspTXvdpNfxTKbQ6mEiiyAa5FF0NU4GlvSEeWhAxxDEmMJ8aqdCQNIMUMobWSQEdu6dSNxU/QDrUxNcf5+lW1RwwsB3ACrBtwR7/U+IBmGZUEYnV2cmhls4JSujGM2QoR4Rw0mJpEf5UZd+TKGU+qRZnb/aQ6uOgNuZuCw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WBoFWe01DC2OfNu3/pwxeP4Nf9G6ts0Y+KtpJ2WR76qBf/y9HDvE3CRdt1WIR11ECZnFMaTAiKEXBWtCf6yPos7h6VVk+YakQ6PUVPgTzUmg9vTruyS+XmCX6xPApuGGfBX1Gi1gJXIWHK1RrQVxx+dyoNxsHExNApI822eY/wMp6NGT+cwkYDekVAnlSWMIdNCz7WRzPxKcg4dGOamcH8z1pb3wkgfWimLgCCeDP/ROdsogUPLM/peOMAk6ywWPOTJnGQRoVXzfLtF2JMpDLOoQaQOO+XTkcdfcf3CBlw8KLvcZTPjjLhWb0DpyBlFWzN88KHnfyPwmf5O9BfCe8Q==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jens Wiklander <jens.wiklander@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
- Delivery-date: Mon, 04 Nov 2024 08:11:26 +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: AQHbH6z3/b07Z+H2iEKVEGebQub3/bKiXKqAgAR3wYCAAAejgIAABXwA
- Thread-topic: [RFC PATCH 1/4] xen/arm: ffa: Introduce VM to VM support
Hi Jan,
> On 4 Nov 2024, at 08:46, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 04.11.2024 08:19, Bertrand Marquis wrote:
>> Hi Andrew,
>>
>>> On 1 Nov 2024, at 12:05, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>>>
>>> On 16/10/2024 10:21 am, Bertrand Marquis wrote:
>>>> diff --git a/xen/arch/arm/tee/ffa_partinfo.c
>>>> b/xen/arch/arm/tee/ffa_partinfo.c
>>>> index fde187dba4e5..d699a267cc76 100644
>>>> --- a/xen/arch/arm/tee/ffa_partinfo.c
>>>> +++ b/xen/arch/arm/tee/ffa_partinfo.c
>>>> @@ -77,7 +77,21 @@ void ffa_handle_partition_info_get(struct cpu_user_regs
>>>> *regs)
>>>> };
>>>> uint32_t src_size, dst_size;
>>>> void *dst_buf;
>>>> - uint32_t ffa_sp_count = 0;
>>>> + uint32_t ffa_vm_count = 0, ffa_sp_count = 0;
>>>> +#ifdef CONFIG_FFA_VM_TO_VM
>>>> + struct domain *dom;
>>>> +
>>>> + /* Count the number of VM with FF-A support */
>>>> + rcu_read_lock(&domlist_read_lock);
>>>> + for_each_domain( dom )
>>>> + {
>>>> + struct ffa_ctx *vm = dom->arch.tee;
>>>> +
>>>> + if (dom != d && vm != NULL && vm->guest_vers != 0)
>>>> + ffa_vm_count++;
>>>> + }
>>>> + rcu_read_unlock(&domlist_read_lock);
>>>> +#endif
>>>
>>> ...
>>> struct domain *dom;
>>>
>>> if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
>>> {
>>> /* Count the number of VM with FF-A support */
>>> rcu_read_lock(&domlist_read_lock);
>>> ...
>>> rcu_read_unlock(&domlist_read_lock);
>>> }
>>>
>>> drops the explicit ifdef. Hiding function-level variable declarations
>>> behind an ifdef like that works exactly once, and it doesn't make
>>> pleasant code.
>>
>> Ack I will fix that.
>
> While at that, please also name struct domain * type variables "d", not
> "dom". For consistency with (almost) all other code we have.
Sure, I will fix that.
Cheers
Bertrand
>
> Jan
|