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

[Xen-changelog] [xen-4.1-testing] passthrough: release assigned PCI devices earlier during domain shutdown



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1331109358 0
# Node ID 8f927378135a31fe363edd65df236a58cf2757ea
# Parent  b9e672d78cecfff31ef7d9478ca229997dddbec0
passthrough: release assigned PCI devices earlier during domain shutdown

At least with xend, where there's not even a tool stack side attempt
to de-assign devices during domain shutdown, this allows immediate re-
starts of a domain to work reliably. (There's no apparent reason why
c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of
domain destruction).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   24888:71159fb049f2
xen-unstable date:        Fri Feb 24 11:46:32 2012 +0100
---


diff -r b9e672d78cec -r 8f927378135a xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/ia64/xen/domain.c        Wed Mar 07 08:35:58 2012 +0000
@@ -671,10 +671,8 @@
                free_xenheap_pages(d->shared_info,
                                   get_order_from_shift(XSI_SHIFT));
 
-       if ( iommu_enabled && need_iommu(d) )   {
-               pci_release_devices(d);
+       if ( iommu_enabled && need_iommu(d) )
                iommu_domain_destroy(d);
-       }
 
        tlb_track_destroy(d);
 
@@ -1719,6 +1717,8 @@
 
        switch (d->arch.relres) {
        case RELRES_not_started:
+               pci_release_devices(d);
+
                /* Relinquish guest resources for VT-i domain. */
                if (is_hvm_domain(d))
                        vmx_relinquish_guest_resources(d);
diff -r b9e672d78cec -r 8f927378135a xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/x86/domain.c     Wed Mar 07 08:35:58 2012 +0000
@@ -605,7 +605,6 @@
         hvm_domain_destroy(d);
 
     vmce_destroy_msr(d);
-    pci_release_devices(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
@@ -1954,6 +1953,8 @@
     switch ( d->arch.relmem )
     {
     case RELMEM_not_started:
+        pci_release_devices(d);
+
         /* Tear down paging-assistance stuff. */
         paging_teardown(d);
 
diff -r b9e672d78cec -r 8f927378135a xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/x86/domctl.c     Wed Mar 07 08:35:58 2012 +0000
@@ -835,6 +835,9 @@
             break;
         }
 
+        if ( d->is_dying )
+            goto assign_device_out;
+
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_bdf);
         if ( ret )
             goto assign_device_out;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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