From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNfO-0001WV-OI for qemu-devel@nongnu.org; Mon, 03 Nov 2014 14:52:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlNfI-0006UY-IO for qemu-devel@nongnu.org; Mon, 03 Nov 2014 14:51:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNfI-0006TO-Ar for qemu-devel@nongnu.org; Mon, 03 Nov 2014 14:51:48 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA3Jpkql015182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 3 Nov 2014 14:51:47 -0500 Message-ID: <5457DCD1.7050204@redhat.com> Date: Mon, 03 Nov 2014 14:51:45 -0500 From: John Snow MIME-Version: 1.0 References: <1414785819-26209-1-git-send-email-jsnow@redhat.com> <5457768C.6060400@redhat.com> In-Reply-To: <5457768C.6060400@redhat.com> Content-Type: multipart/mixed; boundary="------------020002070009070305090000" Subject: Re: [Qemu-devel] [block PATCH v2 0/3] AHCI device fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "kwolf >> Kevin Wolf" , "pbonzini >> Paolo Bonzini" , "armbru >> Markus Armbruster" , stefan Hajnoczi This is a multi-part message in MIME format. --------------020002070009070305090000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 11/03/2014 07:35 AM, Paolo Bonzini wrote: > On 31/10/2014 21:03, John Snow wrote: >> - Adjust the prepare_buf() callback to return, simply, the number >> of bytes it was able to prepare, or -1 on error. This resolves >> an ambiguity around the nature of its return code meaning >> "no sectors" or "no bytes" which led to bad error pathways. > > Much nicer! Sounds obvious, but hindsight is 20/20... > >> John Snow (3): >> ide: repair PIO transfers for cases where nsector > 1 >> ahci: unify sglist preparation >> ide: Correct handling of malformed/short PRDTs >> >> hw/ide/ahci.c | 33 ++++++++++++++++++++++++++------- >> hw/ide/core.c | 14 ++++++++++++-- >> hw/ide/internal.h | 13 +++++++------ >> hw/ide/macio.c | 7 ++++++- >> hw/ide/pci.c | 27 +++++++++++++++++++++------ >> 5 files changed, 72 insertions(+), 22 deletions(-) >> > > Reviewed-by: Paolo Bonzini > > Paolo > There is a trivial fix to be made in hw/ide/ahci.c: diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 27f078d..f49be9f 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -791,7 +791,7 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, } if ((off_idx == -1) || (off_pos < 0) || (off_pos > tbl_entry_size)) { DPRINTF(ad->port_no, "%s: Incorrect offset! " - "off_idx: %d, off_pos: %d\n", + "off_idx: %d, off_pos: %"PRId64"\n", __func__, off_idx, off_pos); r = -1; goto out; Missed this one because it's under a debugging #ifdef. I will fix it myself if a v3 is warranted otherwise. --js --------------020002070009070305090000 Content-Type: text/x-patch; name="trivial.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="trivial.diff" diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 27f078d..f49be9f 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -791,7 +791,7 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, } if ((off_idx == -1) || (off_pos < 0) || (off_pos > tbl_entry_size)) { DPRINTF(ad->port_no, "%s: Incorrect offset! " - "off_idx: %d, off_pos: %d\n", + "off_idx: %d, off_pos: %"PRId64"\n", __func__, off_idx, off_pos); r = -1; goto out; --------------020002070009070305090000--