Skip to content

Commit

Permalink
vfio: Check that IOMMU MR translates to system address space
Browse files Browse the repository at this point in the history
At the moment IOMMU MR only translate to the system memory.
However if some new code changes this, we will need clear indication why
it is not working so here is the check.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information
aik authored and awilliam committed May 26, 2016
1 parent d78c19b commit f1f9365
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hw/vfio/common.c
Expand Up @@ -269,6 +269,12 @@ static void vfio_iommu_map_notify(Notifier *n, void *data)

trace_vfio_iommu_map_notify(iova, iova + iotlb->addr_mask);

if (iotlb->target_as != &address_space_memory) {
error_report("Wrong target AS \"%s\", only system memory is allowed",
iotlb->target_as->name ? iotlb->target_as->name : "none");
return;
}

/*
* The IOMMU TLB entry we have just covers translation through
* this IOMMU to its immediate target. We need to translate
Expand Down

0 comments on commit f1f9365

Please sign in to comment.