1. 20 7月, 2011 8 次提交
    • I
      xen: rename pciback module to xen-pciback. · a0b2fa8e
      Ian Campbell 提交于
      pciback is rather generic for a modular distro style kernel.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      a0b2fa8e
    • K
      xen/pciback: Fine-grain the spinlocks and fix BUG: scheduling while atomic cases. · 494ef20d
      Konrad Rzeszutek Wilk 提交于
      We were using coarse spinlocks that could end up with a deadlock.
      This patch fixes that and makes the spinlocks much more fine-grained.
      
      We also drop be->watchding state spinlocks as they are already
      guarded by the xenwatch_thread against multiple customers. Without
      that we would trigger the BUG: scheduling while atomic.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      494ef20d
    • K
      xen/pciback: Allocate IRQ handler for device that is shared with guest. · 0513fe9e
      Konrad Rzeszutek Wilk 提交于
      If the device that is to be shared with a guest is a level device and
      the IRQ is shared with the initial domain we need to take actions.
      Mainly we install a dummy IRQ handler that will ACK on the interrupt
      line so as to not have the initial domain disable the interrupt line.
      
      This dummy IRQ handler is not enabled when the device MSI/MSI-X lines
      are set, nor for edge interrupts. And also not for level interrupts
      that are not shared amongst devices. Lastly, if the user passes
      to the guest all of the PCI devices on the shared line the we won't
      install the dummy handler either.
      
      There is also SysFS instrumentation to check its state and turn
      IRQ ACKing on/off if necessary.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      0513fe9e
    • K
      xen/pciback: Disable MSI/MSI-X when reseting a device · a2be65fd
      Konrad Rzeszutek Wilk 提交于
      In cases where the guest is abruptly killed and has not disabled
      MSI/MSI-X interrupts we want to do it for it.
      
      Otherwise when the guest is started up and enables MSI, we would
      get a WARN() that the device already had been enabled.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a2be65fd
    • Z
      xen/pciback: guest SR-IOV support for PV guest · fd5b221b
      Zhao, Yu 提交于
      These changes are for PV guest to use Virtual Function. Because the VF's
      vendor, device registers in cfg space are 0xffff, which are invalid and
      ignored by PCI device scan. Values in 'struct pci_dev' are fixed up by
      SR-IOV code, and using these values will present correct VID and DID to
      PV guest kernel.
      
      And command registers in the cfg space are read only 0, which means we
      have to emulate MMIO enable bit (VF only uses MMIO  resource) so PV
      kernel can work properly.
      Acked-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      fd5b221b
    • K
      xen/pciback: Register the owner (domain) of the PCI device. · 6221a9b2
      Konrad Rzeszutek Wilk 提交于
      When the front-end and back-end start negotiating we register
      the domain that will use the PCI device. Furthermore during shutdown
      of guest or unbinding of the PCI device (and unloading of module)
      from pciback we unregister the domain owner.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      6221a9b2
    • K
      xen/pciback: Cleanup the driver based on checkpatch warnings and errors. · 8bfd4e02
      Konrad Rzeszutek Wilk 提交于
      Checkpatch found some extra warnings and errors. This mega
      patch fixes them all in one big swoop. We also spruce
      up the pcistub_ids to use DEFINE_PCI_DEVICE_TABLE macro
      (suggested by Jan Beulich).
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      8bfd4e02
    • K
      xen/pciback: xen pci backend driver. · 30edc14b
      Konrad Rzeszutek Wilk 提交于
      This is the host side counterpart to the frontend driver in
      drivers/pci/xen-pcifront.c. The PV protocol is also implemented by
      frontend drivers in other OSes too, such as the BSDs.
      
      The PV protocol is rather simple. There is page shared with the guest,
      which has the 'struct xen_pci_sharedinfo' embossed in it. The backend
      has a thread that is kicked every-time the structure is changed and
      based on the operation field it performs specific tasks:
      
       XEN_PCI_OP_conf_[read|write]:
         Read/Write 0xCF8/0xCFC filtered data. (conf_space*.c)
         Based on which field is probed, we either enable/disable the PCI
         device, change power state, read VPD, etc. The major goal of this
         call is to provide a Physical IRQ (PIRQ) to the guest.
      
         The PIRQ is Xen hypervisor global IRQ value irrespective of the IRQ
         is tied in to the IO-APIC, or is a vector. For GSI type
         interrupts, the PIRQ==GSI holds. For MSI/MSI-X the
         PIRQ value != Linux IRQ number (thought PIRQ==vector).
      
         Please note, that with Xen, all interrupts (except those level shared ones)
         are injected directly to the guest - there is no host interaction.
      
       XEN_PCI_OP_[enable|disable]_msi[|x] (pciback_ops.c)
         Enables/disables the MSI/MSI-X capability of the device. These operations
         setup the MSI/MSI-X vectors for the guest and pass them to the frontend.
      
         When the device is activated, the interrupts are directly injected in the
         guest without involving the host.
      
       XEN_PCI_OP_aer_[detected|resume|mmio|slotreset]: In case of failure,
        perform the appropriate AER commands on the guest. Right now that is
        a cop-out - we just kill the guest.
      
      Besides implementing those commands, it can also
      
       - hide a PCI device from the host. When booting up, the user can specify
         xen-pciback.hide=(1:0:0)(BDF..) so that host does not try to use the
         device.
      
      The driver was lifted from linux-2.6.18.hg tree and fixed up
      so that it could compile under v3.0. Per suggestion from Jesse Barnes
      moved the driver to drivers/xen/xen-pciback.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      30edc14b
  2. 21 6月, 2011 13 次提交
  3. 20 6月, 2011 19 次提交