]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
memory/iommu: QOM'fy IOMMU MemoryRegion
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 11 Jul 2017 03:56:19 +0000 (13:56 +1000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Jul 2017 10:04:41 +0000 (12:04 +0200)
commit3df9d748067f5a7f01b98ddc63597c98c8244a95
treeb8270a9eb9c2484fb78f0ffee33b4f9ed611f8ae
parent98fab4c163adb980568afa40824208edbcd6d70c
memory/iommu: QOM'fy IOMMU MemoryRegion

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.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20170711035620.4232-2-aik@ozlabs.ru>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
20 files changed:
exec.c
hw/alpha/typhoon.c
hw/dma/rc4030.c
hw/i386/amd_iommu.c
hw/i386/intel_iommu.c
hw/mips/mips_jazz.c
hw/pci-host/apb.c
hw/ppc/spapr_iommu.c
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-bus.h
hw/s390x/s390-pci-inst.c
hw/vfio/common.c
hw/vfio/spapr.c
include/exec/memory.h
include/hw/i386/intel_iommu.h
include/hw/mips/mips.h
include/hw/ppc/spapr.h
include/hw/vfio/vfio-common.h
include/qemu/typedefs.h
memory.c