- 18 12月, 2012 1 次提交
-
-
由 Rusty Russell 提交于
We simplified virtqueue_add_buf(), make it clear in the callers. Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 27 11月, 2012 1 次提交
-
-
由 Eric Northup 提交于
virtscsi_queuecommand was leaking memory when the virtio queue was full. Tested: Guest operates correctly even with very small queue sizes, validated we're not leaking kmalloc-192 sized allocations anymore. Signed-off-by: NEric Northup <digitaleric@google.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
- 09 10月, 2012 3 次提交
-
-
由 Paolo Bonzini 提交于
Support the LUN parameter change event. Currently, the host fires this event when the capacity of a disk is changed from the virtual machine monitor. The resize then appears in the kernel log like this: sd 0:0:0:0: [sda] 46137344 512-byte logical blocks: (23.6 GB/22.0 GIb) sda: detected capacity change from 22548578304 to 23622320128 Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
virtio-scsi needs to report LUNs greater than 256 using the "flat" format. Because the Linux SCSI layer just maps the SCSI LUN to an u32, without any parsing, these end up in the range from 16640 to 32767. Fix max_lun to account for the possibility that logical unit numbers are encoded with the "flat" format. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Richard W.M. Jones 提交于
The sg struct is used without being initialized, which breaks when CONFIG_DEBUG_SG is enabled. Cc: stable@vger.kernel.org Signed-off-by: NRichard W.M. Jones <rjones@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
- 14 9月, 2012 1 次提交
-
-
由 Wang Sen 提交于
When using the commands below to write some data to a virtio-scsi LUN of the QEMU guest(32-bit) with 1G physical memory(qemu -m 1024), the qemu will crash. # sudo mkfs.ext4 /dev/sdb (/dev/sdb is the virtio-scsi LUN.) # sudo mount /dev/sdb /mnt # dd if=/dev/zero of=/mnt/file bs=1M count=1024 In current implementation, sg_set_buf is called to add buffers to sg list which is put into the virtqueue eventually. But if there are some HighMem pages in table->sgl you can not get virtual address by sg_virt. So, sg_virt(sg_elem) may return NULL value. This will cause QEMU exit when virtqueue_map_sg is called in QEMU because an invalid GPA is passed by virtqueue. Two solutions are discussed here: http://lkml.indiana.edu/hypermail/linux/kernel/1207.3/00675.html Finally, value assignment approach was adopted because: Value assignment creates a well-formed scatterlist, because the termination marker in source sg_list has been set in blk_rq_map_sg(). The last entry of the source sg_list is just copied to the the last entry in destination list. Note that, for now, virtio_ring does not care about the form of the scatterlist and simply processes the first out_num + in_num consecutive elements of the sg[] array. I have tested the patch on my workstation. QEMU would not crash any more. Cc: <stable@vger.kernel.org> # 3.4: 4fe74b1c: [SCSI] virtio-scsi: SCSI driver Signed-off-by: NWang Sen <senwang@linux.vnet.ibm.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
- 20 7月, 2012 6 次提交
-
-
由 Nicholas Bellinger 提交于
This patch changes virtio-scsi to use a new virtio_driver->scan() callback so that scsi_scan_host() can be properly invoked once virtio_dev_probe() has set add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK) to signal active virtio-ring operation, instead of from within virtscsi_probe(). This fixes a bug where SCSI LUN scanning for both virtio-scsi-raw and virtio-scsi/tcm_vhost setups was happening before VIRTIO_CONFIG_S_DRIVER_OK had been set, causing VIRTIO_SCSI_S_BAD_TARGET to occur. This fixes a bug with virtio-scsi/tcm_vhost where LUN scan was not detecting LUNs. Tested with virtio-scsi-raw + virtio-scsi/tcm_vhost w/ IBLOCK on 3.5-rc2 code. Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Cong Meng 提交于
This patch implements the hotplug support for virtio-scsi. When there is a device attached/detached, the virtio-scsi driver will be signaled via event virtual queue and it will add/remove the scsi device in question automatically. Signed-off-by: NSen Wang <senwang@linux.vnet.ibm.com> Signed-off-by: NCong Meng <mc@linux.vnet.ibm.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
To improve performance for I/O to different targets, add a separate scatterlist for each of them. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
We do not need the sglist after calling virtqueue_add_buf. Hence we can "pipeline" the locked operations and start preparing the sglist for the next request while we kick the virtqueue. Together with the previous two patches, this improves performance as follows. For a simple "if=/dev/sda of=/dev/null bs=128M iflag=direct" (the source being a 10G disk, residing entirely in the host buffer cache), the additional locking does not cause any penalty with only one dd process, but 2 simultaneous I/O operations improve their times by 3%: number of simultaneous dd 1 2 ---------------------------------------- current 5.9958s 10.2640s patched 5.9531s 9.8663s (Times are best of 10). Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
Keep a separate lock for each virtqueue. While not particularly important now, it prepares the code for when we will add support for multiple request queues. It is also more tidy as soon as we introduce a separate lock for the sglist. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
Separate virtqueue_kick_prepare from virtqueue_notify, so that the expensive vmexit is done without holding the lock. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
- 10 5月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
Fix a use-after-free in the TMF path, where cmd may have been already freed by virtscsi_complete_free when wait_for_completion restarts executing virtscsi_tmf. Technically a race, but in practice the command will always be freed long before the completion waiter is awoken. The fix is to make callers specifying a completion responsible for freeing the command in all cases. Signed-off-by: NHu Tao <hutao@cn.fujitsu.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
- 19 2月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
The virtio-scsi HBA is the basis of an alternative storage stack for QEMU-based virtual machines (including KVM). Compared to virtio-blk it is more scalable, because it supports many LUNs on a single PCI slot), more powerful (it more easily supports passthrough of host devices to the guest) and more easily extensible (new SCSI features implemented by QEMU should not require updating the driver in the guest). Acked-by: NRusty Russell <rusty@rustcorp.com.au> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-