diff options
author | John Snow <jsnow@redhat.com> | 2014-10-31 16:03:38 -0400 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-11-14 09:20:34 +0000 |
commit | bef1301acb74d177b42890116e4eeaf26047b9e3 (patch) | |
tree | dc4f98c9ef17d9f1f09e2dcab7143f685c6b0883 /hw/ide/core.c | |
parent | 36334faf35ccc48d61ca3431a5c0787b125dd306 (diff) | |
download | hqemu-bef1301acb74d177b42890116e4eeaf26047b9e3.zip hqemu-bef1301acb74d177b42890116e4eeaf26047b9e3.tar.gz |
ahci: unify sglist preparation
The intent of this patch is to further unify the creation and
deletion of the sglist used for all AHCI transfers, including
emulated PIO, ATAPI R/W, and native DMA R/W.
By replacing ahci_start_transfer's call to ahci_populate_sglist
with ahci_dma_prepare_buf, we reduce the number of direct calls
where we manipulate the scatter-gather list in the AHCI code.
To make this switch, the constant "0" passed as an offset
in ahci_dma_prepare_buf is adjusted to use io_buffer_offset.
For DMA pathways, this has no effect: io_buffer_offset is always
updated to 0 at the beginning of a DMA transfer loop regardless.
DMA pathways through ide_dma_cb() update the io_buffer_offset
accordingly, and for circumstances where we might make several
trips through this loop, this may actually correct a design flaw.
For PIO pathways, the newly updated ahci_dma_prepare_buf will
now prepare the sglist at the correct offset. It will also set
io_buffer_size, but this is not used in the cmd_read_pio or
cmd_write_pio pathways.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1414785819-26209-3-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
0 files changed, 0 insertions, 0 deletions