[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Mon, 4 Nov 2024 07:19:39 +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=bestguesspass 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=rAer2j2yfAENfXDtbg92KNc753V86Vqsdiso/bsldAo=; b=mpXIMIjiORkErmJyJNiqzCUqe/API+yJNfHLKZ0MuX5a5WzNg29b/rTw2OLuZr0yp5GtryP0MR4Diba66IDGWRlFkYlUALP070GJ83cdmfO1aOK3uj9DM05uzYM/79ZdLaMC6lRAqXYFBUz07POnAKrBDqwd1Bw/A20sQCtOPqW/wXxAgRuabAw/I+aAnIeKYtNPdVGzXzcEl2JI+OKNJKngBIeYpTtdKvA/qunspmQNNAMgKPXCM11lgzkUiWU9Z2XQWNGgm+WaW2NGM5d5MnloePpqevHzhC0UR80XwOHgUJ/PPI+Wt/ICpqVQxjy4JAqnnmY4Kf4ApZt9qkd46A==
- 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=rAer2j2yfAENfXDtbg92KNc753V86Vqsdiso/bsldAo=; b=KxlsyPSL1O7sWdjTMzT6cg/2yOivRjMsrWS/gcKmnEk65TsXm1VGropHDIZXiyrE0V9wjXdZAov9daVuWNo5/4zO1E+PsKAH0ylboqn81ifbj/z/5Xptru4PbpU3CMFrRfJki1n+YmupjHNBww0Jhp786exldVJYtR2xOf8D0TeMf8V3peJUWp2zKgpTSFQklZ0AKBbo7e+A8ZaMf1+BL+E6ZMLvVB9j7sH4iAs58qyLTjDemWurM3rDED3kUhKGnycjJud79pc8RG21ErJVW7aEZGJIU2mes3MlSsXYPOa4ztlK/n549lWD7SrA/GKTEvZbS2hRTI15M6oAi2LM6Q==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Ob2zEJ5MonAxF9nJyHY/7a1WSTZO20hB/I9QBNUmxK0CYjftv8EI+/fQrQftmWW8aGFXGb3dsmdDdWruNUdbp5mybbuvgAOcLuwL9dq5lEdJxYthtAwbzKdOByLiziUmZuOPlIJV2E7JHAjVrLujDSnaeJ1AcKYu0NVzUdfvhpUOcFiWrbWd5/57wSTxODw1IT6vwBs7kUD/IDB0L9bLJ9XuOwrckJjJ/bqml0o1ylWT8zHezvjBzK7a7SEAaM+xg9JQg9th24YAz9KYkA3ARwK/cyQ5DiJBv5BdlEyCyrleXFZQlVoTdiCm2SgI2rc77lCw2KcEOvV4vuy/3itX6w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XeQtjKkdgIvPTZIOzTkCYqwERtNl/zmG5vlkOulxb0nlB271Q5OfNAloOC7HcJLDkqCpE79Nu44bhG1hbE1m9XfwqLgX9tPQN/yarEj/EiUrpCBDiWMsU4rUjIU1QZ+s22+Kl9dBgJ/cNslq7ByoOr+6gp13gGwrhGrZnSZklHIBiMrzR85wF4IicxQhPOlyFNngzIC+GxDX5PxtwaLID8dcCkcQ9/LDXllL5/N69oL1uaeOgy238ANn1/90hTybdAmhtd0GBlFq4oKrs/nLDmC+z8/AT/EUnkP8YueKwePFltz5/3LvmR9/0TJ7kwKgO17+agra4wyffX8sAhztow==
- 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>, 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 07:27:51 +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/bKiXKqAgAR3wYA=
- Thread-topic: [RFC PATCH 1/4] xen/arm: ffa: Introduce VM to VM support
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.
Cheers
Bertrand
|