On Fri, 5 May 2017 20:19:30 +1000 Alexey Kardashevskiy <a...@ozlabs.ru> wrote:
> This defines new QOM object - IOMMUMemoryRegion - with MemoryRegion > as a parent. > > This moves IOMMU-related fields from MR to IOMMU MR. However to avoid > dymanic QOM casting in fast path (address_space_translate, etc), > this adds an @is_iommu boolean flag to MR and provides new helper to > do simple cast to IOMMU MR - memory_region_get_iommu. The flag > is set in the instance init callback. This defines > memory_region_is_iommu as memory_region_get_iommu()!=NULL. > > This switches MemoryRegion to IOMMUMemoryRegion in most places except > the ones where MemoryRegion may be an alias. > > This defines memory_region_init_iommu_type() to allow creating > IOMMUMemoryRegion subclasses. In order to support custom QOM type, > this splits memory_region_init() to object_initialize() + > memory_region_do_init. > > Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> > --- > Changes: > v6: > * s/\<iommumr\>/iommu_mr/g > > v5: > * fixed sparc64, first time in many years did run "./configure" without > --target-list :-D Sorry for the noise though :( > > v4: > * fixed alpha, mips64el and sparc > > v3: > * rebased on sha1 81b2d5ceb0 > > v2: > * added mr->is_iommu > * updated i386/x86_64/s390/sun > --- > hw/s390x/s390-pci-bus.h | 2 +- > include/exec/memory.h | 77 +++++++++++++++++++------- > include/hw/i386/intel_iommu.h | 2 +- > include/hw/mips/mips.h | 2 +- > include/hw/ppc/spapr.h | 3 +- > include/hw/vfio/vfio-common.h | 2 +- > include/qemu/typedefs.h | 1 + > exec.c | 16 +++--- > hw/alpha/typhoon.c | 8 ++- > hw/dma/rc4030.c | 8 +-- > hw/i386/amd_iommu.c | 9 +-- > hw/i386/intel_iommu.c | 17 +++--- > hw/mips/mips_jazz.c | 2 +- > hw/pci-host/apb.c | 6 +- > hw/ppc/spapr_iommu.c | 20 ++++--- > hw/s390x/s390-pci-bus.c | 6 +- > hw/s390x/s390-pci-inst.c | 8 +-- > hw/vfio/common.c | 12 ++-- > hw/vfio/spapr.c | 3 +- > memory.c | 124 > +++++++++++++++++++++++++++++------------- > 20 files changed, 213 insertions(+), 115 deletions(-) Acked-by: Cornelia Huck <cornelia.h...@de.ibm.com>