On 30/03/2017 14:47, Alexey Kardashevskiy wrote: > @@ -633,7 +663,7 @@ static inline bool memory_region_is_iommu(MemoryRegion > *mr) > if (mr->alias) { > return memory_region_is_iommu(mr->alias); > } > - return mr->iommu_ops; > + return object_dynamic_cast(OBJECT(mr), TYPE_IOMMU_MEMORY_REGION) != NULL; > }
This is going to be too slow for all the places where fast paths use address_space_translate. You need a (slightly hackish) bool iommu flag in MemoryRegion, and a regular C cast rather than the type-safe IOMMU_MEMORY_REGION(mr) in address_space_translate. You can set the flag in iommu_memory_region_instance_init for example. Paolo