diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-03-07 08:35:58 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-03-07 08:35:58 +0000 |
commit | 3a5ca0063bed3a791ec1bdc8815528c5ab534fe8 (patch) | |
tree | 64ed694ec129d47c91c0435b97bf58a364e7b430 | |
parent | b38a22736815362d93a7d55b2a345936e41aa740 (diff) | |
download | xen-3a5ca0063bed3a791ec1bdc8815528c5ab534fe8.tar.gz xen-3a5ca0063bed3a791ec1bdc8815528c5ab534fe8.tar.bz2 xen-3a5ca0063bed3a791ec1bdc8815528c5ab534fe8.zip |
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@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24888:71159fb049f2
xen-unstable date: Fri Feb 24 11:46:32 2012 +0100
-rw-r--r-- | xen/arch/ia64/xen/domain.c | 6 | ||||
-rw-r--r-- | xen/arch/x86/domain.c | 3 | ||||
-rw-r--r-- | xen/arch/x86/domctl.c | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index 271a744e87..e81e039513 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -671,10 +671,8 @@ void arch_domain_destroy(struct domain *d) 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 @@ int domain_relinquish_resources(struct domain *d) 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 --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 626e305ee9..ae606fcc5f 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -605,7 +605,6 @@ void arch_domain_destroy(struct domain *d) 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 @@ int domain_relinquish_resources(struct domain *d) switch ( d->arch.relmem ) { case RELMEM_not_started: + pci_release_devices(d); + /* Tear down paging-assistance stuff. */ paging_teardown(d); diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 813507d0d6..502a7ab239 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -835,6 +835,9 @@ long arch_do_domctl( 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; |