1. 28 8月, 2017 1 次提交
  2. 30 9月, 2016 3 次提交
    • J
      xen/pciback: support driver_override · b057878b
      Juergen Gross 提交于
      Support the driver_override scheme introduced with commit 782a985d
      ("PCI: Introduce new device binding path using pci_dev.driver_override")
      
      As pcistub_probe() is called for all devices (it has to check for a
      match based on the slot address rather than device type) it has to
      check for driver_override set to "pciback" itself.
      
      Up to now for assigning a pci device to pciback you need something like:
      
      echo 0000:07:10.0 > /sys/bus/pci/devices/0000\:07\:10.0/driver/unbind
      echo 0000:07:10.0 > /sys/bus/pci/drivers/pciback/new_slot
      echo 0000:07:10.0 > /sys/bus/pci/drivers_probe
      
      while with the patch you can use the same mechanism as for similar
      drivers like pci-stub and vfio-pci:
      
      echo pciback > /sys/bus/pci/devices/0000\:07\:10.0/driver_override
      echo 0000:07:10.0 > /sys/bus/pci/devices/0000\:07\:10.0/driver/unbind
      echo 0000:07:10.0 > /sys/bus/pci/drivers_probe
      
      So e.g. libvirt doesn't need special handling for pciback.
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      b057878b
    • J
      xen/pciback: avoid multiple entries in slot list · 9f8bee9c
      Juergen Gross 提交于
      The Xen pciback driver has a list of all pci devices it is ready to
      seize. There is no check whether a to be added entry already exists.
      While this might be no problem in the common case it might confuse
      those which consume the list via sysfs.
      
      Modify the handling of this list by not adding an entry which already
      exists. As this will be needed later split out the list handling into
      a separate function.
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      9f8bee9c
    • J
      xen/pciback: simplify pcistub device handling · 1af916b7
      Juergen Gross 提交于
      The Xen pciback driver maintains a list of all its seized devices.
      There are two functions searching the list for a specific device with
      basically the same semantics just returning different structures in
      case of a match.
      
      Split out the search function.
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      1af916b7
  3. 16 3月, 2015 1 次提交
  4. 04 12月, 2014 6 次提交
  5. 17 9月, 2014 1 次提交
  6. 13 8月, 2014 1 次提交
  7. 24 5月, 2014 5 次提交
  8. 28 6月, 2013 1 次提交
    • J
      xen: Convert printks to pr_<level> · 283c0972
      Joe Perches 提交于
      Convert printks to pr_<level> (excludes printk(KERN_DEBUG...)
      to be more consistent throughout the xen subsystem.
      
      Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME
      Coalesce formats and add missing word spaces
      Add missing newlines
      Align arguments and reflow to 80 columns
      Remove DRV_NAME from formats as pr_fmt adds the same content
      
      This does change some of the prefixes of these messages
      but it also does make them more consistent.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      283c0972
  9. 10 6月, 2013 1 次提交
  10. 29 5月, 2013 1 次提交
  11. 22 3月, 2013 1 次提交
  12. 04 1月, 2013 1 次提交
    • G
      Drivers: xen: remove __dev* attributes. · 345a5255
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, and __devinitdata from these
      drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Jan Beulich <jbeulich@suse.com>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      345a5255
  13. 19 11月, 2012 1 次提交
  14. 02 11月, 2012 2 次提交
    • J
      xen-pciback: reject out of range inputs · b3e40b72
      Jan Beulich 提交于
      This add checks for out of range numbers (including in cases where the
      folding of slot and function into a single value could yield false
      matches).
      
      It also removes the bogus field width restrictions in str_to_quirk() -
      nowhere else in the driver this is being done, and hence this function
      could reject input the equivalent of which would be happily accepted
      in other places (in particular, "0x" prefixes causing the effective
      width of the actual number to be either zero or less than what would be
      required to cover the full range of valid values). Note that for the
      moment this second part is cosmetic only, as the kernel's sscanf()
      currently ignores the field widths, but a patch to overcome this is on
      its way.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b3e40b72
    • J
      xen-pciback: simplify and tighten parsing of device IDs · 5b71fbdc
      Jan Beulich 提交于
      Now that at least one of the conformance problems of the kernel's
      sscanf() was addressed (commit da99075c),
      we can improve the parsing done in xen-pciback both in terms of code
      readability and correctness (in particular properly rejecting input
      strings not well formed).
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      5b71fbdc
  15. 26 9月, 2012 1 次提交
    • K
      xen/pciback: Restore the PCI config space after an FLR. · c341ca45
      Konrad Rzeszutek Wilk 提交于
      When we do an FLR, or D0->D3_hot we may lose the BARs as the
      device has turned itself off (and on). This means the device cannot
      function unless the pci_restore_state is called - which it is
      when the PCI device is unbound from the Xen PCI backend driver.
      For PV guests it ends up calling pci_enable_device / pci_enable_msi[x]
      which does the proper steps
      
      That however is not happening if a HVM guest is run as QEMU
      deals with PCI configuration space. QEMU also requires that the
      device be "parked"  under the ownership of a pci-stub driver to
      guarantee that the PCI device is not being used. Hence we
      follow the same incantation as pci_reset_function does - by
      doing an FLR, then restoring the PCI configuration space.
      
      The result of this patch is that when you run lspci, you get
      now this:
      
      -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
      -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
      +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
      +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
              Region 2: I/O ports at c000 [size=32]
      -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
      +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
      
      The [virtual] means that lspci read those entries from SysFS but when
      it read them from the device it got a different value (0xfffffff).
      
      CC: stable@vger.kernel.org #only for 3.5, 3.6
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c341ca45
  16. 25 9月, 2012 1 次提交
  17. 18 9月, 2012 1 次提交
    • J
      xen-pciback: support wild cards in slot specifications · c3cb4709
      Jan Beulich 提交于
      Particularly for hiding sets of SR-IOV devices, specifying them all
      individually is rather cumbersome. Therefore, allow function and slot
      numbers to be replaced by a wildcard character ('*').
      
      Unfortunately this gets complicated by the in-kernel sscanf()
      implementation not being really standard conformant - matching of
      plain text tails cannot be checked by the caller (a patch to overcome
      this will be sent shortly, and a follow-up patch for simplifying the
      code is planned to be sent when that fixed went upstream).
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c3cb4709
  18. 08 9月, 2012 1 次提交
  19. 06 9月, 2012 1 次提交
    • K
      xen/pciback: Fix proper FLR steps. · 80ba77df
      Konrad Rzeszutek Wilk 提交于
      When we do FLR and save PCI config we did it in the wrong order.
      The end result was that if a PCI device was unbind from
      its driver, then binded to xen-pciback, and then back to its
      driver we would get:
      
      > lspci -s 04:00.0
      04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
      13:42:12 # 4 :~/
      > echo "0000:04:00.0" > /sys/bus/pci/drivers/pciback/unbind
      > modprobe e1000e
      e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
      e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
      e1000e 0000:04:00.0: Disabling ASPM L0s L1
      e1000e 0000:04:00.0: enabling device (0000 -> 0002)
      xen: registering gsi 48 triggering 0 polarity 1
      Already setup the GSI :48
      e1000e 0000:04:00.0: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
      e1000e: probe of 0000:04:00.0 failed with error -2
      
      This fixes it by first saving the PCI configuration space, then
      doing the FLR.
      Reported-by: NRen, Yongjie <yongjie.ren@intel.com>
      Reported-and-Tested-by: NTobias Geiger <tobias.geiger@vido.info>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: stable@vger.kernel.org
      80ba77df
  20. 15 2月, 2012 1 次提交
  21. 04 2月, 2012 1 次提交
  22. 13 1月, 2012 1 次提交
  23. 08 1月, 2012 2 次提交
  24. 20 10月, 2011 2 次提交
  25. 22 9月, 2011 1 次提交
    • J
      xen/pciback: miscellaneous adjustments · 402c5e15
      Jan Beulich 提交于
      This is a minor bugfix and a set of small cleanups; as it is not clear
      whether this needs splitting into pieces (and if so, at what
      granularity), it is a single combined patch.
      - add a missing return statement to an error path in
        kill_domain_by_device()
      - use pci_is_enabled() rather than raw atomic_read()
      - remove a bogus attempt to zero-terminate an already zero-terminated
        string
      - #define DRV_NAME once uniformly in the shared local header
      - make DRIVER_ATTR() variables static
      - eliminate a pointless use of list_for_each_entry_safe()
      - add MODULE_ALIAS()
      - a little bit of constification
      - adjust a few messages
      - remove stray semicolons from inline function definitions
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      [v1: Dropped the resource_size fix, altered the description]
      [v2: Fixed cleanpatch.pl comments]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      402c5e15
  26. 20 7月, 2011 1 次提交
    • K
      xen/pciback: Drop two backends, squash and cleanup some code. · a92336a1
      Konrad Rzeszutek Wilk 提交于
       - 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: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a92336a1