Skip to content
Commit 03110ff3 authored by Asias He's avatar Asias He Committed by Will Deacon
Browse files

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: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarAsias He <asias.hejun@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 76b6349f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment