android_kernel_motorola_sm6375/drivers/vhost
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stefano Garzarella a15cbe9b84 vhost: fix range used in translate_desc()
[ Upstream commit 98047313cdb46828093894d0ac8b1183b8b317f9 ]

vhost_iotlb_itree_first() requires `start` and `last` parameters
to search for a mapping that overlaps the range.

In translate_desc() we cyclically call vhost_iotlb_itree_first(),
incrementing `addr` by the amount already translated, so rightly
we move the `start` parameter passed to vhost_iotlb_itree_first(),
but we should hold the `last` parameter constant.

Let's fix it by saving the `last` parameter value before incrementing
`addr` in the loop.

Fixes: a9709d6874 ("vhost: convert pre sorted vhost memory array to interval tree")
Acked-by: Jason Wang <[email protected]>
Signed-off-by: Stefano Garzarella <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-01-18 11:41:57 +01:00
..
Kconfig
Kconfig.vringh
Makefile
net.c
scsi.c
test.c
test.h
vhost.c vhost: fix range used in translate_desc() 2023-01-18 11:41:57 +01:00
vhost.h
vringh.c
vsock.c vhost/vsock: Use kvmalloc/kvfree for larger packets. 2022-10-26 13:22:25 +02:00