[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 3/6] xen/arm: ffa: Introduce VM to VM support


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 16 Jul 2025 06:22:19 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=xen.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=TfDaWa6Y7B6oFora8PLVT7ooDOMNy21yuR7EeNEZz6g=; b=QCXJeSysPFnHfTVfiTFO5UE21nEQxVdNYIM2p9iP4ks6K7wXtEjLrm2G/GKYk80HVas7Q9MAoLrrNdfLudau+J/SJqnshHkEy+G4HquoW7vmNnnoP/2C7/rvPOh7i44lgyw4CPMk87zRLgh4eSlpdQHuACF7WewmRaIiXG5Ej2mScD8UEFfu2RfhRh+GhV2RiDDPTyXLlbIroPBFiavPBoCP+4qstYpaFUW3JO83nGrdMKB/FNPtasZ5CbEXYMJbGRddj9NoZ0TudxV+VC1Y6uWEmkxEFzfkk4ocgLx5qpkxWvoKtwdaKj/FODZxDAtNkt7ufac2nTNpcdGjqniJTA==
  • 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=TfDaWa6Y7B6oFora8PLVT7ooDOMNy21yuR7EeNEZz6g=; b=xKCXVM51/Ut4RydB6xH7IMippuft8fRVLyHu1t/A7fLAR8KumISbW8ENzJ8gGBOLC7qNXOcU+37Xf8S7mLKEipisgSAV7DrszkY4SW7w77i/TBVLLA6WXfwREM9Be8RathPtji9oYnYumBuAAYuhRVuRre7luKD3FvltLHVIZhpndvgFegWxBjHer7Sj84K09ZhNi23p6NMqhumft6Gz3zcCRsl7e03Odna3CTeup/U/UjSLPZDckse3nwHf0xFvhDIm0EPIae9mryGrCoCK4ZrflMqt+Uft0M4QVEcOaZFehEf6S1YKob+ipKyHXG0CiPVI+2G27EzUYLQeOl+m9g==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=pRFOGgYChUqvdABEh11VuI0cNiEwFQVbSaO4U5oClDYAW6oxSE8SdbxUgAQbX7BI1udfYV0AaOwc3wOkDx+XhP98Y4VCYx/rA2lna3FHmF/fEFef+8B0HROdGQdD9H+F9gOitMgTjWeoH4Zb7cQdtxb9Fh0P3XoD4sA9CaUr+O2zxrv0RMP+kA3F4p+ojAFTmCMf78JjFF3wx8E5zNEui/ZZKqaQE/ZNPJHpzadgm4Rq0xAUyvF7zmZBnakEbCi0WUiFrqHcRIEejdN1y5JJAqwcTZxeo3TKkmvjVC7UIHgDIzSLjv/cGakrQGChAXkuDXoGZxNguYvMSPey5f4IRQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hkJqhxJ7Pep/jnyxV5IXQ5K7BLJce4TIyfF1lS+jtwx03FGI7ctUcWweKM4+wfBc0XSttHlmPW/1pxitlEPWRXPjvzjbXwH7xyKrVnJw0EBiISfrIsG1Np81t0DXA9495v3y7NGCULCXNfvqGQQjSIUbdcNBTxSkHdzCOmIsuxUgiTke+ymKLaJ6reliZULF49D4XGRdlLdqDS0LrVYqh7SFxIBqrkOrzdItFSIjA29FrF82E7Y7U4Kml2vBLcEXJJUS1cGTKqrUgt7EXnp9r5TgdGbKTbz1/V8Qe775xHQKcpwH5JdP2iY6YEn5sX/nzY2MWcMxYce6Sg1OPyUthg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "jens.wiklander@xxxxxxxxxx" <jens.wiklander@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 16 Jul 2025 06:23:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHbyyty9jTfyAQcDUecgzUaHU35fLPrtYWAgEjoDQA=
  • Thread-topic: [PATCH v6 3/6] xen/arm: ffa: Introduce VM to VM support

Hi Julien,

Sorry for the very long delay.

> On 30 May 2025, at 23:00, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> On 22/05/2025 16:08, Bertrand Marquis wrote:
>> diff --git a/xen/arch/arm/tee/ffa_partinfo.c 
>> b/xen/arch/arm/tee/ffa_partinfo.c
>> index dfa0b23eaf38..66ea1860e97a 100644
>> --- a/xen/arch/arm/tee/ffa_partinfo.c
>> +++ b/xen/arch/arm/tee/ffa_partinfo.c
>> @@ -150,6 +150,67 @@ out:
>>      return ret;
>>  }
>>  +static int32_t ffa_get_vm_partinfo(uint32_t *vm_count, void *dst_buf,
>> +                                   void *end_buf, uint32_t dst_size)
>> +{
>> +    struct ffa_ctx *curr_ctx = current->domain->arch.tee;
>> +    struct ffa_ctx *dest_ctx, *tmp;
>> +    uint32_t count = 0;
>> +
>> +    /*
>> +     * There could potentially be a lot of VMs in the system and we could
>> +     * hold the CPU for long here.
>> +     * Right now there is no solution in FF-A specification to split
>> +     * the work in this case.
>> +     * TODO: Check how we could delay the work or have preemption checks.
>> +     */
>> +    list_for_each_entry_safe(dest_ctx, tmp, &ffa_ctx_head, ctx_list)
> 
> Looking at this code again, I am a bit puzzled why we don't seem to take any 
> lock and use list_for_each_entry_safe().
> 
> I was under the impression that list_for_each_entry_safe() is used if we
> delete an entry within the loop. But it is not used to protect against a 
> deletion from another core.

Yes you are right, my logic here is wrong.

> 
> Did I misunderstand the logic? If not, we possibly want to use a readlock 
> (over the existing spinlock).

Definitely yes, thanks a lot for the review.
I will fix that in v7 by protecting the list using a read lock.

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.