diff mbox series

[v4,05/15] memory/iommu: Add IOMMU_ATTR_DMA_TRANSLATION attribute

Message ID 20230622214845.3980-6-joao.m.martins@oracle.com (mailing list archive)
State New, archived
Headers show
Series vfio: VFIO migration support with vIOMMU | expand

Commit Message

Joao Martins June 22, 2023, 9:48 p.m. UTC
Add a new IOMMU attribute IOMMU_ATTR_DMA_TRANSLATION which indicates
whether the IOMMU supports DMA Translation.

This attribute will be used by VFIO device dirty page tracking so it can
restrict the IOVA under tracking to the memory map when vIOMMU is
enabled only for interrupt remapping without dma translation enabled.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
 include/exec/memory.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Eric Auger Oct. 6, 2023, 1:08 p.m. UTC | #1
Hi Joao,

On 6/22/23 23:48, Joao Martins wrote:
> Add a new IOMMU attribute IOMMU_ATTR_DMA_TRANSLATION which indicates
> whether the IOMMU supports DMA Translation.
doesn't it return whether the DMA translation is enabled instead?
> 
> This attribute will be used by VFIO device dirty page tracking so it can
> restrict the IOVA under tracking to the memory map when vIOMMU is
> enabled only for interrupt remapping without dma translation enabled.
The above sentence sounds a bit cryptic to me. Knowing whether DMAR is
enabled allows you to restrict the scope of dirty page tracking, is that
a correct understand?

Thanks

Eric
> 
> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
> ---
>  include/exec/memory.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 47c2e0221c35..5d6c2ab1f397 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -319,7 +319,8 @@ typedef struct MemoryRegionClass {
>  
>  
>  enum IOMMUMemoryRegionAttr {
> -    IOMMU_ATTR_SPAPR_TCE_FD
> +    IOMMU_ATTR_SPAPR_TCE_FD,
> +    IOMMU_ATTR_DMA_TRANSLATION,
>  };
>  
>  /*
diff mbox series

Patch

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 47c2e0221c35..5d6c2ab1f397 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -319,7 +319,8 @@  typedef struct MemoryRegionClass {
 
 
 enum IOMMUMemoryRegionAttr {
-    IOMMU_ATTR_SPAPR_TCE_FD
+    IOMMU_ATTR_SPAPR_TCE_FD,
+    IOMMU_ATTR_DMA_TRANSLATION,
 };
 
 /*