<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/vhost, branch v5.10</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=v5.10</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.10'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-12-02T09:36:40Z</updated>
<entry>
<title>vhost_vdpa: return -EFAULT if copy_to_user() fails</title>
<updated>2020-12-02T09:36:40Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2020-12-02T06:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c602741b51daa12f8457f222ce9ce9c4825d067'/>
<id>urn:sha1:2c602741b51daa12f8457f222ce9ce9c4825d067</id>
<content type='text'>
The copy_to_user() function returns the number of bytes remaining to be
copied but this should return -EFAULT to the user.

Fixes: 1b48dc03e575 ("vhost: vdpa: report iova range")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/X8c32z5EtDsMyyIL@mwanda
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost-vdpa: fix page pinning leakage in error path (rework)</title>
<updated>2020-11-25T09:29:07Z</updated>
<author>
<name>Si-Wei Liu</name>
<email>si-wei.liu@oracle.com</email>
</author>
<published>2020-11-05T23:26:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ad89653f79f1882d55d9df76c9b2b94f008c4e27'/>
<id>urn:sha1:ad89653f79f1882d55d9df76c9b2b94f008c4e27</id>
<content type='text'>
Pinned pages are not properly accounted particularly when
mapping error occurs on IOTLB update. Clean up dangling
pinned pages for the error path.

The memory usage for bookkeeping pinned pages is reverted
to what it was before: only one single free page is needed.
This helps reduce the host memory demand for VM with a large
amount of memory, or in the situation where host is running
short of free memory.

Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Signed-off-by: Si-Wei Liu &lt;si-wei.liu@oracle.com&gt;
Link: https://lore.kernel.org/r/1604618793-4681-1-git-send-email-si-wei.liu@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
<entry>
<title>vringh: fix vringh_iov_push_*() documentation</title>
<updated>2020-11-25T09:22:48Z</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2020-11-16T16:16:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8009b0f4ab3151f3b8c1675ceb0f9151f09dddaa'/>
<id>urn:sha1:8009b0f4ab3151f3b8c1675ceb0f9151f09dddaa</id>
<content type='text'>
vringh_iov_push_*() functions don't have 'dst' parameter, but have
the 'src' parameter.

Replace 'dst' description with 'src' description.

Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20201116161653.102904-1-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost scsi: fix lun reset completion handling</title>
<updated>2020-11-25T09:22:13Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2020-11-20T15:50:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b4fffc177fad3c99ee049611a508ca9561bb6871'/>
<id>urn:sha1:b4fffc177fad3c99ee049611a508ca9561bb6871</id>
<content type='text'>
vhost scsi owns the scsi se_cmd but lio frees the se_cmd-&gt;se_tmr
before calling release_cmd, so while with normal cmd completion we
can access the se_cmd from the vhost work, we can't do the same with
se_cmd-&gt;se_tmr. This has us copy the tmf response in
vhost_scsi_queue_tm_rsp to our internal vhost-scsi tmf struct for
when it gets sent to the guest from our worker thread.

Fixes: efd838fec17b ("vhost scsi: Add support for LUN resets.")
Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Link: https://lore.kernel.org/r/1605887459-3864-1-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost scsi: Add support for LUN resets.</title>
<updated>2020-11-15T22:30:55Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2020-11-10T05:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=efd838fec17bd8756da852a435800a7e6281bfbc'/>
<id>urn:sha1:efd838fec17bd8756da852a435800a7e6281bfbc</id>
<content type='text'>
In newer versions of virtio-scsi we just reset the timer when an a
command times out, so TMFs are never sent for the cmd time out case.
However, in older kernels and for the TMF inject cases, we can still get
resets and we end up just failing immediately so the guest might see the
device get offlined and IO errors.

For the older kernel cases, we want the same end result as the
modern virtio-scsi driver where we let the lower levels fire their error
handling and handle the problem. And at the upper levels we want to
wait. This patch ties the LUN reset handling into the LIO TMF code which
will just wait for outstanding commands to complete like we are doing in
the modern virtio-scsi case.

Note: I did not handle the ABORT case to keep this simple. For ABORTs
LIO just waits on the cmd like how it does for the RESET case. If
an ABORT fails, the guest OS ends up escalating to LUN RESET, so in
the end we get the same behavior where we wait on the outstanding
cmds.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://lore.kernel.org/r/1604986403-4931-6-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost scsi: add lun parser helper</title>
<updated>2020-11-15T22:30:55Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2020-11-10T05:33:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18f1becb6948cd411fd01968a0a54af63732e73c'/>
<id>urn:sha1:18f1becb6948cd411fd01968a0a54af63732e73c</id>
<content type='text'>
Move code to parse lun from req's lun_buf to helper, so tmf code
can use it in the next patch.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Reviewed-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Link: https://lore.kernel.org/r/1604986403-4931-5-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost scsi: fix cmd completion race</title>
<updated>2020-11-15T22:30:55Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2020-11-10T05:33:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=47a3565e8bb14ec48a75b48daf57aa830e2691f8'/>
<id>urn:sha1:47a3565e8bb14ec48a75b48daf57aa830e2691f8</id>
<content type='text'>
We might not do the final se_cmd put from vhost_scsi_complete_cmd_work.
When the last put happens a little later then we could race where
vhost_scsi_complete_cmd_work does vhost_signal, the guest runs and sends
more IO, and vhost_scsi_handle_vq runs but does not find any free cmds.

This patch has us delay completing the cmd until the last lio core ref
is dropped. We then know that once we signal to the guest that the cmd
is completed that if it queues a new command it will find a free cmd.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Reviewed-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Link: https://lore.kernel.org/r/1604986403-4931-4-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost scsi: alloc cmds per vq instead of session</title>
<updated>2020-11-15T22:30:55Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2020-11-10T05:33:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25b98b64e28423b0769313dcaf96423836b1f93d'/>
<id>urn:sha1:25b98b64e28423b0769313dcaf96423836b1f93d</id>
<content type='text'>
We currently are limited to 256 cmds per session. This leads to problems
where if the user has increased virtqueue_size to more than 2 or
cmd_per_lun to more than 256 vhost_scsi_get_tag can fail and the guest
will get IO errors.

This patch moves the cmd allocation to per vq so we can easily match
whatever the user has specified for num_queues and
virtqueue_size/cmd_per_lun. It also makes it easier to control how much
memory we preallocate. For cases, where perf is not as important and
we can use the current defaults (1 vq and 128 cmds per vq) memory use
from preallocate cmds is cut in half. For cases, where we are willing
to use more memory for higher perf, cmd mem use will now increase as
the num queues and queue depth increases.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://lore.kernel.org/r/1604986403-4931-3-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>vhost: add helper to check if a vq has been setup</title>
<updated>2020-11-15T22:30:54Z</updated>
<author>
<name>Mike Christie</name>
<email>michael.christie@oracle.com</email>
</author>
<published>2020-11-10T05:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6bcf34224ac1e94103797fd68b9836061762f2b2'/>
<id>urn:sha1:6bcf34224ac1e94103797fd68b9836061762f2b2</id>
<content type='text'>
This adds a helper check if a vq has been setup. The next patches
will use this when we move the vhost scsi cmd preallocation from per
session to per vq. In the per vq case, we only want to allocate cmds
for vqs that have actually been setup and not for all the possible
vqs.

Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://lore.kernel.org/r/1604986403-4931-2-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>vdpa: handle irq bypass register failure case</title>
<updated>2020-10-30T08:02:53Z</updated>
<author>
<name>Zhu Lingshan</name>
<email>lingshan.zhu@intel.com</email>
</author>
<published>2020-10-23T10:40:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e01afe36df1a9e42cacdb9c5b99512ec69a6f14b'/>
<id>urn:sha1:e01afe36df1a9e42cacdb9c5b99512ec69a6f14b</id>
<content type='text'>
LKP considered variable 'ret' in vhost_vdpa_setup_vq_irq() as
a unused variable, so suggest we remove it. Actually it stores
return value of irq_bypass_register_producer(), but we did not
check it, we should handle the failure case.

This commit will print a message if irq bypass register producer
fail, in this case, vqs still remain functional.

Signed-off-by: Zhu Lingshan &lt;lingshan.zhu@intel.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Link: https://lore.kernel.org/r/20201023104046.404794-1-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Acked-by: Jason Wang &lt;jasowang@redhat.com&gt;
</content>
</entry>
</feed>
