qemu-patch-raspberry4/hw/scsi
Denis Plotnikov 1bf8a989a5 virtio: make seg_max virtqueue size dependent
Before the patch, seg_max parameter was immutable and hardcoded
to 126 (128 - 2) without respect to queue size. This has two negative effects:

1. when queue size is < 128, we have Virtio 1.1 specfication violation:
   (2.6.5.3.1 Driver Requirements) seq_max must be <= queue_size.
   This violation affects the old Linux guests (ver < 4.14). These guests
   crash on these queue_size setups.

2. when queue_size > 128, as was pointed out by Denis Lunev <den@virtuozzo.com>,
   seg_max restrics guest's block request length which affects guests'
   performance making them issues more block request than needed.
   https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg03721.html

To mitigate this two effects, the patch adds the property adjusting seg_max
to queue size automaticaly. Since seg_max is a guest visible parameter,
the property is machine type managable and allows to choose between
old (seg_max = 126 always) and new (seg_max = queue_size - 2) behaviors.

Not to change the behavior of the older VMs, prevent setting the default
seg_max_adjust value for older machine types.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
Message-Id: <20191220140905.1718-2-dplotnikov@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-01-06 12:04:43 -05:00
..
emulation.c scsi-generic: avoid invalid access to struct when emulating block limits 2018-11-06 21:35:06 +01:00
esp-pci.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
esp.c esp: add pseudo-DMA as used by Macintosh 2019-10-28 19:03:45 +01:00
Kconfig virtio: express virtio dependencies with Kconfig 2019-03-07 21:45:53 +01:00
lsi53c895a.c scsi: lsi: exit infinite loop while executing script (CVE-2019-12068) 2019-08-20 20:00:52 +02:00
Makefile.objs scsi: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00
megasas.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mfi.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
mpi.h hw: Add support for LSI SAS1068 (mptsas) device 2016-02-09 15:45:26 +01:00
mptconfig.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
mptendian.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
mptsas.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mptsas.h mptsas: really fix migration compatibility 2016-08-03 18:44:56 +02:00
scsi-bus.c scsi: deprecate scsi-disk 2019-11-19 10:01:34 +01:00
scsi-disk.c scsi: deprecate scsi-disk 2019-11-19 10:01:34 +01:00
scsi-generic.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
spapr_vscsi.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
srp.h spapr-vscsi: add task management 2013-09-12 08:46:21 +02:00
trace-events trace: Remove trailing newline in events 2019-09-18 10:19:47 +01:00
vhost-scsi-common.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
vhost-scsi.c virtio: make seg_max virtqueue size dependent 2020-01-06 12:04:43 -05:00
vhost-user-scsi.c vhost-user-scsi: reset the device if supported 2020-01-05 07:03:03 -05:00
viosrp.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
virtio-scsi-dataplane.c Replace '-enable-kvm' with '-accel kvm' in docs and help texts 2018-06-28 19:05:32 +02:00
virtio-scsi.c virtio: make seg_max virtqueue size dependent 2020-01-06 12:04:43 -05:00
vmw_pvscsi.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
vmw_pvscsi.h scsi: VMWare PVSCSI paravirtual device implementation 2013-04-19 10:44:17 +02:00