WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] xen passthrough: fix recent regressions

On Fri, 6 Nov 2009, Cui, Dexuan wrote:
> Hi Stefano, can you reproduce the issues I meet with? 
> 

this patch fixes the problem for me, does it work for you too?

---

diff -r 1cc49eb917bc tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Nov 05 18:02:28 2009 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Nov 05 18:05:55 2009 +0000
@@ -921,7 +921,6 @@
             existing_pci_conf = self.info['devices'][existing_dev_uuid][1]
             devid = self._createDevice('pci', existing_pci_conf)
             self.info['devices'][existing_dev_uuid][1]['devid'] = devid
-            return True
 
         if self.domid is not None:
             # use DevController.reconfigureDevice to change device config
diff -r 1cc49eb917bc tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Thu Nov 05 18:02:28 2009 +0000
+++ b/tools/python/xen/xend/server/pciif.py     Thu Nov 05 18:05:55 2009 +0000
@@ -306,7 +306,7 @@
         if dev.driver == 'pciback':
             PCIQuirk(dev)
 
-        if not self.vm.info.is_hvm() and not self.vm.info.is_stubdom() :
+        if not self.vm.info.is_stubdom() :
             # Setup IOMMU device assignment
             bdf = xc.assign_device(fe_domid, pci_dict_to_xc_str(pci_dev))
             pci_str = pci_dict_to_bdf_str(pci_dev)
@@ -443,16 +443,8 @@
         #
         # For hvm guest, (from c/s 19679 on) assigning device statically and
         # dynamically both go through reconfigureDevice(), so HERE the
-        # setupOneDevice() is not necessary.
-        if self.vm.info.is_hvm():
-            for pci_dev in pci_dev_list:
-                # Setup IOMMU device assignment
-                bdf = xc.assign_device(self.getDomid(), 
pci_dict_to_xc_str(pci_dev))
-                pci_str = pci_dict_to_bdf_str(pci_dev)
-                if bdf > 0:
-                    raise VmError("Failed to assign device to IOMMU (%s)" % 
pci_str)
-                log.debug("pci: assign device %s" % pci_str)
-        else :
+        # setupOneDevice() or calling xc.assign_device is not necessary.
+        if not self.vm.info.is_hvm():
             for d in pci_dev_list:
                 self.setupOneDevice(d)
         wPath = '/local/domain/0/backend/pci/%u/0/aerState' % (self.getDomid())
@@ -492,11 +484,12 @@
         dev.do_FLR(self.vm.info.is_hvm(),
             xoptions.get_pci_dev_assign_strict_check())
 
-        bdf = xc.deassign_device(fe_domid, pci_dict_to_xc_str(pci_dev))
-        pci_str = pci_dict_to_bdf_str(pci_dev)
-        if bdf > 0:
-            raise VmError("Failed to deassign device from IOMMU (%s)" % 
pci_str)
-        log.debug("pci: Deassign device %s" % pci_str)
+        if not self.vm.info.is_stubdom() :
+            bdf = xc.deassign_device(fe_domid, pci_dict_to_xc_str(pci_dev))
+            pci_str = pci_dict_to_bdf_str(pci_dev)
+            if bdf > 0:
+                raise VmError("Failed to deassign device from IOMMU (%s)" % 
pci_str)
+            log.debug("pci: Deassign device %s" % pci_str)
 
         for (start, size) in dev.ioports:
             log.debug('pci: disabling ioport 0x%x/0x%x'%(start,size))

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel