Skip to content
Commit f1225ee4 authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Konrad Rzeszutek Wilk
Browse files

swiotlb-xen: update dev_addr after swapping pages



In xen_swiotlb_map_page and xen_swiotlb_map_sg_attrs, if the original
page is not suitable, we swap it for another page from the swiotlb
pool.

In these cases, we don't update the previously calculated dma address
for the page before calling xen_dma_map_page. Thus, we end up calling
xen_dma_map_page passing the wrong dev_addr, resulting in
xen_dma_map_page mistakenly assuming that the page is foreign when it is
local.

Fix the bug by updating dev_addr appropriately.

This change has no effect on x86, because xen_dma_map_page is a stub
there.

Signed-off-by: default avatarStefano Stabellini <sstabellini@kernel.org>
Signed-off-by: default avatarPooya Keshavarzi <Pooya.Keshavarzi@de.bosch.com>
Tested-by: default avatarPooya Keshavarzi <Pooya.Keshavarzi@de.bosch.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 602d9858
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment