qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 20/30] memory: iommu support


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 20/30] memory: iommu support
Date: Thu, 23 May 2013 19:24:40 +0100

On 21 May 2013 11:57, Paolo Bonzini <address@hidden> wrote:
> From: Avi Kivity <address@hidden>
>
> Add a new memory region type that translates addresses it is given,
> then forwards them to a target address space.  This is similar to
> an alias, except that the mapping is more flexible than a linear
> translation and trucation, and also less efficient since the
> translation happens at runtime.
>
> The implementation uses an AddressSpace mapping the target region to
> avoid hierarchical dispatch all the way to the resolved region; only
> iommu regions are looked up dynamically.
>
> Signed-off-by: Avi Kivity <address@hidden>
> [Modified to put translation in address_space_translate - Paolo]
> Signed-off-by: Paolo Bonzini <address@hidden>

More overlong lines here, and these are in comments so trivial
to avoid.

>  /**
> + * memory_region_is_iommu: check whether a memory region is an iommu
> + *
> + * Returns %true is a memory region is an iommu.

"s/is/if/"

>
> +void memory_region_init_iommu(MemoryRegion *mr,
> +                              MemoryRegionIOMMUOps *ops,
> +                              AddressSpace *target_as,
> +                              const char *name,
> +                              uint64_t size)
> +{
> +    memory_region_init(mr, name, size);
> +    mr->ops = NULL;
> +    mr->iommu_ops = ops,
> +    mr->opaque = mr;
> +    mr->terminates = true;  /* then re-forwards */
> +    mr->destructor = memory_region_destructor_none;

destructor_none is the default, you don't need to set it again.

thanks
-- PMM



reply via email to

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