From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnzWw-0008Ka-VS for qemu-devel@nongnu.org; Mon, 10 Nov 2014 19:42:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnzWq-0004bi-F7 for qemu-devel@nongnu.org; Mon, 10 Nov 2014 19:41:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnzWq-0004ax-7Y for qemu-devel@nongnu.org; Mon, 10 Nov 2014 19:41:52 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAB0fn6u020551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 10 Nov 2014 19:41:49 -0500 From: John Snow Date: Mon, 10 Nov 2014 19:41:40 -0500 Message-Id: <1415666500-861-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH] ahci: Fix byte count regression for ATAPI/PIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, John Snow , armbru@redhat.com, stefanha@redhat.com This patch fixes a regression caused by commit 659142ecf71a0da240ab0ff7cf929ee25c32b9bc. The problem occurs when we wish to return early from the ahci_start_transfer function, but are now updating the transferred byte count in the AHCI command header via ahci_commit_buf. This will cause problems in the Windows 8 installer. Don't update the byte count in the command header for the transmission of ATAPI packets: These commands will distort the final byte count of the actual data payload. The call to ahci_commit_buf remains in the "out" portion of the call in order to clean up the sglist. The byte count is maintained by forcing size to be 0. Signed-off-by: John Snow --- hw/ide/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 61dbed1..1f3f951 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1089,6 +1089,7 @@ static void ahci_start_transfer(IDEDMA *dma) if (is_atapi && !ad->done_atapi_packet) { /* already prepopulated iobuffer */ ad->done_atapi_packet = true; + size = 0; goto out; } -- 1.9.3