1. 02 8月, 2016 6 次提交
  2. 10 5月, 2016 2 次提交
  3. 11 3月, 2016 4 次提交
  4. 02 3月, 2016 3 次提交
    • G
      vhost: rename vhost_init_used() · 80f7d030
      Greg Kurz 提交于
      Looking at how callers use this, maybe we should just rename init_used
      to vhost_vq_init_access. The _used suffix was a hint that we
      access the vq used ring. But maybe what callers care about is
      that it must be called after access_ok.
      
      Also, this function manipulates the vq->is_le field which isn't related
      to the vq used ring.
      
      This patch simply renames vhost_init_used() to vhost_vq_init_access() as
      suggested by Michael.
      
      No behaviour change.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      80f7d030
    • G
      vhost: rename cross-endian helpers · c5072037
      Greg Kurz 提交于
      The default use case for vhost is when the host and the vring have the
      same endianness (default native endianness). But there are cases where
      they differ and vhost should byteswap when accessing the vring.
      
      The first case is when the host is big endian and the vring belongs to
      a virtio 1.0 device, which is always little endian.
      
      This is covered by the vq->is_le field. This field is initialized when
      userspace calls the VHOST_SET_FEATURES ioctl. It is reset when the device
      stops.
      
      We already have a vhost_init_is_le() helper, but the reset operation is
      opencoded as follows:
      
      	vq->is_le = virtio_legacy_is_little_endian();
      
      It isn't clear that we are resetting vq->is_le here.
      
      This patch moves the code to a helper with a more explicit name.
      
      The other case where we may have to byteswap is when the architecture can
      switch endianness at runtime (bi-endian). If endianness differs in the host
      and in the guest, then legacy devices need to be used in cross-endian mode.
      
      This mode is available with CONFIG_VHOST_CROSS_ENDIAN_LEGACY=y, which
      introduces a vq->user_be field. Userspace may enable cross-endian mode
      by calling the SET_VRING_ENDIAN ioctl before the device is started. The
      cross-endian mode is disabled when the device is stopped.
      
      The current names of the helpers that manipulate vq->user_be are unclear.
      
      This patch renames those helpers to clearly show that this is cross-endian
      stuff and with explicit enable/disable semantics.
      
      No behaviour change.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c5072037
    • G
      vhost: fix error path in vhost_init_used() · e1f33be9
      Greg Kurz 提交于
      We don't want side effects. If something fails, we rollback vq->is_le to
      its previous value.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      e1f33be9
  5. 09 12月, 2015 1 次提交
  6. 07 12月, 2015 3 次提交
  7. 04 12月, 2015 2 次提交
  8. 28 10月, 2015 1 次提交
  9. 14 10月, 2015 1 次提交
  10. 16 9月, 2015 1 次提交
  11. 06 8月, 2015 1 次提交
  12. 27 7月, 2015 2 次提交
  13. 14 7月, 2015 2 次提交
    • I
      vhost: add max_mem_regions module parameter · c9ce42f7
      Igor Mammedov 提交于
      it became possible to use a bigger amount of memory
      slots, which is used by memory hotplug for
      registering hotplugged memory.
      However QEMU crashes if it's used with more than ~60
      pc-dimm devices and vhost-net enabled since host kernel
      in module vhost-net refuses to accept more than 64
      memory regions.
      
      Allow to tweak limit via max_mem_regions module paramemter
      with default value set to 64 slots.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c9ce42f7
    • I
      vhost: extend memory regions allocation to vmalloc · 4de7255f
      Igor Mammedov 提交于
      with large number of memory regions we could end up with
      high order allocations and kmalloc could fail if
      host is under memory pressure.
      Considering that memory regions array is used on hot path
      try harder to allocate using kmalloc and if it fails resort
      to vmalloc.
      It's still better than just failing vhost_set_memory() and
      causing guest crash due to it when a new memory hotplugged
      to guest.
      
      I'll still look at QEMU side solution to reduce amount of
      memory regions it feeds to vhost to make things even better,
      but it doesn't hurt for kernel to behave smarter and don't
      crash older QEMU's which could use large amount of memory
      regions.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      4de7255f
  14. 01 7月, 2015 1 次提交
  15. 16 6月, 2015 1 次提交
    • N
      target: Drop unnecessary core_tpg_register TFO parameter · bc0c94b1
      Nicholas Bellinger 提交于
      This patch drops unnecessary target_core_fabric_ops parameter usage
      for core_tpg_register() during fabric driver TFO->fabric_make_tpg()
      se_portal_group creation callback execution.
      
      Instead, use the existing se_wwn->wwn_tf->tf_ops pointer to ensure
      fabric driver is really using the same TFO provided at module_init
      time.
      
      Also go ahead and drop the forward TFO declarations tree-wide, and
      handling the special case for iscsi-target discovery TPG.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bc0c94b1
  16. 02 6月, 2015 1 次提交
    • B
      target: Minimize SCSI header #include directives · ba929992
      Bart Van Assche 提交于
      Only include SCSI initiator header files in target code that needs
      these header files, namely the SCSI pass-through code and the tcm_loop
      driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
      target code because the former is intended for initiator code and the
      latter for target code. With this patch the only initiator include
      directives in target code that remain are as follows:
      
      $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
      drivers/target/loopback/tcm_loop.c:29:#include <scsi/scsi.h>
      drivers/target/loopback/tcm_loop.c:31:#include <scsi/scsi_host.h>
      drivers/target/loopback/tcm_loop.c:32:#include <scsi/scsi_device.h>
      drivers/target/loopback/tcm_loop.c:33:#include <scsi/scsi_cmnd.h>
      drivers/target/target_core_pscsi.c:39:#include <scsi/scsi_device.h>
      drivers/target/target_core_pscsi.c:40:#include <scsi/scsi_host.h>
      drivers/xen/xen-scsiback.c:52:#include <scsi/scsi_host.h> /* SG_ALL */
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      ba929992
  17. 01 6月, 2015 3 次提交
  18. 31 5月, 2015 5 次提交