--- /dev/null
+diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
+index ff56a19..d8a5542 100644
+--- a/xen/drivers/passthrough/vtd/iommu.c
++++ b/xen/drivers/passthrough/vtd/iommu.c
+@@ -1451,6 +1451,15 @@ void iommu_domain_teardown(struct domain *d)
+ hd->pgd_maddr = 0;
+ spin_unlock(&hd->mapping_lock);
+
++ /* Make sure I/O, memory access and bus master enable bits are set
++ for PCI command register (b:d.f - 00:02.0, offset - 0x4.
++ Passing through display could end up resulting in PCI command register
++ getting reset and thus failing shutdown/reboot on some systems (like
++ Dell E4300, E6500 etc).
++ */
++ if ( pci_conf_read16(0x0, 0x2, 0x0, 0x4) == 0x0 )
++ pci_conf_write16(0x0, 0x2, 0x0, 0x4, 0x7);
++
+ iommu_domid_release(d);
+ }
+