]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
memory: Add reporting of supported page sizes
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 21 Jun 2016 01:14:01 +0000 (11:14 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Jun 2016 01:13:09 +0000 (11:13 +1000)
commitf682e9c244af7166225f4a50cc18ff296bb9d43e
treeb7bd72279e877749a13819072e5380147e3cb66d
parentf0278900d38b2d8d9531c484bd088d9a7d5d4ea2
memory: Add reporting of supported page sizes

Every IOMMU has some granularity which MemoryRegionIOMMUOps::translate
uses when translating, however this information is not available outside
the translate context for various checks.

This adds a get_min_page_size callback to MemoryRegionIOMMUOps and
a wrapper for it so IOMMU users (such as VFIO) can know the minimum
actual page size supported by an IOMMU.

As IOMMU MR represents a guest IOMMU, this uses TARGET_PAGE_SIZE
as fallback.

This removes vfio_container_granularity() and uses new helper in
memory_region_iommu_replay() when replaying IOMMU mappings on added
IOMMU memory region.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
[dwg: Removed an unnecessary calculation]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_iommu.c
hw/vfio/common.c
include/exec/memory.h
memory.c