vfio/common: Add helper to validate iova/end against hostwin
authorJoao Martins <joao.m.martins@oracle.com>
Tue, 7 Mar 2023 12:54:40 +0000 (12:54 +0000)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 7 Mar 2023 14:20:32 +0000 (07:20 -0700)
commitfbc6c92134048cef7a9317119da4b6beea03138e
treea409ee74552ddc28eebfae03630651ad7fb15783
parent725ccd7e419d640ebee4c3869235efea070764de
vfio/common: Add helper to validate iova/end against hostwin

Move the code that finds the container host DMA window against a iova
range. This avoids duplication on the common checks across listener
callbacks.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Link: https://lore.kernel.org/r/20230307125450.62409-6-joao.m.martins@oracle.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c