xen/domain: Call pci_release_devices() when releasing domain resources
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Fri, 8 Oct 2021 05:55:30 +0000 (08:55 +0300)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Fri, 8 Oct 2021 22:50:55 +0000 (15:50 -0700)
This is the very same that we already do for DT devices. Moreover, x86
already calls pci_release_devices().

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Rahul Singh <rahul.singh@arm.com>
Tested-by: Rahul Singh <rahul.singh@arm.com>
xen/arch/arm/domain.c

index 36138c1b2ef374a4525ddeefe2511c9bee64e764..aae44724791d45b8f5857879bd9c3a2eaf1850de 100644 (file)
@@ -981,7 +981,8 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
  * function which may return -ERESTART.
  */
 enum {
-    PROG_tee = 1,
+    PROG_pci = 1,
+    PROG_tee,
     PROG_xen,
     PROG_page,
     PROG_mapping,
@@ -1018,6 +1019,12 @@ int domain_relinquish_resources(struct domain *d)
 #ifdef CONFIG_IOREQ_SERVER
         ioreq_server_destroy_all(d);
 #endif
+#ifdef CONFIG_HAS_PCI
+    PROGRESS(pci):
+        ret = pci_release_devices(d);
+        if ( ret )
+            return ret;
+#endif
 
     PROGRESS(tee):
         ret = tee_relinquish_resources(d);