1. 20 Jul, 2011 12 commits
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Remove the DEBUG option. · 77899970
      Konrad Rzeszutek Wilk authored
      The latter is easily fixed - by the developer compiling the
      module with -DDEBUG. And during runtime - the loglvl provides
      quite a lot of useful data.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      77899970
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Drop two backends, squash and cleanup some code. · a92336a1
      Konrad Rzeszutek Wilk authored
       - Remove the slot and controller controller backend as they
         are not used.
       - Document the find pciback_[read|write]_config_[byte|word|dword]
         to make it easier to find.
       - Collapse the code from conf_space_capability_msi into pciback_ops.c
       - Collapse conf_space_capability_[pm|vpd].c in conf_space_capability.c
         [and remove the conf_space_capability.h file]
       - Rename all visible functions from pciback to xen_pcibk.
       - Rename all the printk/pr_info, etc that use the "pciback" to say
         "xen-pciback".
       - Convert functions that are not referenced outside the code to be
         static to save on name space.
       - Do the same thing for structures that are internal to the driver.
       - Run checkpatch.pl after the renames and fixup its warnings and
         fix any compile errors caused by the variable rename
       - Cleanup any structs that checkpath.pl commented about or just
         look odd.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a92336a1
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Print out the MSI/MSI-X (PIRQ) values · c288b67b
      Konrad Rzeszutek Wilk authored
      If the verbose_request is set (and loglevel high enough), print out
      the MSI/MSI-X values that are sent to the guest. This should aid in
      debugging issues.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c288b67b
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Don't setup an fake IRQ handler for SR-IOV devices. · e17ab35f
      Konrad Rzeszutek Wilk authored
      If we try to setup an fake IRQ handler for legacy interrupts
      for devices that only have MSI-X (most if not all SR-IOV cards),
      we will fail with this:
      
      pciback[0000:01:10.0]: failed to install fake IRQ handler for IRQ 0! (rc:-38)
      
      Since those cards don't have anything in dev->irq.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      e17ab35f
    • Ian Campbell's avatar
      xen: rename pciback module to xen-pciback. · a0b2fa8e
      Ian Campbell authored
      pciback is rather generic for a modular distro style kernel.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      a0b2fa8e
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Fine-grain the spinlocks and fix BUG: scheduling while atomic cases. · 494ef20d
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      494ef20d
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Allocate IRQ handler for device that is shared with guest. · 0513fe9e
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      0513fe9e
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Disable MSI/MSI-X when reseting a device · a2be65fd
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a2be65fd
    • Zhao, Yu's avatar
      xen/pciback: guest SR-IOV support for PV guest · fd5b221b
      Zhao, Yu authored
      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: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      fd5b221b
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Register the owner (domain) of the PCI device. · 6221a9b2
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      6221a9b2
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: Cleanup the driver based on checkpatch warnings and errors. · 8bfd4e02
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      8bfd4e02
    • Konrad Rzeszutek Wilk's avatar
      xen/pciback: xen pci backend driver. · 30edc14b
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      30edc14b
  2. 21 Jun, 2011 7 commits
    • Linus Torvalds's avatar
      Linux 3.0-rc4 · 56299378
      Linus Torvalds authored
      56299378
    • Linus Torvalds's avatar
      vfs: i_state needs to be 'unsigned long' for now · 79568f5b
      Linus Torvalds authored
      Commit 13e12d14 ("vfs: reorganize 'struct inode' layout a bit")
      moved things around a bit changed i_state to be unsigned int instead of
      unsigned long.  That was to help structure layout for the 64-bit case,
      and shrink 'struct inode' a bit (admittedly that only happened when
      spinlock debugging was on and i_flags didn't pack with i_lock).
      
      However, Meelis Roos reports that this results in unaligned exceptions
      on sprc, and it turns out that the bit-locking primitives that we use
      for the I_NEW bit want to use the bitops.  Which want 'unsigned long',
      not 'unsigned int'.
      
      We really should fix the bit locking code to not have that kind of
      requirement, but that's a much bigger change.  So for now, revert that
      field back to 'unsigned long' (but keep the other re-ordering changes
      from the commit that caused this).
      
      Andi points out that we have played games with this in 'struct page', so
      it's solvable with other hacks too, but since right now the struct inode
      size advantage only happens with some rare config options, it's not
      worth fighting.
      
      It _would_ be worth fixing the bitlocking code, though.  Especially
      since there is no type safety in the bitlocking code (this never caused
      any warnings, and worked fine on x86-64, because the bitlocks take a
      'void *' and x86-64 doesn't care that deeply about alignment).  So it's
      currently a very easy problem to trigger by mistake and never notice.
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      79568f5b
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · f5fc5567
      Linus Torvalds authored
      * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
        drm/radeon/kms/r6xx+: voltage fixes
        drm/nouveau: drop leftover debugging
        drm/radeon: avoid warnings from r600/eg irq handlers on powered off card.
        drm/radeon/kms: add missing param for dce3.2 DP transmitter setup
        drm/radeon/kms/atom: fix duallink on some early DCE3.2 cards
        drm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync
        drm/nv50/disp: fix gamma with page flipping overlay turned on
        drm/nouveau/pm: Prevent overflow in nouveau_perf_init()
        drm/nouveau: fix big-endian switch
      f5fc5567
    • Linus Torvalds's avatar
      Merge branch 'msm-fix' of git://codeaurora.org/quic/kernel/davidb/linux-msm · 85d45ade
      Linus Torvalds authored
      * 'msm-fix' of git://codeaurora.org/quic/kernel/davidb/linux-msm:
        msm: timer: Fix DGT rate on 8960 and 8660
        msm: timer: compensate for timer shift in msm_read_timer_count
        msm: timer: Fix SMP build error
      85d45ade
    • Linus Torvalds's avatar
      Merge branch 'for-2.6.40' of git://linux-nfs.org/~bfields/linux · eda08410
      Linus Torvalds authored
      * 'for-2.6.40' of git://linux-nfs.org/~bfields/linux:
        nfsd4: fix break_lease flags on nfsd open
        nfsd: link returns nfserr_delay when breaking lease
        nfsd: v4 support requires CRYPTO
        nfsd: fix dependency of nfsd on auth_rpcgss
      eda08410
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · 6e158d21
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (40 commits)
        pxa168_eth: fix race in transmit path.
        ipv4, ping: Remove duplicate icmp.h include
        netxen: fix race in skb->len access
        sgi-xp: fix a use after free
        hp100: fix an skb->len race
        netpoll: copy dev name of slaves to struct netpoll
        ipv4: fix multicast losses
        r8169: fix static initializers.
        inet_diag: fix inet_diag_bc_audit()
        gigaset: call module_put before restart of if_open()
        farsync: add module_put to error path in fst_open()
        net: rfs: enable RFS before first data packet is received
        fs_enet: fix freescale FCC ethernet dp buffer alignment
        netdev: bfin_mac: fix memory leak when freeing dma descriptors
        vlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support
        caif: Bugfix - XOFF removed channel from caif-mux
        tun: teach the tun/tap driver to support netpoll
        dp83640: drop PHY status frames in the driver.
        dp83640: fix phy status frame event parsing
        phylib: Allow BCM63XX PHY to be selected only on BCM63XX.
        ...
      6e158d21
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 · 36698206
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
        devcgroup_inode_permission: take "is it a device node" checks to inlined wrapper
        fix comment in generic_permission()
        kill obsolete comment for follow_down()
        proc_sys_permission() is OK in RCU mode
        reiserfs_permission() doesn't need to bail out in RCU mode
        proc_fd_permission() is doesn't need to bail out in RCU mode
        nilfs2_permission() doesn't need to bail out in RCU mode
        logfs doesn't need ->permission() at all
        coda_ioctl_permission() is safe in RCU mode
        cifs_permission() doesn't need to bail out in RCU mode
        bad_inode_permission() is safe from RCU mode
        ubifs: dereferencing an ERR_PTR in ubifs_mount()
      36698206
  3. 20 Jun, 2011 21 commits