#
145a86fe |
| 06-Jun-2023 |
Jean-Philippe Brucker <jean-philippe@linaro.org> |
virtio/scsi: Fix and simplify command-line
Fix and simplify the command-line parameter for virtio-scsi. Currently passing a "scsi:xxxx" parameter without the second "tpgt" argument causes kvmtool to
virtio/scsi: Fix and simplify command-line
Fix and simplify the command-line parameter for virtio-scsi. Currently passing a "scsi:xxxx" parameter without the second "tpgt" argument causes kvmtool to segfault. But only the "wwpn" parameter is necessary.
The tpgt parameter is ignored and was never used upstream. See linux/vhost_types.h:
* ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate + * RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage * ABI Rev 1: January 2013. Ignore vhost_tpgt field in struct vhost_scsi_target. * All the targets under vhost_wwpn can be seen and used by guset.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Link: https://lore.kernel.org/r/20230606130426.978945-7-jean-philippe@linaro.org Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
48427891 |
| 07-Jun-2022 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
virtio/blk: Implement VIRTIO_F_ANY_LAYOUT feature
The current virtio-block implementation assumes that buffers have a specific layout (5.2.6.4 "Legacy Interface: Framing Requirements"). Modern virti
virtio/blk: Implement VIRTIO_F_ANY_LAYOUT feature
The current virtio-block implementation assumes that buffers have a specific layout (5.2.6.4 "Legacy Interface: Framing Requirements"). Modern virtio removes this layout constraint, so we have to be careful when reading buffers. Note that since the Linux driver uses the same layout as the legacy transport, arbitrary layouts were not actually tested.
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Link: https://lore.kernel.org/r/20220607170239.120084-16-jean-philippe.brucker@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
2790307c |
| 04-Apr-2019 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
disk/aio: Add wait() disk operation
Add a call into the disk layer to synchronize the AIO queue. Wait for all pending requests to complete. This will be necessary when resetting a virtqueue.
The wa
disk/aio: Add wait() disk operation
Add a call into the disk layer to synchronize the AIO queue. Wait for all pending requests to complete. This will be necessary when resetting a virtqueue.
The wait() operation isn't the same as flush(). A VIRTIO_BLK_T_FLUSH request ensures that any write request *that completed before the FLUSH is sent* is committed to permanent storage (e.g. written back from a write cache). But it doesn't do anything for requests that are still pending when the FLUSH is sent.
Avoid introducing a mutex on the io_submit() and io_getevents() paths, because it can lead to 30% throughput drop on heavy FIO jobs. Instead manage an inflight counter using compare-and-swap operations, which is simple enough as the caller doesn't submit new requests while it waits for the AIO queue to drain. The __sync_fetch_and_* operations are a bit rough since they use full barriers, but that didn't seem to introduce a performance regression.
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
a839180e |
| 04-Apr-2019 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
disk/aio: Cancel AIO thread on cleanup
If the AIO thread is still calling io_getevents() while the exit path calls io_destroy(), it will segfault. Wait for the thread to finish before destroying the
disk/aio: Cancel AIO thread on cleanup
If the AIO thread is still calling io_getevents() while the exit path calls io_destroy(), it will segfault. Wait for the thread to finish before destroying the context.
Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
d62e8ee0 |
| 04-Apr-2019 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
disk/aio: Fix use of disk->async
Add an 'async' attribute to disk_image_operations, that describes if they can submit async I/O or not. disk_image->async is now set iff CONFIG_HAS_AIO and the ops do
disk/aio: Fix use of disk->async
Add an 'async' attribute to disk_image_operations, that describes if they can submit async I/O or not. disk_image->async is now set iff CONFIG_HAS_AIO and the ops do use AIO.
This fixes qcow1, which used to set async = 1 even though the qcow operations don't use AIO. The disk core would perform the read/write operation without pushing the completion onto the virtio queue, and the guest would be stuck waiting.
Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
30a9aa69 |
| 04-Apr-2019 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
disk/aio: Refactor AIO code
Move all AIO code to a separate file, disk/aio.c, to remove as much #ifdefs as possible. Split the raw read/write disk ops into async and sync, and choose which ones to u
disk/aio: Refactor AIO code
Move all AIO code to a separate file, disk/aio.c, to remove as much #ifdefs as possible. Split the raw read/write disk ops into async and sync, and choose which ones to use depending on CONFIG_HAS_AIO. Note that we fix raw_image__close() which incorrectly checked CONFIG_HAS_VIRTIO instead of CONFIG_HAS_AIO, and closed an unitialized disk->evt. A subsequent commit will complete this refactoring by fixing use of the 'async' disk attribute.
Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
5c5cae75 |
| 04-Apr-2019 |
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> |
virtio/blk: Set VIRTIO_BLK_F_RO when the disk is read-only
Since we don't currently tell the guest when the disk backend is read-only, it will report any inconsistent read after write as an error. A
virtio/blk: Set VIRTIO_BLK_F_RO when the disk is read-only
Since we don't currently tell the guest when the disk backend is read-only, it will report any inconsistent read after write as an error. An image may be read-only either because user requested it on the command-line, or because write support isn't implemented. Pass the read-only attribute using the VIRTIO_BLK_F_RO feature.
Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
3b55dcde |
| 05-Sep-2012 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: disk image related cleanup
Move io debug delay into kvm_config, the parser out of builtin-run into the disk code and make the init/exit functions match the rest of the code in style.
Sig
kvm tools: disk image related cleanup
Move io debug delay into kvm_config, the parser out of builtin-run into the disk code and make the init/exit functions match the rest of the code in style.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
a67da3be |
| 17-Aug-2012 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Add initial virtio-scsi support
This patch brings virito-scsi support to kvm tool.
With the introduce of tcm_vhost (vhost-scsi)
tcm_vhost: Initial merge for vhost level target fabric
kvm tools: Add initial virtio-scsi support
This patch brings virito-scsi support to kvm tool.
With the introduce of tcm_vhost (vhost-scsi)
tcm_vhost: Initial merge for vhost level target fabric driver
we can implement virito-scsi by simply having vhost-scsi to handle the SCSI command.
Howto use: 1) Setup the tcm_vhost target through /sys/kernel/config
[Stefan Hajnoczi, Thanks for the script to setup tcm_vhost]
** Setup wwpn and tpgt $ wwpn="naa.0" $ tpgt=/sys/kernel/config/target/vhost/$wwpn/tpgt_0 $ nexus=$tpgt/nexus $ mkdir -p $tpgt $ echo -n $wwpn > $nexus
** Setup lun using /dev/ram $ n=0 $ lun=$tpgt/lun/lun_${n} $ data=/sys/kernel/config/target/core/iblock_0/data_${n} $ ram=/dev/ram${n} $ mkdir -p $lun $ mkdir -p $data $ echo -n udev_path=${ram} > $data/control $ echo -n 1 > $data/enable $ ln -s $data $lun
2) Run kvm tool with the new disk option '-d scsi:$wwpn:$tpgt', e.g $ lkvm run -k /boot/bzImage -d ~/img/sid.img -d scsi:naa.0:0
Signed-off-by: Asias He <asias.hejun@gmail.com> Cc: Nicholas A. Bellinger <nab@linux-iscsi.org> Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
5236b505 |
| 03-Aug-2012 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Enable O_DIRECT support
With Direct I/O, file reads and writes go directly from the applications to the storage device, bypassing the operating system read and write caches. This is usefu
kvm tools: Enable O_DIRECT support
With Direct I/O, file reads and writes go directly from the applications to the storage device, bypassing the operating system read and write caches. This is useful for applications that manage their own caches.
Open a disk image with O_DIRECT: $ lkvm run -d ~/img/test.img,direct
The original readonly flag is still supported. Open a disk image with O_DIRECT and readonly: $ lkvm run -d ~/img/test.img,direct,ro
Signed-off-by: Asias He <asias.hejun@gmail.com> Acked-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
97f16d66 |
| 11-Jul-2012 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Introduce struct disk_image_params
Introduce struct disk_image_params to contain all the disk image parameters. This is useful for adding more disk image parameters, e.g. disk image cache
kvm tools: Introduce struct disk_image_params
Introduce struct disk_image_params to contain all the disk image parameters. This is useful for adding more disk image parameters, e.g. disk image cache mode.
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
dcd3cd8e |
| 04-Jun-2012 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Simplify disk read write function name
We read and write in sectors by default. It makes little sense to add the extra _sector string for read and write ops/function name.
Signed-off-by:
kvm tools: Simplify disk read write function name
We read and write in sectors by default. It makes little sense to add the extra _sector string for read and write ops/function name.
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
9f9207c5 |
| 19-Dec-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Fixes for disk image module
Fixes include: - Error handling - Cleanup - Standard init/uninit
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
|
#
f41a132b |
| 02-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Use native vectored AIO in virtio-blk
This patch hooks AIO support into virtio-blk, allowing for faster IO.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> [ penberg@kernel.org: wra
kvm tools: Use native vectored AIO in virtio-blk
This patch hooks AIO support into virtio-blk, allowing for faster IO.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> [ penberg@kernel.org: wrap libaio include with CONFIG_HAS_AIO ] Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
8b52f877 |
| 02-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Split io request from completion
This patch splits IO request processing from completion notification.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <p
kvm tools: Split io request from completion
This patch splits IO request processing from completion notification.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
5af21162 |
| 02-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Add optional callback on disk op completion
This patch adds an optional callback to be called when a disk op completes.
Currently theres not much use for it, but it is the infrastructure
kvm tools: Add optional callback on disk op completion
This patch adds an optional callback to be called when a disk op completes.
Currently theres not much use for it, but it is the infrastructure for adding aio support.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
2534c9b6 |
| 02-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Remove the non-iov interface from disk image ops
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
38c396e4 |
| 02-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Switch to using an enum for disk image types
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
ff6462e8 |
| 16-Jul-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Implement VIRTIO_BLK_T_GET_ID
Return device id when requested by virtio-blk. Device id is currently based on the device information and the inode number of the underlying disk image.
Sig
kvm tools: Implement VIRTIO_BLK_T_GET_ID
Return device id when requested by virtio-blk. Device id is currently based on the device information and the inode number of the underlying disk image.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
9df47d00 |
| 22-May-2011 |
Prasad Joshi <prasadjoshi124@gmail.com> |
kvm tools: Close the disk images after the guest shuts down
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
c1ed214e |
| 22-May-2011 |
Prasad Joshi <prasadjoshi124@gmail.com> |
kvm tools: Add a wrapper function to open disk images
The patch was suggested by Ingo to move the disk image subsystem code from the kvm-run.c file. The code to open all of the specified disk images
kvm tools: Add a wrapper function to open disk images
The patch was suggested by Ingo to move the disk image subsystem code from the kvm-run.c file. The code to open all of the specified disk images is now moved to a wrapper function in disk/core.c.
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com> Suggested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
fda63751 |
| 18-May-2011 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Do not use 'inline' for disk_image__flush
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
87ee33c8 |
| 18-May-2011 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Rename struct disk_image_operations ops name for raw image
This patch renames:
raw_image__read_sector_ro_mmap to raw_image__read_sector raw_image__write_sector_ro_mmap to raw_image__writ
kvm tools: Rename struct disk_image_operations ops name for raw image
This patch renames:
raw_image__read_sector_ro_mmap to raw_image__read_sector raw_image__write_sector_ro_mmap to raw_image__write_sector raw_image__close_ro_mmap to raw_image__close
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
72133dd2 |
| 18-May-2011 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Tune up ops in 'struct disk_image_operations'
Make read/write ops in 'struct disk_image_operations' always return the number of bytes read/written and close/flush ops return int.
Signed-
kvm tools: Tune up ops in 'struct disk_image_operations'
Make read/write ops in 'struct disk_image_operations' always return the number of bytes read/written and close/flush ops return int.
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
708dc6cb |
| 18-May-2011 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Split blk device code from raw.c to blk.c
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|