<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/vfio, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-02-28T14:38:52Z</updated>
<entry>
<title>vfio: fix ioctl error handling</title>
<updated>2016-02-28T14:38:52Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2016-02-28T14:31:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8160c4e455820d5008a1116d2dca35f0363bb062'/>
<id>urn:sha1:8160c4e455820d5008a1116d2dca35f0363bb062</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>vfio/noiommu: Don't use iommu_present() to track fake groups</title>
<updated>2016-01-27T18:22:25Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2016-01-27T18:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=16ab8a5cbea463e4d14bf0ce698f11fa64b70ae1'/>
<id>urn:sha1:16ab8a5cbea463e4d14bf0ce698f11fa64b70ae1</id>
<content type='text'>
Using iommu_present() to determine whether an IOMMU group is real or
fake has some problems.  First, apparently Power systems don't
register an IOMMU on the device bus, so the groups and containers get
marked as noiommu and then won't bind to their actual IOMMU driver.
Second, I expect we'll run into the same issue as we try to support
vGPUs through vfio, since they're likely to emulate this behavior of
creating an IOMMU group on a virtual device and then providing a vfio
IOMMU backend tailored to the sort of isolation they provide, which
won't necessarily be fully compatible with the IOMMU API.

The solution here is to use the existing iommudata interface to IOMMU
groups, which allows us to easily identify the fake groups we've
created for noiommu purposes.  The iommudata we set is purely
arbitrary since we're only comparing the address, so we use the
address of the noiommu switch itself.

Reported-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Reviewed-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Tested-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Tested-by: Anatoly Burakov &lt;anatoly.burakov@intel.com&gt;
Tested-by: Santosh Shukla &lt;sshukla@mvista.com&gt;
Fixes: 03a76b60f8ba ("vfio: Include No-IOMMU mode")
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/iommu_type1: make use of info.flags</title>
<updated>2016-01-04T19:55:44Z</updated>
<author>
<name>Pierre Morel</name>
<email>pmorel@linux.vnet.ibm.com</email>
</author>
<published>2015-12-23T12:08:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4f50ee2f5b45fc4d9e4142a52edf8b7935a9275'/>
<id>urn:sha1:d4f50ee2f5b45fc4d9e4142a52edf8b7935a9275</id>
<content type='text'>
The flags entry is there to tell the user that some
optional information is available.

Since we report the iova_pgsizes signal it to the user
by setting the flags to VFIO_IOMMU_INFO_PGSIZES.

Signed-off-by: Pierre Morel &lt;pmorel@linux.vnet.ibm.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: Include No-IOMMU mode</title>
<updated>2015-12-21T22:28:11Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2015-12-21T22:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=03a76b60f8ba27974e2d252bc555d2c103420e15'/>
<id>urn:sha1:03a76b60f8ba27974e2d252bc555d2c103420e15</id>
<content type='text'>
There is really no way to safely give a user full access to a DMA
capable device without an IOMMU to protect the host system.  There is
also no way to provide DMA translation, for use cases such as device
assignment to virtual machines.  However, there are still those users
that want userspace drivers even under those conditions.  The UIO
driver exists for this use case, but does not provide the degree of
device access and programming that VFIO has.  In an effort to avoid
code duplication, this introduces a No-IOMMU mode for VFIO.

This mode requires building VFIO with CONFIG_VFIO_NOIOMMU and enabling
the "enable_unsafe_noiommu_mode" option on the vfio driver.  This
should make it very clear that this mode is not safe.  Additionally,
CAP_SYS_RAWIO privileges are necessary to work with groups and
containers using this mode.  Groups making use of this support are
named /dev/vfio/noiommu-$GROUP and can only make use of the special
VFIO_NOIOMMU_IOMMU for the container.  Use of this mode, specifically
binding a device without a native IOMMU group to a VFIO bus driver
will taint the kernel and should therefore not be considered
supported.  This patch includes no-iommu support for the vfio-pci bus
driver only.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>VFIO: platform: reset: fix a warning message condition</title>
<updated>2015-12-21T22:28:11Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2015-12-17T12:27:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=967628827f404b3063016c138ccc7b06c54350f8'/>
<id>urn:sha1:967628827f404b3063016c138ccc7b06c54350f8</id>
<content type='text'>
This loop ends with count set to -1 and not zero so the warning message
isn't printed when it should be.  I've fixed this by change the postop
to a preop.

Fixes: 0990822c9866 ('VFIO: platform: reset: AMD xgbe reset module')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Eric Auger &lt;eric.auger@linaro.org&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert: "vfio: Include No-IOMMU mode"</title>
<updated>2015-12-04T15:38:42Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2015-12-04T15:38:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ae5515d66362b9d96cdcfce504567f0b8b7bd83e'/>
<id>urn:sha1:ae5515d66362b9d96cdcfce504567f0b8b7bd83e</id>
<content type='text'>
Revert commit 033291eccbdb ("vfio: Include No-IOMMU mode") due to lack
of a user.  This was originally intended to fill a need for the DPDK
driver, but uptake has been slow so rather than support an unproven
kernel interface revert it and revisit when userspace catches up.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: fix a warning message</title>
<updated>2015-11-21T13:55:58Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2015-11-21T10:32:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=049af1060bb81532f2700762a8ba71eb3fa81f5a'/>
<id>urn:sha1:049af1060bb81532f2700762a8ba71eb3fa81f5a</id>
<content type='text'>
The first argument to the WARN() macro has to be a condition.  I'm sort
of disappointed that this code doesn't generate a compiler warning.  I
guess -Wformat-extra-args doesn't work in the kernel.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: platform: remove needless stack usage</title>
<updated>2015-11-20T16:00:10Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2015-11-20T00:17:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7200be7c81cc1a1c54a79348a724c16345c5242f'/>
<id>urn:sha1:7200be7c81cc1a1c54a79348a724c16345c5242f</id>
<content type='text'>
request_module already takes format strings, so no need to duplicate
the effort.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-pci: constify pci_error_handlers structures</title>
<updated>2015-11-19T23:53:07Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2015-11-14T10:07:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d10f4e0797597a31f2724b46e619ee10d8eb501'/>
<id>urn:sha1:7d10f4e0797597a31f2724b46e619ee10d8eb501</id>
<content type='text'>
This pci_error_handlers structure is never modified, like all the other
pci_error_handlers structures, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: Drop owner assignment from platform_driver</title>
<updated>2015-11-19T22:52:08Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2015-11-19T04:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7fe941422339c96072fc1eec4e8b484ccf7ccd0e'/>
<id>urn:sha1:7fe941422339c96072fc1eec4e8b484ccf7ccd0e</id>
<content type='text'>
platform_driver does not need to set an owner because
platform_driver_register() will set it.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Acked-by: Baptiste Reynal &lt;b.reynal@virtualopensystems.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
</feed>
