From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYzQR-0001Z9-7Z for qemu-devel@nongnu.org; Mon, 07 Sep 2015 12:37:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYzQQ-00088i-Fq for qemu-devel@nongnu.org; Mon, 07 Sep 2015 12:37:47 -0400 References: <1440546331-29087-1-git-send-email-jsnow@redhat.com> <1440546331-29087-2-git-send-email-jsnow@redhat.com> From: Paolo Bonzini Message-ID: <55EDBD4F.7070204@redhat.com> Date: Mon, 7 Sep 2015 18:37:35 +0200 MIME-Version: 1.0 In-Reply-To: <1440546331-29087-2-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] ide: unify io_buffer_offset increments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: hare@suse.de, stefanha@redhat.com, qemu-devel@nongnu.org On 26/08/2015 01:45, John Snow wrote: > IDEState's io_buffer_offset was originally added to keep track of offsets > in AHCI rather exclusively, but it was added to IDEState instead of an > AHCI-specific structure. Interesting to see something weird turn into feature. :) Reviewed-by: Paolo Bonzini > AHCI fakes all PIO transfers using DMA and a scatter-gather list. When > the core or atapi layers invoke HBA-specific mechanisms for transfers, > they do not always know that it is being backed by DMA or a sglist, so > this offset is not always updated by the HBA code everywhere. > > If we modify it in dma_buf_commit, however, any HBA that needs to use > this offset to manage operating on only part of a sglist will have > access to it. > > This will fix ATAPI PIO transfers performed through the AHCI HBA, > which were previously not modifying this value appropriately. > > This will fix ATAPI PIO transfers larger than one sector.