Commit 3a43f113 authored by Jan Beulich's avatar Jan Beulich Committed by Zheng Zengkai
Browse files

Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()



stable inclusion
from stable-5.10.18
commit 1a5c2274349f5b6f3b6bbdf43247e71a50ae6e2f
bugzilla: 50148

--------------------------------

commit dbe52836 upstream.

We may not skip setting the field in the unmap structure when
GNTMAP_device_map is in use - such an unmap would fail to release the
respective resources (a page ref in the hypervisor). Otoh the field
doesn't need setting at all when GNTMAP_device_map is not in use.

To record the value for unmapping, we also better don't use our local
p2m: In particular after a subsequent change it may not have got updated
for all the batch elements. Instead it can simply be taken from the
respective map's results.

We can additionally avoid playing this game altogether for the kernel
part of the mappings in (x86) PV mode.

This is part of XSA-361.

Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 32f0e57f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment