diff mbox series

[13/27] Make address_space_translate_iommu take a MemTxAttrs argument

Message ID 20180521140402.23318-14-peter.maydell@linaro.org
State Superseded
Headers show
Series iommu: support txattrs, support TCG execution, implement TZ MPC | expand

Commit Message

Peter Maydell May 21, 2018, 2:03 p.m. UTC
As part of plumbing MemTxAttrs down to the IOMMU translate method,
add MemTxAttrs as an argument to address_space_translate_iommu().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

---
 exec.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.17.0

Comments

Alex Bennée May 22, 2018, 11 a.m. UTC | #1
Peter Maydell <peter.maydell@linaro.org> writes:

> As part of plumbing MemTxAttrs down to the IOMMU translate method,

> add MemTxAttrs as an argument to address_space_translate_iommu().

>

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---

>  exec.c | 8 +++++---

>  1 file changed, 5 insertions(+), 3 deletions(-)

>

> diff --git a/exec.c b/exec.c

> index af2b82d154..c3baadc349 100644

> --- a/exec.c

> +++ b/exec.c

> @@ -478,6 +478,7 @@ address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x

>   * @is_write: whether the translation operation is for write

>   * @is_mmio: whether this can be MMIO, set true if it can

>   * @target_as: the address space targeted by the IOMMU

> + * @attrs: transaction attributes

>   *

>   * This function is called from RCU critical section.  It is the common

>   * part of flatview_do_translate and address_space_translate_cached.

> @@ -488,7 +489,8 @@ static MemoryRegionSection address_space_translate_iommu(IOMMUMemoryRegion *iomm

>                                                           hwaddr *page_mask_out,

>                                                           bool is_write,

>                                                           bool is_mmio,

> -                                                         AddressSpace **target_as)

> +                                                         AddressSpace **target_as,

> +                                                         MemTxAttrs attrs)

>  {

>      MemoryRegionSection *section;

>      hwaddr page_mask = (hwaddr)-1;

> @@ -572,7 +574,7 @@ static MemoryRegionSection flatview_do_translate(FlatView *fv,

>          return address_space_translate_iommu(iommu_mr, xlat,

>                                               plen_out, page_mask_out,

>                                               is_write, is_mmio,

> -                                             target_as);

> +                                             target_as, attrs);

>      }

>      if (page_mask_out) {

>          /* Not behind an IOMMU, use default page size. */

> @@ -3735,7 +3737,7 @@ static inline MemoryRegion *address_space_translate_cached(

>

>      section = address_space_translate_iommu(iommu_mr, xlat, plen,

>                                              NULL, is_write, true,

> -                                            &target_as);

> +                                            &target_as, attrs);

>      return section.mr;

>  }



--
Alex Bennée
Richard Henderson May 22, 2018, 5:30 p.m. UTC | #2
On 05/21/2018 07:03 AM, Peter Maydell wrote:
> As part of plumbing MemTxAttrs down to the IOMMU translate method,

> add MemTxAttrs as an argument to address_space_translate_iommu().

> 

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> ---


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/exec.c b/exec.c
index af2b82d154..c3baadc349 100644
--- a/exec.c
+++ b/exec.c
@@ -478,6 +478,7 @@  address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x
  * @is_write: whether the translation operation is for write
  * @is_mmio: whether this can be MMIO, set true if it can
  * @target_as: the address space targeted by the IOMMU
+ * @attrs: transaction attributes
  *
  * This function is called from RCU critical section.  It is the common
  * part of flatview_do_translate and address_space_translate_cached.
@@ -488,7 +489,8 @@  static MemoryRegionSection address_space_translate_iommu(IOMMUMemoryRegion *iomm
                                                          hwaddr *page_mask_out,
                                                          bool is_write,
                                                          bool is_mmio,
-                                                         AddressSpace **target_as)
+                                                         AddressSpace **target_as,
+                                                         MemTxAttrs attrs)
 {
     MemoryRegionSection *section;
     hwaddr page_mask = (hwaddr)-1;
@@ -572,7 +574,7 @@  static MemoryRegionSection flatview_do_translate(FlatView *fv,
         return address_space_translate_iommu(iommu_mr, xlat,
                                              plen_out, page_mask_out,
                                              is_write, is_mmio,
-                                             target_as);
+                                             target_as, attrs);
     }
     if (page_mask_out) {
         /* Not behind an IOMMU, use default page size. */
@@ -3735,7 +3737,7 @@  static inline MemoryRegion *address_space_translate_cached(
 
     section = address_space_translate_iommu(iommu_mr, xlat, plen,
                                             NULL, is_write, true,
-                                            &target_as);
+                                            &target_as, attrs);
     return section.mr;
 }