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

Re: [PATCH v2] xen/arm: Reorder SCI resource cleanup in domain destruction


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Wed, 24 Sep 2025 08:54:09 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=KPzWaI8ECtuovcPkRp2gxC7xqQHeV5oSsCr7QsGxeF0=; b=FM+try783nuSHXD92h4514AHvap4L2nJcx6N7v0vqTSvuFizi25Hqa/pfiBHm8niz2vWRCC80yrjw/cnxWZvVycwjDj6JV4e3bBHB4JjD8ew5w5noInkEbztuIMLtpTWhEU3j6Ur8IajUtJ5fXCmAaVZuHEg+U1anms63aDUKKQjYtkZMvJScOS9eD0f+QIVjb9WdTm2YUWL7xsAkBU8/QRmWIpH+LJm/GktkvytNnjymrlDMcrkFMFueV/xfaDYwUJSQ4vZqIsPeLhsemVMzU2TTxz+qPmUTaMfuuJoFatnPK8iy0rnA6FLMUqvm3gmBquDAZcgzYLSpuFtefxjOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cogcIfnzIQEh94CprxZA+S/6VV/IXnFvSydl+EcLErXW6CsGqOsOZ+jaGOzCUpVmJCiQ/oLv1dxu5F7f0DpM/QA30cqpM5Sgp3VeCxOZScuyuw0+meNhp7WivvUvpniNQ2Q6ioRxjJv7dEQ1kbZKj2sVFoQTrh/yv1iX5wkcYsUkBla/G3bG0agmRHwIbFBbwlHGj9MUrDXGKbOaWr5PvUyWGHGds1tloAOay9mQwneSYkpz8GPIped/ONnM8fWlDWbtWKICZ1dTYvkD1XOQbQ/ACJAwZ6nhIN2DOVQnWbCqVAfL8x2RnSfNEHbbJ+ZZBzX23e3ddr/Uhnbfj6+Eiw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Wed, 24 Sep 2025 08:54:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcJXs1K3LqZ5+aqE65C1kspBdxM7SfhaoAgAKQ8gA=
  • Thread-topic: [PATCH v2] xen/arm: Reorder SCI resource cleanup in domain destruction

Hi Julien,

On 22/09/2025 20:42, Julien Grall wrote:
> (+ Release manager)
>
> Hi,
>
> On 14/09/2025 14:26, Oleksii Moisieiev wrote:
>> Move the SCI (System Control and Management Interface) resource cleanup
>> earlier in the domain_relinquish_resources() sequence to ensure proper
>> cleanup ordering during domain destruction.
>>
>> The SCI cleanup is now performed before TEE (Trusted Execution 
>> Environment)
>> cleanup rather than after P2M mapping cleanup. This reordering 
>> ensures that
>> SCI resources are properly released before other subsystems that might
>> depend on them are torn down.
>>
>> This change addresses potential resource cleanup dependencies where SCI
>> resources need to be released before P2M mappings are cleaned up, 
>> preventing
>> potential issues during domain destruction on ARM platforms with SCI 
>> support.
>>
>> Fixes: e2cc10867b (xen/arm: add generic SCI subsystem, 2025-09-04)
>
> I am not sure where you found this syntax. This is not the one we use 
> for Xen. It should be:
>
> Fixes: <commit-id> ("<patch-subject>")
>
> Where the commit-id is 12 characters. For this patch it should be:
>
> Fixes: e2cc10867b63 ("xen/arm: add generic SCI subsystem")
>
Got this by using command git show -s --pretty=reference <sha>
Will fix.
>>
>> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>
> > --->
>> Changes in v2:
>> - rearrange enum by placing PROG_sci before PROG_tee
>> - add "Fixes:" tag
>>
>>   xen/arch/arm/domain.c | 11 ++++++-----
>>   1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
>> index 1a8585d02b..e36719bce4 100644
>> --- a/xen/arch/arm/domain.c
>> +++ b/xen/arch/arm/domain.c
>> @@ -1042,6 +1042,7 @@ static int relinquish_memory(struct domain *d, 
>> struct page_list_head *list)
>>    */
>>   enum {
>>       PROG_pci = 1,
>> +    PROG_sci,
>
> Can you confirm this is fine to release the SCI resources *after* we 
> releases the devices? Does this mean they are not linked somehow? For 
> instance, if a device is re-assigned to another VM, could it fail 
> because the associated (?) SCI resources were not yet released?
>
> Cheers,
>
This is not an issue for a single-agent. This is because single-agent 
doesn't implement relinquish_resources callback.
For multiagent implementation relinquish_resources is done by sending 
SCMI_BASE_RESET_AGENT_CONFIGURATION message to the firmware which should 
drop all agent configuration previously done.
If we start another VM with assigned device system will ask device 
permission from the firmware. And if device is assigned to another agent 
- error should be returned.

--
Oleksii

 


Rackspace

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