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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Sun, 14 Sep 2025 13:26:42 +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=gNAc1qEb/6M5T2GGRl2Ps8WmmqUXUMtwvy5Hlsi5R+o=; b=DlNbxRLOIz/pXe4zA/4lkwdsHiZVOYB2dwU8N4Lqx7d5qVUANdtjKcvncM8Y3qhg2WBPYj6cdSALrMd3aG6Zb89SiX2ulhwwsQ1UnCHwhDoogstji9JN88lmO8PixUR+nNkspZQYfqTw/2kn0RD77nuHqjquzU0e329+vLW7fvn1gaUdXlAwuMyhvqucnwDLiLAyqOEM2ql+bAUXvOG+JcuBxfaPQxgDYGIy9S5PxFUBITXU6sQrW0gBWdZtHLUZvapAGaC3W+GjxKPApyKM3s4fSeM9VNhyLJ/asPXzwsjcnaUjy/uWfhEfQ+4rm9Mnl4LvXo6YUHJDPpXjVXWRxQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VJAEzOYk0soF8EMXqX5Epttjh1j9lFe4uCwvaBmp8UQWhr8wSo6865j4pzRn10xVzBAgLb8dgRbuwCmxJrf2K5wZC3ezz+py5ubW38azk2OduddEctnzoee2QesQcDwngF4sWr5mcoPcZ4p4agJHkpNuCHpo2SdfWwPlwkT2DHPgaiGRPMtLQkkD2vQUz/3TgiItfR+gMyQl/U8H0CrWBcQ2AN3ZsmpFv+DfDS2DC4ta89ZDV6MV0FJ+eIgngSJak1DZaXhcI5bRY9E7SFXHTFNOSObapw3rMICVrrrOcLf9BBX7rQb+yGanIwj7qIrw7Xks8XHTIztaZ2d5FIZVOQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Delivery-date: Sun, 14 Sep 2025 13:27:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcJXs1K3LqZ5+aqE65C1kspBdxMw==
  • Thread-topic: [PATCH v2] xen/arm: Reorder SCI resource cleanup in domain destruction

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)

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,
     PROG_tee,
     PROG_xen,
     PROG_page,
@@ -1049,7 +1050,6 @@ enum {
     PROG_p2m_root,
     PROG_p2m,
     PROG_p2m_pool,
-    PROG_sci,
     PROG_done,
 };
 
@@ -1090,6 +1090,11 @@ int domain_relinquish_resources(struct domain *d)
             return ret;
 #endif
 
+    PROGRESS(sci):
+        ret = sci_relinquish_resources(d);
+        if ( ret )
+            return ret;
+
     PROGRESS(tee):
         ret = tee_relinquish_resources(d);
         if (ret )
@@ -1109,10 +1114,6 @@ int domain_relinquish_resources(struct domain *d)
         ret = relinquish_p2m_mapping(d);
         if ( ret )
             return ret;
-    PROGRESS(sci):
-        ret = sci_relinquish_resources(d);
-        if ( ret )
-            return ret;
 
     PROGRESS(p2m_root):
         /*
-- 
2.34.1



 


Rackspace

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