diff mbox

[V2,10/11] memory: handle alias in memory_region_is_iommu()

Message ID 1478165243-4767-11-git-send-email-jasowang@redhat.com
State New
Headers show

Commit Message

Jason Wang Nov. 3, 2016, 9:27 a.m. UTC
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/exec/memory.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paolo Bonzini Nov. 3, 2016, 4:56 p.m. UTC | #1
On 03/11/2016 10:27, Jason Wang wrote:
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  include/exec/memory.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index e605de3..ab37499 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -628,6 +628,9 @@ static inline bool memory_region_is_romd(MemoryRegion *mr)
>   */
>  static inline bool memory_region_is_iommu(MemoryRegion *mr)
>  {
> +    if (mr->alias) {
> +        return memory_region_is_iommu(mr->alias);
> +    }
>      return mr->iommu_ops;
>  }
>  
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
diff mbox

Patch

diff --git a/include/exec/memory.h b/include/exec/memory.h
index e605de3..ab37499 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -628,6 +628,9 @@  static inline bool memory_region_is_romd(MemoryRegion *mr)
  */
 static inline bool memory_region_is_iommu(MemoryRegion *mr)
 {
+    if (mr->alias) {
+        return memory_region_is_iommu(mr->alias);
+    }
     return mr->iommu_ops;
 }