qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [RFC PATCH qemu 1/5] memory/iommu: QOM'fy IOMMU MemoryReg


From: Paolo Bonzini
Subject: Re: [Qemu-ppc] [RFC PATCH qemu 1/5] memory/iommu: QOM'fy IOMMU MemoryRegion
Date: Thu, 30 Mar 2017 15:00:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]