ia64/xen-unstable

changeset 18297:f62a61cd95f5

ia64: PV driver domains - ugly python hacks

x86 IOMMU support added a lot of assumptions about what PCI buses look
like and where to find bridge devices. On ia64, we don't yet have
virtualization friendly IOMMUs, so for the moment, we just want to
keep "unsafe" PV PCI pass through working as well as it did in Xen
3.2. Looking at the code, it almost seems like x86 has thrown out
support for the old style driver domain. Things that don't
necessarily work on every PCI compliant architecture:

* You can't assume that just because there's a device at 01:01.0
that there's also a bridge at 01:00.0 and blow-up when you
don't find it. On HP ia64 boxes, PCI root bridges are not
necessarily exposed as a PCI device. This pretty much means
we can't call into any of the "FLR" code paths.
* BAR alignment: it's hard to have BAR alignment when your page
size is 16k. This wasn't a requirement for previous PV driver
domains, so I assume it's only for IOMMU support.

This is ugly, so I'm open to suggestions. It seems that all of these
architecture checks could be replaced by checking some "iommu_present"
variable to test whether the extra requirements are necessary.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Aug 08 10:53:40 2008 +0100 (2008-08-08)
parents 3ab0e76fb8e2
children d31546a3883e
files tools/python/xen/xend/server/pciif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/pciif.py	Fri Aug 08 10:48:48 2008 +0100
     1.2 +++ b/tools/python/xen/xend/server/pciif.py	Fri Aug 08 10:53:40 2008 +0100
     1.3 @@ -21,6 +21,7 @@ import types
     1.4  import time
     1.5  
     1.6  from xen.xend import sxp
     1.7 +from xen.xend import arch
     1.8  from xen.xend.XendError import VmError
     1.9  from xen.xend.XendLogging import log
    1.10  
    1.11 @@ -284,12 +285,13 @@ class PciController(DevController):
    1.12                      "bind your slot/device to the PCI backend using sysfs" \
    1.13                      )%(dev.name))
    1.14  
    1.15 -        if dev.has_non_page_aligned_bar:
    1.16 +        if dev.has_non_page_aligned_bar and arch.type != "ia64":
    1.17              raise VmError("pci: %: non-page-aligned MMIO BAR found." % dev.name)
    1.18  
    1.19          self.CheckSiblingDevices(fe_domid, dev)
    1.20  
    1.21 -        dev.do_FLR()
    1.22 +        if arch.type != "ia64":
    1.23 +            dev.do_FLR()
    1.24  
    1.25          PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain, 
    1.26                  bus, slot, func)
    1.27 @@ -395,7 +397,7 @@ class PciController(DevController):
    1.28                                      ' the same guest with %s'
    1.29                                  raise VmError(err_msg % (f, dev.name))
    1.30              elif dev.dev_type == DEV_TYPE_PCI:
    1.31 -                if dev.bus == 0:
    1.32 +                if dev.bus == 0 or arch.type == "ia64":
    1.33                      if not dev.pci_af_flr:
    1.34                          # We cope with this case by using the Dstate transition
    1.35                          # method for now.