diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-03-07 09:09:05 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-03-07 09:09:05 +0000 |
commit | 82f17ba204b758a247745dce4e652857420989ad (patch) | |
tree | f5a5d4bcf2cf27f293a344dbf3f5cfd6c1d95682 | |
parent | 77f478007da083231c71dd3141a853dcbb98b039 (diff) | |
download | xen-82f17ba204b758a247745dce4e652857420989ad.tar.gz xen-82f17ba204b758a247745dce4e652857420989ad.tar.bz2 xen-82f17ba204b758a247745dce4e652857420989ad.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 743dab7493..5a05bbd797 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -669,10 +669,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); @@ -1717,6 +1715,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 2fd584d6c1..bb6a5e7e5e 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -565,7 +565,6 @@ void arch_domain_destroy(struct domain *d) if ( is_hvm_domain(d) ) hvm_domain_destroy(d); - pci_release_devices(d); free_domain_pirqs(d); if ( !is_idle_domain(d) ) iommu_domain_destroy(d); @@ -1967,6 +1966,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 60837c8e26..a8865cd948 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -832,6 +832,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; |