<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/drivers/vfio/vfio.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/drivers/vfio/vfio.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/drivers/vfio/vfio.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-03-24T15:32:41Z</updated>
<entry>
<title>Merge branches 'v5.7/vfio/alex-sriov-v3' and 'v5.7/vfio/yan-dma-rw-v4' into v5.7/vfio/next</title>
<updated>2020-03-24T15:32:41Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2020-03-24T15:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=48219795e7dbd3d4850f5bf47fa3e37c9c2a561b'/>
<id>urn:sha1:48219795e7dbd3d4850f5bf47fa3e37c9c2a561b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vfio: Include optional device match in vfio_device_ops callbacks</title>
<updated>2020-03-24T15:28:25Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2020-03-24T15:28:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=5f3874c2a2310d9bd6969ca6764961d27a843b9d'/>
<id>urn:sha1:5f3874c2a2310d9bd6969ca6764961d27a843b9d</id>
<content type='text'>
Allow bus drivers to provide their own callback to match a device to
the user provided string.

Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Reviewed-by: Kevin Tian &lt;kevin.tian@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: avoid inefficient operations on VFIO group in vfio_pin/unpin_pages</title>
<updated>2020-03-24T15:27:57Z</updated>
<author>
<name>Yan Zhao</name>
<email>yan.y.zhao@intel.com</email>
</author>
<published>2020-03-24T15:27:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=40280cf7e8ca7d31bb0a9d626f36f458fec32815'/>
<id>urn:sha1:40280cf7e8ca7d31bb0a9d626f36f458fec32815</id>
<content type='text'>
vfio_group_pin_pages() and vfio_group_unpin_pages() are introduced to
avoid inefficient search/check/ref/deref opertions associated with VFIO
group as those in each calling into vfio_pin_pages() and
vfio_unpin_pages().

VFIO group is taken as arg directly. The callers combine
search/check/ref/deref operations associated with VFIO group by calling
vfio_group_get_external_user()/vfio_group_get_external_user_from_dev()
beforehand, and vfio_group_put_external_user() afterwards.

Suggested-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Yan Zhao &lt;yan.y.zhao@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: introduce vfio_dma_rw to read/write a range of IOVAs</title>
<updated>2020-03-24T15:27:57Z</updated>
<author>
<name>Yan Zhao</name>
<email>yan.y.zhao@intel.com</email>
</author>
<published>2020-03-24T15:27:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8d46c0cca5f4dc0538173d62cd36b1119b5105bc'/>
<id>urn:sha1:8d46c0cca5f4dc0538173d62cd36b1119b5105bc</id>
<content type='text'>
vfio_dma_rw will read/write a range of user space memory pointed to by
IOVA into/from a kernel buffer without enforcing pinning the user space
memory.

TODO: mark the IOVAs to user space memory dirty if they are written in
vfio_dma_rw().

Cc: Kevin Tian &lt;kevin.tian@intel.com&gt;
Signed-off-by: Yan Zhao &lt;yan.y.zhao@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: allow external user to get vfio group from device</title>
<updated>2020-03-24T15:27:56Z</updated>
<author>
<name>Yan Zhao</name>
<email>yan.y.zhao@intel.com</email>
</author>
<published>2020-03-24T15:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c0560f51cf77472f4ed113539b0a02ca6cda7961'/>
<id>urn:sha1:c0560f51cf77472f4ed113539b0a02ca6cda7961</id>
<content type='text'>
external user calls vfio_group_get_external_user_from_dev() with a device
pointer to get the VFIO group associated with this device.
The VFIO group is checked to be vialbe and have IOMMU set. Then
container user counter is increased and VFIO group reference is hold
to prevent the VFIO group from disposal before external user exits.

when the external user finishes using of the VFIO group, it calls
vfio_group_put_external_user() to dereference the VFIO group and the
container user counter.

Suggested-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Yan Zhao &lt;yan.y.zhao@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>compat_ioctl: move drivers to compat_ptr_ioctl</title>
<updated>2019-10-23T15:23:43Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-09-11T15:23:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=407e9ef72476e64937ebec44cc835e03a25fb408'/>
<id>urn:sha1:407e9ef72476e64937ebec44cc835e03a25fb408</id>
<content type='text'>
Each of these drivers has a copy of the same trivial helper function to
convert the pointer argument and then call the native ioctl handler.

We now have a generic implementation of that, so use it.

Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Reviewed-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500</title>
<updated>2019-06-19T15:09:55Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-04T08:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d2912cb15bdda8ba4a5dd73396ad62641af2f520'/>
<id>urn:sha1:d2912cb15bdda8ba4a5dd73396ad62641af2f520</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vfio: Fix WARNING "do not call blocking ops when !TASK_RUNNING"</title>
<updated>2019-04-23T17:30:46Z</updated>
<author>
<name>Farhan Ali</name>
<email>alifm@linux.ibm.com</email>
</author>
<published>2019-04-03T18:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=41be3e2618174fdf3361e49e64f2bf530f40c6b0'/>
<id>urn:sha1:41be3e2618174fdf3361e49e64f2bf530f40c6b0</id>
<content type='text'>
vfio_dev_present() which is the condition to
wait_event_interruptible_timeout(), will call vfio_group_get_device
and try to acquire the mutex group-&gt;device_lock.

wait_event_interruptible_timeout() will set the state of the current
task to TASK_INTERRUPTIBLE, before doing the condition check. This
means that we will try to acquire the mutex while already in a
sleeping state. The scheduler warns us by giving the following
warning:

[ 4050.264464] ------------[ cut here ]------------
[ 4050.264508] do not call blocking ops when !TASK_RUNNING; state=1 set at [&lt;00000000b33c00e2&gt;] prepare_to_wait_event+0x14a/0x188
[ 4050.264529] WARNING: CPU: 12 PID: 35924 at kernel/sched/core.c:6112 __might_sleep+0x76/0x90
....

 4050.264756] Call Trace:
[ 4050.264765] ([&lt;000000000017bbaa&gt;] __might_sleep+0x72/0x90)
[ 4050.264774]  [&lt;0000000000b97edc&gt;] __mutex_lock+0x44/0x8c0
[ 4050.264782]  [&lt;0000000000b9878a&gt;] mutex_lock_nested+0x32/0x40
[ 4050.264793]  [&lt;000003ff800d7abe&gt;] vfio_group_get_device+0x36/0xa8 [vfio]
[ 4050.264803]  [&lt;000003ff800d87c0&gt;] vfio_del_group_dev+0x238/0x378 [vfio]
[ 4050.264813]  [&lt;000003ff8015f67c&gt;] mdev_remove+0x3c/0x68 [mdev]
[ 4050.264825]  [&lt;00000000008e01b0&gt;] device_release_driver_internal+0x168/0x268
[ 4050.264834]  [&lt;00000000008de692&gt;] bus_remove_device+0x162/0x190
[ 4050.264843]  [&lt;00000000008daf42&gt;] device_del+0x1e2/0x368
[ 4050.264851]  [&lt;00000000008db12c&gt;] device_unregister+0x64/0x88
[ 4050.264862]  [&lt;000003ff8015ed84&gt;] mdev_device_remove+0xec/0x130 [mdev]
[ 4050.264872]  [&lt;000003ff8015f074&gt;] remove_store+0x6c/0xa8 [mdev]
[ 4050.264881]  [&lt;000000000046f494&gt;] kernfs_fop_write+0x14c/0x1f8
[ 4050.264890]  [&lt;00000000003c1530&gt;] __vfs_write+0x38/0x1a8
[ 4050.264899]  [&lt;00000000003c187c&gt;] vfs_write+0xb4/0x198
[ 4050.264908]  [&lt;00000000003c1af2&gt;] ksys_write+0x5a/0xb0
[ 4050.264916]  [&lt;0000000000b9e270&gt;] system_call+0xdc/0x2d8
[ 4050.264925] 4 locks held by sh/35924:
[ 4050.264933]  #0: 000000001ef90325 (sb_writers#4){.+.+}, at: vfs_write+0x9e/0x198
[ 4050.264948]  #1: 000000005c1ab0b3 (&amp;of-&gt;mutex){+.+.}, at: kernfs_fop_write+0x1cc/0x1f8
[ 4050.264963]  #2: 0000000034831ab8 (kn-&gt;count#297){++++}, at: kernfs_remove_self+0x12e/0x150
[ 4050.264979]  #3: 00000000e152484f (&amp;dev-&gt;mutex){....}, at: device_release_driver_internal+0x5c/0x268
[ 4050.264993] Last Breaking-Event-Address:
[ 4050.265002]  [&lt;000000000017bbaa&gt;] __might_sleep+0x72/0x90
[ 4050.265010] irq event stamp: 7039
[ 4050.265020] hardirqs last  enabled at (7047): [&lt;00000000001cee7a&gt;] console_unlock+0x6d2/0x740
[ 4050.265029] hardirqs last disabled at (7054): [&lt;00000000001ce87e&gt;] console_unlock+0xd6/0x740
[ 4050.265040] softirqs last  enabled at (6416): [&lt;0000000000b8fe26&gt;] __udelay+0xb6/0x100
[ 4050.265049] softirqs last disabled at (6415): [&lt;0000000000b8fe06&gt;] __udelay+0x96/0x100
[ 4050.265057] ---[ end trace d04a07d39d99a9f9 ]---

Let's fix this as described in the article
https://lwn.net/Articles/628628/.

Signed-off-by: Farhan Ali &lt;alifm@linux.ibm.com&gt;
[remove now redundant vfio_dev_present()]
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: Use dev_printk() when possible</title>
<updated>2019-04-22T17:45:42Z</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2019-03-30T14:41:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=a88a7b3eb076ade6205176915fd2ee73a60f4a32'/>
<id>urn:sha1:a88a7b3eb076ade6205176915fd2ee73a60f4a32</id>
<content type='text'>
Use dev_printk() when possible to make messages consistent with other
device-related messages.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Reviewed-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio: expand minor range when registering chrdev region</title>
<updated>2019-02-12T20:20:56Z</updated>
<author>
<name>Chengguang Xu</name>
<email>cgxu519@gmx.com</email>
</author>
<published>2019-02-12T05:59:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8bcb64a51065e957e170ada58cbbd766be6a9619'/>
<id>urn:sha1:8bcb64a51065e957e170ada58cbbd766be6a9619</id>
<content type='text'>
Actually, total amount of available minor number
for a single major is MINORMARK + 1. So expand
minor range when registering chrdev region.

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