]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/virtio/virtio-iommu: Enforce power-of-two notify for both MAP and UNMAP
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Mon, 18 Jul 2022 13:56:37 +0000 (14:56 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 26 Jul 2022 19:33:29 +0000 (15:33 -0400)
commit0522be9a0c0094088ccef7aab352c57f483ca250
tree8bb87176f0ae8282f22ca1b639be8b062265af88
parentb3e6982b4154c1c0ab8b25f2e1ac7838a1809824
hw/virtio/virtio-iommu: Enforce power-of-two notify for both MAP and UNMAP

Currently we only enforce power-of-two mappings (required by the QEMU
notifier) for UNMAP requests. A MAP request not aligned on a
power-of-two may be successfully handled by VFIO, and then the
corresponding UNMAP notify will fail because it will attempt to split
that mapping. Ensure MAP and UNMAP notifications are consistent.

Fixes: dde3f08b5cab ("virtio-iommu: Handle non power of 2 range invalidations")
Reported-by: Tina Zhang <tina.zhang@intel.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Message-Id: <20220718135636.338264-1-jean-philippe@linaro.org>
Tested-by: Tina Zhang <tina.zhang@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-iommu.c