diff options
-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; |