On Wed, Jun 08, 2016 at 04:05:48PM +1000, Alexey Kardashevskiy wrote: > On 08/06/16 16:00, David Gibson wrote: > > On Mon, Jun 06, 2016 at 03:31:04PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 02/06/2016 05:35, David Gibson wrote: > >>> On Wed, Jun 01, 2016 at 06:57:37PM +1000, Alexey Kardashevskiy wrote: > >>>>> 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_page_sizes callback to MemoryRegionIOMMUOps and > >>>>> a wrapper for it so IOMMU users (such as VFIO) can know the actual > >>>>> page size(s) used 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 <a...@ozlabs.ru> > >>>>> Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> > >>> Paolo, > >>> > >>> Looks like you were left off the CC for this one. > >>> > >>> I think this is ready to go - do you want to merge, comment or ack and > >>> we'll take it either through my tree or Alex's? > >> > >> It's okay for you to merge, but the callback should be called > >> "get_page_size" or "get_replay_granularity". The plural is weird. > > > > Hm, no, it really could return multiple page sizes if the logical > > (guest side) IOMMU supports them. > > It could but it does not now and I cannot see it coming in near future so I > am really confused now about the naming and what the callback should return > - one page size or a mask. What should it be now?
Eh, make it a single page size for now. We can extend it to a mask if we ever need it. But for clarity, best to call it 'get_min_page_size' or 'get_granularity'. > > That might be useful at some point > > in the future. For now, it's sufficient for the replay to use the > > smallest pagesize. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature