<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/vfio/pci, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-23T01:36:34Z</updated>
<entry>
<title>vfio/pci: Virtualize Maximum Read Request Size</title>
<updated>2018-05-23T01:36:34Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2017-10-02T18:39:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed49ed98a073c2a0535161186b32a49b6f71d735'/>
<id>urn:sha1:ed49ed98a073c2a0535161186b32a49b6f71d735</id>
<content type='text'>
[ Upstream commit cf0d53ba4947aad6e471491d5b20a567cbe92e56 ]

MRRS defines the maximum read request size a device is allowed to
make.  Drivers will often increase this to allow more data transfer
with a single request.  Completions to this request are bound by the
MPS setting for the bus.  Aside from device quirks (none known), it
doesn't seem to make sense to set an MRRS value less than MPS, yet
this is a likely scenario given that user drivers do not have a
system-wide view of the PCI topology.  Virtualize MRRS such that the
user can set MRRS &gt;= MPS, but use MPS as the floor value that we'll
write to hardware.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>vfio/pci: Virtualize Maximum Payload Size</title>
<updated>2018-05-23T01:36:34Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2017-10-02T18:39:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d805c39aede69ae4b2f0382a8ddde01d1727ebdc'/>
<id>urn:sha1:d805c39aede69ae4b2f0382a8ddde01d1727ebdc</id>
<content type='text'>
[ Upstream commit 523184972b282cd9ca17a76f6ca4742394856818 ]

With virtual PCI-Express chipsets, we now see userspace/guest drivers
trying to match the physical MPS setting to a virtual downstream port.
Of course a lone physical device surrounded by virtual interconnects
cannot make a correct decision for a proper MPS setting.  Instead,
let's virtualize the MPS control register so that writes through to
hardware are disallowed.  Userspace drivers like QEMU assume they can
write anything to the device and we'll filter out anything dangerous.
Since mismatched MPS can lead to AER and other faults, let's add it
to the kernel side rather than relying on userspace virtualization to
handle it.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Reviewed-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: Virtualize PCIe &amp; AF FLR</title>
<updated>2018-05-23T01:36:34Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2016-09-26T19:52:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65cf346b28c2999cf59c5d8cdc3506f1e76d168d'/>
<id>urn:sha1:65cf346b28c2999cf59c5d8cdc3506f1e76d168d</id>
<content type='text'>
[ Upstream commit ddf9dc0eb5314d6dac8b19b1cc37c739c6896e7e ]

We use a BAR restore trick to try to detect when a user has performed
a device reset, possibly through FLR or other backdoors, to put things
back into a working state.  This is important for backdoor resets, but
we can actually just virtualize the "front door" resets provided via
PCIe and AF FLR.  Set these bits as virtualized + writable, allowing
the default write to set them in vconfig, then we can simply check the
bit, perform an FLR of our own, and clear the bit.  We don't actually
have the granularity in PCI to specify the type of reset we want to
do, but generally devices don't implement both PCIe and AF FLR and
we'll favor these over other types of reset, so we should generally
lineup.  We do test whether the device provides the requested FLR type
to stay consistent with hardware capabilities though.

This seems to fix several instance of devices getting into bad states
with userspace drivers, like dpdk, running inside a VM.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Reviewed-by: Greg Rose &lt;grose@lightfleet.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: Handle error from pci_iomap</title>
<updated>2017-09-10T20:35:56Z</updated>
<author>
<name>Arvind Yadav</name>
</author>
<published>2017-01-03T11:56:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e341a32e1cb66701416f1a37c46873950be34928'/>
<id>urn:sha1:e341a32e1cb66701416f1a37c46873950be34928</id>
<content type='text'>
[ Upstream commit e19f32da5ded958238eac1bbe001192acef191a2 ]

Here, pci_iomap can fail, handle this case release selected
pci regions and return -ENOMEM.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: use 32-bit comparisons for register address for gcc-4.5</title>
<updated>2017-09-10T20:35:55Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2016-12-30T15:13:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9064e99457063c49d4aab98131189edd2ffd468'/>
<id>urn:sha1:e9064e99457063c49d4aab98131189edd2ffd468</id>
<content type='text'>
[ Upstream commit 45e869714489431625c569d21fc952428d761476 ]

Using ancient compilers (gcc-4.5 or older) on ARM, we get a link
failure with the vfio-pci driver:

ERROR: "__aeabi_lcmp" [drivers/vfio/pci/vfio-pci.ko] undefined!

The reason is that the compiler tries to do a comparison of
a 64-bit range. This changes it to convert to a 32-bit number
explicitly first, as newer compilers do for themselves.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>vfio/pci: Fix integer overflows, bitmask check</title>
<updated>2017-06-13T13:29:17Z</updated>
<author>
<name>Vlad Tsyrklevich</name>
</author>
<published>2016-10-12T16:51:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=073e9973d48b1a7fa6d610fde377f3d7f4171ad6'/>
<id>urn:sha1:073e9973d48b1a7fa6d610fde377f3d7f4171ad6</id>
<content type='text'>
[ Upstream commit 05692d7005a364add85c6e25a6c4447ce08f913a ]

The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize
user-supplied integers, potentially allowing memory corruption. This
patch adds appropriate integer overflow checks, checks the range bounds
for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element
in the VFIO_IRQ_SET_DATA_TYPE_MASK bitmask is set.
VFIO_IRQ_SET_ACTION_TYPE_MASK is already correctly checked later in
vfio_pci_set_irqs_ioctl().

Furthermore, a kzalloc is changed to a kcalloc because the use of a
kzalloc with an integer multiplication allowed an integer overflow
condition to be reached without this patch. kcalloc checks for overflow
and should prevent a similar occurrence.

Signed-off-by: Vlad Tsyrklevich &lt;vlad@tsyrklevich.net&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>vfio: fix ioctl error handling</title>
<updated>2016-03-09T18:15:13Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2016-02-28T14:31:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1590808b43559d8330599158453f28f1b16ffd54'/>
<id>urn:sha1:1590808b43559d8330599158453f28f1b16ffd54</id>
<content type='text'>
[ Upstream commit 8160c4e455820d5008a1116d2dca35f0363bb062 ]

Calling return copy_to_user(...) in an ioctl will not
do the right thing if there's a pagefault:
copy_to_user returns the number of bytes not copied
in this case.

Fix up vfio to do
	return copy_to_user(...)) ?
		-EFAULT : 0;

everywhere.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: Log device requests more verbosely</title>
<updated>2015-05-01T20:00:53Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2015-04-28T16:23:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f55d2ae699d1756ad6132786c7f9c27dc456b66'/>
<id>urn:sha1:5f55d2ae699d1756ad6132786c7f9c27dc456b66</id>
<content type='text'>
Log some clues indicating whether the user is receiving device
request interfaces or not listening.  This can help indicate why a
driver unbind is blocked or explain why QEMU automatically unplugged
a device from the VM.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: Fix use after free</title>
<updated>2015-04-08T14:11:51Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2015-04-08T14:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a0ff17741c1785b27229a16b5ab77470d71b170'/>
<id>urn:sha1:5a0ff17741c1785b27229a16b5ab77470d71b170</id>
<content type='text'>
Reported by 0-day test infrastructure.

Fixes: ecaa1f6a0154 ("vfio-pci: Add VGA arbiter client")
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: Move idle devices to D3hot power state</title>
<updated>2015-04-07T17:14:46Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2015-04-07T17:14:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6eb7018705de09b4138ca05d6a157203e0ea791a'/>
<id>urn:sha1:6eb7018705de09b4138ca05d6a157203e0ea791a</id>
<content type='text'>
We can save some power by putting devices that are bound to vfio-pci
but not in use by the user in the D3hot power state.  Devices get
woken into D0 when opened by the user.  Resets return the device to
D0, so we need to re-apply the low power state after a bus reset.
It's tempting to try to use D3cold, but we have no reason to inhibit
hotplug of idle devices and we might get into a loop of having the
device disappear before we have a chance to try to use it.

A new module parameter allows this feature to be disabled if there are
devices that misbehave as a result of this change.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
</feed>
