<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/vhost, branch v4.8</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.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-08-23T14:16:57Z</updated>
<entry>
<title>vhost/scsi: fix reuse of &amp;vq-&gt;iov[out] in response</title>
<updated>2016-08-23T14:16:57Z</updated>
<author>
<name>Benjamin Coddington</name>
<email>bcodding@redhat.com</email>
</author>
<published>2016-06-06T22:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a77ec83a57890240c546df00ca5df1cdeedb1cc3'/>
<id>urn:sha1:a77ec83a57890240c546df00ca5df1cdeedb1cc3</id>
<content type='text'>
The address of the iovec &amp;vq-&gt;iov[out] is not guaranteed to contain the scsi
command's response iovec throughout the lifetime of the command.  Rather, it
is more likely to contain an iovec from an immediately following command
after looping back around to vhost_get_vq_desc().  Pass along the iovec
entirely instead.

Fixes: 79c14141a487 ("vhost/scsi: Convert completion path to use copy_to_iter")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost/test: fix after swiotlb changes</title>
<updated>2016-08-15T02:05:51Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2016-08-15T01:28:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=446374d7c7f89603d8151b56824e2cac85ed8e0d'/>
<id>urn:sha1:446374d7c7f89603d8151b56824e2cac85ed8e0d</id>
<content type='text'>
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost/vsock: fix vhost virtio_vsock_pkt use-after-free</title>
<updated>2016-08-09T10:42:37Z</updated>
<author>
<name>Stefan Hajnoczi</name>
<email>stefanha@redhat.com</email>
</author>
<published>2016-08-04T13:52:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3fda5d6e580193fa005014355b3a61498f1b3ae0'/>
<id>urn:sha1:3fda5d6e580193fa005014355b3a61498f1b3ae0</id>
<content type='text'>
Stash the packet length in a local variable before handing over
ownership of the packet to virtio_transport_recv_pkt() or
virtio_transport_free_pkt().

This patch solves the use-after-free since pkt is no longer guaranteed
to be alive.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost</title>
<updated>2016-08-06T13:20:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-08-06T13:20:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0803e04011c2e107b9611660301edde94d7010cc'/>
<id>urn:sha1:0803e04011c2e107b9611660301edde94d7010cc</id>
<content type='text'>
Pull virtio/vhost updates from Michael Tsirkin:

 - new vsock device support in host and guest

 - platform IOMMU support in host and guest, including compatibility
   quirks for legacy systems.

 - misc fixes and cleanups.

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  VSOCK: Use kvfree()
  vhost: split out vringh Kconfig
  vhost: detect 32 bit integer wrap around
  vhost: new device IOTLB API
  vhost: drop vringh dependency
  vhost: convert pre sorted vhost memory array to interval tree
  vhost: introduce vhost memory accessors
  VSOCK: Add Makefile and Kconfig
  VSOCK: Introduce vhost_vsock.ko
  VSOCK: Introduce virtio_transport.ko
  VSOCK: Introduce virtio_vsock_common.ko
  VSOCK: defer sock removal to transports
  VSOCK: transport-specific vsock_transport functions
  vhost: drop vringh dependency
  vop: pull in vhost Kconfig
  virtio: new feature to detect IOMMU device quirk
  balloon: check the number of available pages in leak balloon
  vhost: lockless enqueuing
  vhost: simplify work flushing
</content>
</entry>
<entry>
<title>VSOCK: Use kvfree()</title>
<updated>2016-08-02T13:56:08Z</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyj.lk@gmail.com</email>
</author>
<published>2016-08-02T13:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b226acab2f6aaa45c2af27279b63f622b23a44bd'/>
<id>urn:sha1:b226acab2f6aaa45c2af27279b63f622b23a44bd</id>
<content type='text'>
Use kvfree() instead of open-coding it.

Signed-off-by: Wei Yongjun &lt;weiyj.lk@gmail.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: split out vringh Kconfig</title>
<updated>2016-08-02T13:54:28Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2016-08-02T00:03:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d93824561057d54712066544609dfc7453b210f'/>
<id>urn:sha1:4d93824561057d54712066544609dfc7453b210f</id>
<content type='text'>
vringh is pulled in by caif and mic, but the other
vhost config does not need to be there.
In particular, it makes no sense to have vhost net/scsi/sock
under caif/mic.

Create a separate Kconfig file and put vringh bits there.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: detect 32 bit integer wrap around</title>
<updated>2016-08-02T13:54:28Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2016-08-01T20:20:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec33d031a14b3c5dd516627139c9550350dbba3e'/>
<id>urn:sha1:ec33d031a14b3c5dd516627139c9550350dbba3e</id>
<content type='text'>
Detect and fail early if long wrap around is triggered.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: new device IOTLB API</title>
<updated>2016-08-02T13:53:54Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2016-06-23T06:04:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c'/>
<id>urn:sha1:6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c</id>
<content type='text'>
This patch tries to implement an device IOTLB for vhost. This could be
used with userspace(qemu) implementation of DMA remapping
to emulate an IOMMU for the guest.

The idea is simple, cache the translation in a software device IOTLB
(which is implemented as an interval tree) in vhost and use vhost_net
file descriptor for reporting IOTLB miss and IOTLB
update/invalidation. When vhost meets an IOTLB miss, the fault
address, size and access can be read from the file. After userspace
finishes the translation, it writes the translated address to the
vhost_net file to update the device IOTLB.

When device IOTLB is enabled by setting VIRTIO_F_IOMMU_PLATFORM all vq
addresses set by ioctl are treated as iova instead of virtual address and
the accessing can only be done through IOTLB instead of direct userspace
memory access. Before each round or vq processing, all vq metadata is
prefetched in device IOTLB to make sure no translation fault happens
during vq processing.

In most cases, virtqueues are contiguous even in virtual address space.
The IOTLB translation for virtqueue itself may make it a little
slower. We might add fast path cache on top of this patch.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
[mst: use virtio feature bit: VHOST_F_DEVICE_IOTLB -&gt; VIRTIO_F_IOMMU_PLATFORM ]
[mst: fix build warnings ]
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
[ weiyj.lk: missing unlock on error ]
Signed-off-by: Wei Yongjun &lt;weiyj.lk@gmail.com&gt;
</content>
</entry>
<entry>
<title>vhost: convert pre sorted vhost memory array to interval tree</title>
<updated>2016-08-01T23:57:31Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2016-06-23T06:04:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a9709d6874d55130663567577a9b05c35138cc6b'/>
<id>urn:sha1:a9709d6874d55130663567577a9b05c35138cc6b</id>
<content type='text'>
Current pre-sorted memory region array has some limitations for future
device IOTLB conversion:

1) need extra work for adding and removing a single region, and it's
   expected to be slow because of sorting or memory re-allocation.
2) need extra work of removing a large range which may intersect
   several regions with different size.
3) need trick for a replacement policy like LRU

To overcome the above shortcomings, this patch convert it to interval
tree which can easily address the above issue with almost no extra
work.

The patch could be used for:

- Extend the current API and only let the userspace to send diffs of
  memory table.
- Simplify Device IOTLB implementation.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: introduce vhost memory accessors</title>
<updated>2016-08-01T23:57:30Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2016-06-23T06:04:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bfe2bc512884d0b1c5297a15350f940ca80e439b'/>
<id>urn:sha1:bfe2bc512884d0b1c5297a15350f940ca80e439b</id>
<content type='text'>
This patch introduces vhost memory accessors which were just wrappers
for userspace address access helpers. This is a requirement for vhost
device iotlb implementation which will add iotlb translations in those
accessors.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
</feed>
