]> xenbits.xen.org Git - xenclient/xen-pq.git/commitdiff
Fix reboot/shutdown issue observed on certain systems.
authorroot <root@localhost.localdomain>
Fri, 31 Jul 2009 05:15:40 +0000 (01:15 -0400)
committerroot <root@localhost.localdomain>
Fri, 31 Jul 2009 05:15:40 +0000 (01:15 -0400)
After spawning a VM with display passed through to it, the system may not shutdown completely or reboot.  This patch fix those issues.

master/igd-cmd-reg-change-for-reboot [new file with mode: 0644]
master/series

diff --git a/master/igd-cmd-reg-change-for-reboot b/master/igd-cmd-reg-change-for-reboot
new file mode 100644 (file)
index 0000000..4576501
--- /dev/null
@@ -0,0 +1,20 @@
+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);
+ }
index cd54ddcf2fb90f38eec8128804731fa4923fcec8..d2dc79ede7f3be9597baa61b22f7b7c850839856 100644 (file)
@@ -16,3 +16,4 @@ tools-hvm-info
 disable-abr
 default-iommu-inclusive-mapping
 cx-initialize-safe-state
+igd-cmd-reg-change-for-reboot