<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/vhost, branch v3.9.9</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/vhost?h=v3.9.9</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/vhost?h=v3.9.9'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-06-27T17:39:05Z</updated>
<entry>
<title>vhost_net: clear msg.control for non-zerocopy case during tx</title>
<updated>2013-06-27T17:39:05Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2013-06-05T07:40:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b3a4cc9ed7abcc4fb9db50c63018ee2008643537'/>
<id>urn:sha1:b3a4cc9ed7abcc4fb9db50c63018ee2008643537</id>
<content type='text'>
[ Upstream commit 4364d5f96eed7994a2c625bd9216656e55fba0cb ]

When we decide not use zero-copy, msg.control should be set to NULL otherwise
macvtap/tap may set zerocopy callbacks which may decrease the kref of ubufs
wrongly.

Bug were introduced by commit cedb9bdce099206290a2bdd02ce47a7b253b6a84
(vhost-net: skip head management if no outstanding).

This solves the following warnings:

WARNING: at include/linux/kref.h:47 handle_tx+0x477/0x4b0 [vhost_net]()
Modules linked in: vhost_net macvtap macvlan tun nfsd exportfs bridge stp llc openvswitch kvm_amd kvm bnx2 megaraid_sas [last unloaded: tun]
CPU: 5 PID: 8670 Comm: vhost-8668 Not tainted 3.10.0-rc2+ #1566
Hardware name: Dell Inc. PowerEdge R715/00XHKG, BIOS 1.5.2 04/19/2011
ffffffffa0198323 ffff88007c9ebd08 ffffffff81796b73 ffff88007c9ebd48
ffffffff8103d66b 000000007b773e20 ffff8800779f0000 ffff8800779f43f0
ffff8800779f8418 000000000000015c 0000000000000062 ffff88007c9ebd58
Call Trace:
[&lt;ffffffff81796b73&gt;] dump_stack+0x19/0x1e
[&lt;ffffffff8103d66b&gt;] warn_slowpath_common+0x6b/0xa0
[&lt;ffffffff8103d6b5&gt;] warn_slowpath_null+0x15/0x20
[&lt;ffffffffa0197627&gt;] handle_tx+0x477/0x4b0 [vhost_net]
[&lt;ffffffffa0197690&gt;] handle_tx_kick+0x10/0x20 [vhost_net]
[&lt;ffffffffa019541e&gt;] vhost_worker+0xfe/0x1a0 [vhost_net]
[&lt;ffffffffa0195320&gt;] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
[&lt;ffffffffa0195320&gt;] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
[&lt;ffffffff81061f46&gt;] kthread+0xc6/0xd0
[&lt;ffffffff81061e80&gt;] ? kthread_freezable_should_stop+0x70/0x70
[&lt;ffffffff817a1aec&gt;] ret_from_fork+0x7c/0xb0
[&lt;ffffffff81061e80&gt;] ? kthread_freezable_should_stop+0x70/0x70

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending</title>
<updated>2013-04-12T22:26:42Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-04-12T22:26:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bf81710c4b6e2df2cc047f7c8e1f342511904b74'/>
<id>urn:sha1:bf81710c4b6e2df2cc047f7c8e1f342511904b74</id>
<content type='text'>
Pull SCSI target fixes from Nicholas Bellinger:
 "Here are remaining target-pending items for v3.9-rc7 code.

  The tcm_vhost patches are more than I'd usually include in a -rc7
  pull, but are changes required for v3.9 to work correctly with the
  pending vhost-scsi-pci QEMU upstream series merge.  (Paolo CC'ed)

  Plus Asias's conversion to use vhost_virtqueue-&gt;private_data + RCU for
  managing vhost-scsi endpoints has gotten alot of review + testing over
  the past weeks, and MST has ACKed the full series.

  Also, there is a target patch to fix a long-standing bug within
  control CDB handling with Standby/Offline/Transition ALUA port access
  states, that had been incorrectly rejecting the control CDBs required
  for LUN scan to work during these port group states.  CC'ing to
  stable."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs
  tcm_vhost: Send bad target to guest when cmd fails
  tcm_vhost: Add vhost_scsi_send_bad_target() helper
  tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq
  tcm_vhost: Remove double check of response
  tcm_vhost: Initialize vq-&gt;last_used_idx when set endpoint
  tcm_vhost: Use vq-&gt;private_data to indicate if the endpoint is setup
  tcm_vhost: Use ACCESS_ONCE for vs-&gt;vs_tpg[target] access
</content>
</entry>
<entry>
<title>tcm_vhost: Send bad target to guest when cmd fails</title>
<updated>2013-04-11T08:48:42Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-10T07:06:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=055f648c49d948de9452b0f1758869bbbd0097b8'/>
<id>urn:sha1:055f648c49d948de9452b0f1758869bbbd0097b8</id>
<content type='text'>
Send bad target to guest in case:
1) we can not allocate the cmd
2) fail to submit the cmd

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_vhost: Add vhost_scsi_send_bad_target() helper</title>
<updated>2013-04-11T08:48:35Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-10T07:06:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=637ab21e284f4e9188acc2746695f7f6452b4a22'/>
<id>urn:sha1:637ab21e284f4e9188acc2746695f7f6452b4a22</id>
<content type='text'>
Share the send bad target code with other use cases.

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq</title>
<updated>2013-04-11T08:48:27Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-10T07:06:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7ea206cf3b06704cf2bfc9c9c395094b24dc44a2'/>
<id>urn:sha1:7ea206cf3b06704cf2bfc9c9c395094b24dc44a2</id>
<content type='text'>
If we fail to submit the allocated tv_vmd to tcm_vhost_submission_work,
we will leak the tv_vmd. Free tv_vmd on fail path.

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_vhost: Remove double check of response</title>
<updated>2013-04-11T08:48:11Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-10T07:06:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f6da51c3ef07c593a410551af4cad093e2fbe755'/>
<id>urn:sha1:f6da51c3ef07c593a410551af4cad093e2fbe755</id>
<content type='text'>
We did the length of response check twice.

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_vhost: Initialize vq-&gt;last_used_idx when set endpoint</title>
<updated>2013-04-08T21:09:54Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-03T06:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dfd5d5692c7ddf27380511b80a3dc590acfc4eee'/>
<id>urn:sha1:dfd5d5692c7ddf27380511b80a3dc590acfc4eee</id>
<content type='text'>
This patch fixes guest hang when booting seabios and guest.

  [    0.576238] scsi0 : Virtio SCSI HBA
  [    0.616754] virtio_scsi virtio1: request:id 0 is not a head!

vq-&gt;last_used_idx is initialized only when /dev/vhost-scsi is
opened or closed.

   vhost_scsi_open -&gt; vhost_dev_init() -&gt; vhost_vq_reset()
   vhost_scsi_release() -&gt; vhost_dev_cleanup -&gt; vhost_vq_reset()

So, when guest talks to tcm_vhost after seabios does, vq-&gt;last_used_idx
still contains the old valule for seabios. This confuses guest.

Fix this by calling vhost_init_used() to init vq-&gt;last_used_idx when
we set endpoint.

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_vhost: Use vq-&gt;private_data to indicate if the endpoint is setup</title>
<updated>2013-04-08T21:07:00Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-03T06:17:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4f7f46d32c9875004fae1d57ae3c02cc2e6cd6a3'/>
<id>urn:sha1:4f7f46d32c9875004fae1d57ae3c02cc2e6cd6a3</id>
<content type='text'>
Currently, vs-&gt;vs_endpoint is used indicate if the endpoint is setup or
not. It is set or cleared in vhost_scsi_set_endpoint() or
vhost_scsi_clear_endpoint() under the vs-&gt;dev.mutex lock. However, when
we check it in vhost_scsi_handle_vq(), we ignored the lock.

Instead of using the vs-&gt;vs_endpoint and the vs-&gt;dev.mutex lock to
indicate the status of the endpoint, we use per virtqueue
vq-&gt;private_data to indicate it. In this way, we can only take the
vq-&gt;mutex lock which is per queue and make the concurrent multiqueue
process having less lock contention. Further, in the read side of
vq-&gt;private_data, we can even do not take the lock if it is accessed in
the vhost worker thread, because it is protected by "vhost rcu".

(nab: Do s/VHOST_FEATURES/~VHOST_SCSI_FEATURES)

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_vhost: Use ACCESS_ONCE for vs-&gt;vs_tpg[target] access</title>
<updated>2013-04-02T23:43:34Z</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-04-02T15:31:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=af0d9187f66db2711f94dc20d5a06ec9ba5845b3'/>
<id>urn:sha1:af0d9187f66db2711f94dc20d5a06ec9ba5845b3</id>
<content type='text'>
In vhost_scsi_handle_vq:

      tv_tpg = vs-&gt;vs_tpg[target];
      if (!tv_tpg) {
              ....
              return
      }

      tv_cmd = vhost_scsi_allocate_cmd(tv_tpg, &amp;v_req,

1) vs-&gt;vs_tpg[target] might change after the NULL check and 2) the above
line might access tv_tpg from vs-&gt;vs_tpg[target]. To prevent 2), use
ACCESS_ONCE. Thanks mst for catching this up!

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending</title>
<updated>2013-03-30T20:13:05Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-03-30T20:13:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=13d2080db3472b3399ba32e6026960de5d32a344'/>
<id>urn:sha1:13d2080db3472b3399ba32e6026960de5d32a344</id>
<content type='text'>
Pull SCSI target fixes from Nicholas Bellinger:
 "This includes the bug-fix for a &gt;= v3.8-rc1 regression specific to
  iscsi-target persistent reservation conflict handling (CC'ed to
  stable), and a tcm_vhost patch to drop VIRTIO_RING_F_EVENT_IDX usage
  so that in-flight qemu vhost-scsi-pci device code can detect the
  proper vhost feature bits.

  Also, there are two more tcm_vhost patches still being discussed by
  MST and Asias for v3.9 that will be required for the in-flight qemu
  vhost-scsi-pci device patch to function properly, and that should
  (hopefully) be the last target fixes for this round."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: Fix RESERVATION_CONFLICT status regression for iscsi-target special case
  tcm_vhost: Avoid VIRTIO_RING_F_EVENT_IDX feature bit
</content>
</entry>
</feed>
