diff mbox

[V4,09/10] memory: handle alias in memory_region_is_iommu()

Message ID 1483092559-24488-10-git-send-email-jasowang@redhat.com
State New
Headers show

Commit Message

Jason Wang Dec. 30, 2016, 10:09 a.m. UTC
Cc: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/exec/memory.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Peter Xu Jan. 3, 2017, 3:42 a.m. UTC | #1
On Fri, Dec 30, 2016 at 06:09:18PM +0800, Jason Wang wrote:
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Reviewed-by: Peter Xu <peterx@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 358edfb..bec9756 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;
>  }
>  
> -- 
> 2.7.4
> 

-- peterx
diff mbox

Patch

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 358edfb..bec9756 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;
 }