]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm,virtio: add scatter-gather support v2
authorAsias He <asias.hejun@gmail.com>
Sat, 26 Feb 2011 02:11:52 +0000 (10:11 +0800)
committerPekka Enberg <penberg@kernel.org>
Sat, 26 Feb 2011 10:28:09 +0000 (12:28 +0200)
commitd50e8b75e6dd45acefa135e940d008d63119c055
tree270614aed045c98fa33bcb455dd00ee869b771ed
parent51191478bf67b1d69a1927f5392bd529932b2a5c
kvm,virtio: add scatter-gather support v2

The size of the virtqueue(16) was smaller than scatter-gather(128)
which hypervisor tells the guest.  Under some circumstances,
if the guest uses scatter-gather which larger than 16 - 2, kernel panics.
That is why the scatter-gather support v1 breaks Cyrill's kernel boot.

Two descriptors are used as the header and status descriptors.
The remaining descriptors can be used as the real disk data descriptors.
So DISK_SEG_MAX should be VIRTIO_BLK_QUEUE_SIZE - 2.
VIRTIO_BLK_QUEUE_SIZE is 128 and DISK_SEG_MAX is 126 in this patch.

Tested-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/blk-virtio.c