[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
[Qemu-devel] [PATCH 19/30] memory: Introduce address_space_lookup_region, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 20/30] memory: iommu support, Paolo Bonzini, 2013/05/21
- Re: [Qemu-devel] [PATCH 20/30] memory: iommu support,
Peter Maydell <=
[Qemu-devel] [PATCH 21/30] memory: Add iommu map/unmap notifiers, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 22/30] vfio: abort if an emulated iommu is used, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 23/30] spapr: convert TCE API to use an opaque type, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 24/30] spapr: make IOMMU translation go through IOMMUTLBEntry, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 25/30] spapr: use memory core for iommu support, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 26/30] dma: eliminate old-style IOMMU support, Paolo Bonzini, 2013/05/21