From 9fbf0fa81fca8f527669dd4fa72662d66e7d6329 Mon Sep 17 00:00:00 2001 From: John Snow Date: Fri, 6 Nov 2015 14:09:00 -0500 Subject: ide: remove hardcoded 2GiB transactional limit Not that you can request a >2GiB transaction, but that's why checking for it makes no sense anymore. With the newer 'limit' parameter to prepare_buf, we no longer need a static limit. The maximum limit is still 2GiB, but the limit parameter is set to the current transaction size, which cannot surpass 32MiB (512 * 65536). If the PRDT surpasses the transactional size, then, we'll just carry out the normative underflow handling pathways instead of needing an extra, strange pathway that worries about hitting some logistical cap for the largest sglist we can support -- we'll never even attempt to build one that big anymore. Reported-by: Kevin Wolf Signed-off-by: John Snow Acked-by: Stefan Hajnoczi Message-id: 1445902682-20051-1-git-send-email-jsnow@redhat.com --- hw/ide/pci.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'hw/ide/pci.c') diff --git a/hw/ide/pci.c b/hw/ide/pci.c index d31ff885b7..9c54b378d6 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -103,13 +103,6 @@ static int32_t bmdma_prepare_buf(IDEDMA *dma, int32_t limit) qemu_sglist_add(&s->sg, bm->cur_prd_addr, sg_len); } - /* Note: We limit the max transfer to be 2GiB. - * This should accommodate the largest ATA transaction - * for LBA48 (65,536 sectors) and 32K sector sizes. */ - if (s->sg.size > INT32_MAX) { - error_report("IDE: sglist describes more than 2GiB."); - break; - } bm->cur_prd_addr += l; bm->cur_prd_len -= l; s->io_buffer_size += l; -- cgit v1.2.3