[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Fixing dma-helper qiov truncation
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Fixing dma-helper qiov truncation |
Date: |
Wed, 7 Sep 2016 12:43:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
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 <address@hidden>
> 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 <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
>
>
> 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