<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/iov.c, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-04-20T13:53:51Z</updated>
<entry>
<title>PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding</title>
<updated>2017-04-20T13:53:51Z</updated>
<author>
<name>Bodong Wang</name>
</author>
<published>2017-04-12T22:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e7df22401a3dfd403b26dea62dd00e0598b538b'/>
<id>urn:sha1:0e7df22401a3dfd403b26dea62dd00e0598b538b</id>
<content type='text'>
Sometimes it is not desirable to bind SR-IOV VFs to drivers.  This can save
host side resource usage by VF instances that will be assigned to VMs.

Add a new PCI sysfs interface "sriov_drivers_autoprobe" to control that
from the PF.  To modify it, echo 0/n/N (disable probe) or 1/y/Y (enable
probe) to:

  /sys/bus/pci/devices/&lt;DOMAIN:BUS:DEVICE.FUNCTION&gt;/sriov_drivers_autoprobe

Note that this must be done before enabling VFs.  The change will not take
effect if VFs are already enabled.  Simply, one can disable VFs by setting
sriov_numvfs to 0, choose whether to probe or not, and then re-enable the
VFs by restoring sriov_numvfs.

[bhelgaas: changelog, ABI doc]
Signed-off-by: Bodong Wang &lt;bodong@mellanox.com&gt;
Signed-off-by: Eli Cohen &lt;eli@mellanox.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Reviewed-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;</content>
</entry>
<entry>
<title>PCI: Lock each enable/disable num_vfs operation in sysfs</title>
<updated>2017-02-03T19:42:38Z</updated>
<author>
<name>Emil Tantilov</name>
</author>
<published>2017-01-06T21:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b0948dfe138f0837699f46f5877f4f81c252dac'/>
<id>urn:sha1:5b0948dfe138f0837699f46f5877f4f81c252dac</id>
<content type='text'>
Enabling/disabling SRIOV via sysfs by echo-ing multiple values
simultaneously:

  # echo 63 &gt; /sys/class/net/ethX/device/sriov_numvfs&amp;
  # echo 63 &gt; /sys/class/net/ethX/device/sriov_numvfs

  # sleep 5

  # echo 0 &gt; /sys/class/net/ethX/device/sriov_numvfs&amp;
  # echo 0 &gt; /sys/class/net/ethX/device/sriov_numvfs

results in the following bug:

  kernel BUG at drivers/pci/iov.c:495!
  invalid opcode: 0000 [#1] SMP
  CPU: 1 PID: 8050 Comm: bash Tainted: G   W   4.9.0-rc7-net-next #2092
  RIP: 0010:[&lt;ffffffff813b1647&gt;]
	    [&lt;ffffffff813b1647&gt;] pci_iov_release+0x57/0x60

  Call Trace:
   [&lt;ffffffff81391726&gt;] pci_release_dev+0x26/0x70
   [&lt;ffffffff8155be6e&gt;] device_release+0x3e/0xb0
   [&lt;ffffffff81365ee7&gt;] kobject_cleanup+0x67/0x180
   [&lt;ffffffff81365d9d&gt;] kobject_put+0x2d/0x60
   [&lt;ffffffff8155bc27&gt;] put_device+0x17/0x20
   [&lt;ffffffff8139c08a&gt;] pci_dev_put+0x1a/0x20
   [&lt;ffffffff8139cb6b&gt;] pci_get_dev_by_id+0x5b/0x90
   [&lt;ffffffff8139cca5&gt;] pci_get_subsys+0x35/0x40
   [&lt;ffffffff8139ccc8&gt;] pci_get_device+0x18/0x20
   [&lt;ffffffff8139ccfb&gt;] pci_get_domain_bus_and_slot+0x2b/0x60
   [&lt;ffffffff813b09e7&gt;] pci_iov_remove_virtfn+0x57/0x180
   [&lt;ffffffff813b0b95&gt;] pci_disable_sriov+0x65/0x140
   [&lt;ffffffffa00a1af7&gt;] ixgbe_disable_sriov+0xc7/0x1d0 [ixgbe]
   [&lt;ffffffffa00a1e9d&gt;] ixgbe_pci_sriov_configure+0x3d/0x170 [ixgbe]
   [&lt;ffffffff8139d28c&gt;] sriov_numvfs_store+0xdc/0x130
  ...
  RIP  [&lt;ffffffff813b1647&gt;] pci_iov_release+0x57/0x60

Use the existing mutex lock to protect each enable/disable operation.

Signed-off-by: Emil Tantilov &lt;emil.s.tantilov@intel.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
CC: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;</content>
</entry>
<entry>
<title>PCI: Remove pci_resource_bar() and pci_iov_resource_bar()</title>
<updated>2016-11-30T00:05:09Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2016-11-28T22:51:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=286c2378aaccc7343ebf17ec6cd86567659caf70'/>
<id>urn:sha1:286c2378aaccc7343ebf17ec6cd86567659caf70</id>
<content type='text'>
pci_std_update_resource() only deals with standard BARs, so we don't have
to worry about the complications of VF BARs in an SR-IOV capability.

Compute the BAR address inline and remove pci_resource_bar().  That makes
pci_iov_resource_bar() unused, so remove that as well.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;</content>
</entry>
<entry>
<title>PCI: Don't update VF BARs while VF memory space is enabled</title>
<updated>2016-11-30T00:05:09Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2016-11-28T22:43:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=546ba9f8f22f71b0202b6ba8967be5cc6dae4e21'/>
<id>urn:sha1:546ba9f8f22f71b0202b6ba8967be5cc6dae4e21</id>
<content type='text'>
If we update a VF BAR while it's enabled, there are two potential problems:

  1) Any driver that's using the VF has a cached BAR value that is stale
     after the update, and

  2) We can't update 64-bit BARs atomically, so the intermediate state
     (new lower dword with old upper dword) may conflict with another
     device, and an access by a driver unrelated to the VF may cause a bus
     error.

Warn about attempts to update VF BARs while they are enabled.  This is a
programming error, so use dev_WARN() to get a backtrace.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;</content>
</entry>
<entry>
<title>PCI: Separate VF BAR updates from standard BAR updates</title>
<updated>2016-11-30T00:05:09Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2016-11-28T15:15:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ffa2489c51da77564a0881a73765ea2169f955d'/>
<id>urn:sha1:6ffa2489c51da77564a0881a73765ea2169f955d</id>
<content type='text'>
Previously pci_update_resource() used the same code path for updating
standard BARs and VF BARs in SR-IOV capabilities.

Split the VF BAR update into a new pci_iov_update_resource() internal
interface, which makes it simpler to compute the BAR address (we can get
rid of pci_resource_bar() and pci_iov_resource_bar()).

This patch:

  - Renames pci_update_resource() to pci_std_update_resource(),
  - Adds pci_iov_update_resource(),
  - Makes pci_update_resource() a wrapper that calls the appropriate one,

No functional change intended.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;</content>
</entry>
<entry>
<title>PCI: Do any VF BAR updates before enabling the BARs</title>
<updated>2016-11-23T23:21:42Z</updated>
<author>
<name>Gavin Shan</name>
</author>
<published>2016-10-26T01:15:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f40ec3c748c6912f6266c56a7f7992de61b255ed'/>
<id>urn:sha1:f40ec3c748c6912f6266c56a7f7992de61b255ed</id>
<content type='text'>
Previously we enabled VFs and enable their memory space before calling
pcibios_sriov_enable().  But pcibios_sriov_enable() may update the VF BARs:
for example, on PPC PowerNV we may change them to manage the association of
VFs to PEs.

Because 64-bit BARs cannot be updated atomically, it's unsafe to update
them while they're enabled.  The half-updated state may conflict with other
devices in the system.

Call pcibios_sriov_enable() before enabling the VFs so any BAR updates
happen while the VF BARs are disabled.

[bhelgaas: changelog]
Tested-by: Carol Soto &lt;clsoto@us.ibm.com&gt;
Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: Check for pci_setup_device() failure in pci_iov_add_virtfn()</title>
<updated>2016-09-12T21:23:38Z</updated>
<author>
<name>Po Liu</name>
</author>
<published>2016-08-29T07:28:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=156c55325d30261d250e88ed3a39f22008f4ca16'/>
<id>urn:sha1:156c55325d30261d250e88ed3a39f22008f4ca16</id>
<content type='text'>
If pci_setup_device() returns failure, we must return failure from
pci_iov_add_virtfn().  If we ignore the failure and continue with an
uninitialized pci_dev for virtfn, we crash later when we try to use those
uninitialized parts.

Signed-off-by: Po Liu &lt;po.liu@nxp.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>Merge tag 'powerpc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux</title>
<updated>2016-03-19T22:38:41Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2016-03-19T22:38:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d5e2d00898bdfed9586472679760fc81a2ca2d02'/>
<id>urn:sha1:d5e2d00898bdfed9586472679760fc81a2ca2d02</id>
<content type='text'>
Pull powerpc updates from Michael Ellerman:
 "This was delayed a day or two by some build-breakage on old toolchains
  which we've now fixed.

  There's two PCI commits both acked by Bjorn.

  There's one commit to mm/hugepage.c which is (co)authored by Kirill.

  Highlights:
   - Restructure Linux PTE on Book3S/64 to Radix format from Paul
     Mackerras
   - Book3s 64 MMU cleanup in preparation for Radix MMU from Aneesh
     Kumar K.V
   - Add POWER9 cputable entry from Michael Neuling
   - FPU/Altivec/VSX save/restore optimisations from Cyril Bur
   - Add support for new ftrace ABI on ppc64le from Torsten Duwe

  Various cleanups &amp; minor fixes from:
   - Adam Buchbinder, Andrew Donnellan, Balbir Singh, Christophe Leroy,
     Cyril Bur, Luis Henriques, Madhavan Srinivasan, Pan Xinhui, Russell
     Currey, Sukadev Bhattiprolu, Suraj Jitindar Singh.

  General:
   - atomics: Allow architectures to define their own __atomic_op_*
     helpers from Boqun Feng
   - Implement atomic{, 64}_*_return_* variants and acquire/release/
     relaxed variants for (cmp)xchg from Boqun Feng
   - Add powernv_defconfig from Jeremy Kerr
   - Fix BUG_ON() reporting in real mode from Balbir Singh
   - Add xmon command to dump OPAL msglog from Andrew Donnellan
   - Add xmon command to dump process/task similar to ps(1) from Douglas
     Miller
   - Clean up memory hotplug failure paths from David Gibson

  pci/eeh:
   - Redesign SR-IOV on PowerNV to give absolute isolation between VFs
     from Wei Yang.
   - EEH Support for SRIOV VFs from Wei Yang and Gavin Shan.
   - PCI/IOV: Rename and export virtfn_{add, remove} from Wei Yang
   - PCI: Add pcibios_bus_add_device() weak function from Wei Yang
   - MAINTAINERS: Update EEH details and maintainership from Russell
     Currey

  cxl:
   - Support added to the CXL driver for running on both bare-metal and
     hypervisor systems, from Christophe Lombard and Frederic Barrat.
   - Ignore probes for virtual afu pci devices from Vaibhav Jain

  perf:
   - Export Power8 generic and cache events to sysfs from Sukadev
     Bhattiprolu
   - hv-24x7: Fix usage with chip events, display change in counter
     values, display domain indices in sysfs, eliminate domain suffix in
     event names, from Sukadev Bhattiprolu

  Freescale:
   - Updates from Scott: "Highlights include 8xx optimizations, 32-bit
     checksum optimizations, 86xx consolidation, e5500/e6500 cpu
     hotplug, more fman and other dt bits, and minor fixes/cleanup"

* tag 'powerpc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (179 commits)
  powerpc: Fix unrecoverable SLB miss during restore_math()
  powerpc/8xx: Fix do_mtspr_cpu6() build on older compilers
  powerpc/rcpm: Fix build break when SMP=n
  powerpc/book3e-64: Use hardcoded mttmr opcode
  powerpc/fsl/dts: Add "jedec,spi-nor" flash compatible
  powerpc/T104xRDB: add tdm riser card node to device tree
  powerpc32: PAGE_EXEC required for inittext
  powerpc/mpc85xx: Add pcsphy nodes to FManV3 device tree
  powerpc/mpc85xx: Add MDIO bus muxing support to the board device tree(s)
  powerpc/86xx: Introduce and use common dtsi
  powerpc/86xx: Update device tree
  powerpc/86xx: Move dts files to fsl directory
  powerpc/86xx: Switch to kconfig fragments approach
  powerpc/86xx: Update defconfigs
  powerpc/86xx: Consolidate common platform code
  powerpc32: Remove one insn in mulhdu
  powerpc32: small optimisation in flush_icache_range()
  powerpc: Simplify test in __dma_sync()
  powerpc32: move xxxxx_dcache_range() functions inline
  powerpc32: Remove clear_pages() and define clear_page() inline
  ...
</content>
</entry>
<entry>
<title>PCI/IOV: Rename and export virtfn_{add, remove}</title>
<updated>2016-03-08T22:58:13Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2016-03-03T23:53:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c194f7ea7f68f2690533832ec22f0d7ed4f2d74d'/>
<id>urn:sha1:c194f7ea7f68f2690533832ec22f0d7ed4f2d74d</id>
<content type='text'>
During EEH recovery, hotplug is applied to the devices which don't
have drivers or their drivers don't support EEH. However, the hotplug,
which was implemented based on PCI bus, can't be applied to VF directly.
Instead, we unplug and plug individual PCI devices (VFs).

This renames virtn_{add,remove}() and exports them so they can be used
in PCI hotplug during EEH recovery.

Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>PCI: Support SR-IOV on any function type</title>
<updated>2016-02-29T17:22:33Z</updated>
<author>
<name>Kelly Zytaruk</name>
</author>
<published>2016-02-09T18:08:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a3d00b33b4ed873cbead8c241bd58b456d92d36'/>
<id>urn:sha1:0a3d00b33b4ed873cbead8c241bd58b456d92d36</id>
<content type='text'>
Previously, we only supported SR-IOV on PCI Express Endpoints and Root
Complex Integrated Endpoints.  This restriction has been present since
d1b054da8f59 ("PCI: initialize and release SR-IOV capability") added SR-IOV
support, but the spec does not require it.  In fact, the SR-IOV spec r1.1,
sec 3.3, says the SR-IOV extended capability may be present for any Type 0
function.

Remove the function type test, so we can support SR-IOV on any function.

Some AMD GPUs have display outputs, use the VGA class code, are Legacy
Endpoints, and support SR-IOV.  This change allows Linux to enable SR-IOV
on these devices.

[bhelgaas: changelog]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=112221
Signed-off-by: Kelly Zytaruk &lt;kelly.zytaruk@amd.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
</feed>
