Revision 4704d9eba6d8017dc694c077ca4205ffd8becad8 authored by Mark Cave-Ayland on 16 May 2020, 13:01:31 UTC, committed by Mark Cave-Ayland on 16 May 2020, 13:42:22 UTC
QEMU commit c9b7d9ec21 "virtio: increase virtqueue size for virtio-scsi and
virtio-blk" increased the number of queue descriptors from 128 to 256 which
caused OpenBIOS to fail when booting from a virtio-blk device under
qemu-system-ppc due to a memory overflow.

Update the virtio-blk driver so that it uses a maximum of 128 descriptor
entries (the previous value) to fix the issue, and also ensure that any
further increases in virtqueue size will not cause the same failure.

Note that this commit also fixes the vring_area size calculation which was
incorrectly based upon the number of virtqueues, and not the number of
descriptor entries.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
1 parent 9b8c30c
Raw File
__divti3.c
/*
 * arch/i386/libgcc/__divti3.c
 */

#include "libgcc.h"

__int128_t __divti3(__int128_t num, __int128_t den)
{
  int minus = 0;
  __int128_t v;

  if ( num < 0 ) {
    num = -num;
    minus = 1;
  }
  if ( den < 0 ) {
    den = -den;
    minus ^= 1;
  }

  v = __udivmodti4(num, den, NULL);
  if ( minus )
    v = -v;

  return v;
}
back to top