* [Qemu-devel] Fixing dma-helper qiov truncation
@ 2016-09-07 7:31 Mark Cave-Ayland
2016-09-07 10:43 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Mark Cave-Ayland @ 2016-09-07 7:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Paolo Bonzini
Now that the 2.8 tree is open, I'd like to resurrect this earlier patch
to switch the macio controller over to the new byte-aligned DMA helpers:
https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg04907.html.
The first patch in the series is a hack to work around the issue that
byte-aligned qiovs are being truncated with the existing code. git blame
shows that this code was introduced by this commit:
commit 58f423fbd5f7f435e8dc56dfa565b043d20d1e1b
Author: Kevin Wolf <kwolf@redhat.com>
Date: Wed Jul 9 19:17:30 2014 +0200
dma-helpers: Fix too long qiov
If the size of the scatter/gather list isn't a multiple of 512, the
number of sectors for the block layer request is rounded down, resulting
in a qiov that doesn't match the request length. Truncate the qiov
to the
new length of the request.
This fixes the IDE qtest case /x86_64/ide/bmdma/short_prdt.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Kevin/Paolo - what should be the correct behaviour here given that the
underlying APIs are now byte-aligned?
ATB,
Mark.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Fixing dma-helper qiov truncation
2016-09-07 7:31 [Qemu-devel] Fixing dma-helper qiov truncation Mark Cave-Ayland
@ 2016-09-07 10:43 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-09-07 10:43 UTC (permalink / raw)
To: Mark Cave-Ayland, qemu-devel; +Cc: Kevin Wolf
On 07/09/2016 09:31, Mark Cave-Ayland wrote:
> Now that the 2.8 tree is open, I'd like to resurrect this earlier patch
> to switch the macio controller over to the new byte-aligned DMA helpers:
> https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg04907.html.
>
> The first patch in the series is a hack to work around the issue that
> byte-aligned qiovs are being truncated with the existing code. git blame
> shows that this code was introduced by this commit:
>
>
> commit 58f423fbd5f7f435e8dc56dfa565b043d20d1e1b
> Author: Kevin Wolf <kwolf@redhat.com>
> Date: Wed Jul 9 19:17:30 2014 +0200
>
> dma-helpers: Fix too long qiov
>
> If the size of the scatter/gather list isn't a multiple of 512, the
> number of sectors for the block layer request is rounded down, resulting
> in a qiov that doesn't match the request length. Truncate the qiov
> to the
> new length of the request.
>
> This fixes the IDE qtest case /x86_64/ide/bmdma/short_prdt.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
>
> Kevin/Paolo - what should be the correct behaviour here given that the
> underlying APIs are now byte-aligned?
I think the expected alignment should be passed down to dma-helpers, and
they should ignore the unaligned tail of the QEMUSGList.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-07 10:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07 7:31 [Qemu-devel] Fixing dma-helper qiov truncation Mark Cave-Ayland
2016-09-07 10:43 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.