]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
megasas: fix mapped frame size
authorPeter Lieven <pl@kamp.de>
Thu, 4 Apr 2019 12:10:15 +0000 (14:10 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Jul 2019 19:10:31 +0000 (14:10 -0500)
the current value of 1024 bytes (16 * MFI_FRAME_SIZE) we map is not enough to hold
the maximum number of scatter gather elements we advertise. We actually need a
maximum of 2048 bytes. This is 128 max sg elements * 16 bytes (sizeof (union mfi_sgl)).

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <20190404121015.28634-1-pl@kamp.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 2e56fbc87f6ec3cd56c37b01d313abd502b80d61)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi/megasas.c

index a56317e026ad2663712178c48b82b85228db7a7a..5ad762de23319d8ab76aaa5eeb952692b96f0dc4 100644 (file)
@@ -477,7 +477,7 @@ static MegasasCmd *megasas_enqueue_frame(MegasasState *s,
 {
     PCIDevice *pcid = PCI_DEVICE(s);
     MegasasCmd *cmd = NULL;
-    int frame_size = MFI_FRAME_SIZE * 16;
+    int frame_size = MEGASAS_MAX_SGE * sizeof(union mfi_sgl);
     hwaddr frame_size_p = frame_size;
     unsigned long index;