From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfaCJ-0003wN-2b for qemu-devel@nongnu.org; Thu, 23 May 2013 14:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfaCE-00050Y-D7 for qemu-devel@nongnu.org; Thu, 23 May 2013 14:25:06 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:35366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfaCE-0004wB-3r for qemu-devel@nongnu.org; Thu, 23 May 2013 14:25:02 -0400 Received: by mail-lb0-f178.google.com with SMTP id w10so3706266lbi.23 for ; Thu, 23 May 2013 11:25:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1369133851-1894-21-git-send-email-pbonzini@redhat.com> References: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> <1369133851-1894-21-git-send-email-pbonzini@redhat.com> From: Peter Maydell Date: Thu, 23 May 2013 19:24:40 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 20/30] memory: iommu support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jan.kiszka@gmail.com, qemu-devel@nongnu.org, Avi Kivity , David Gibson On 21 May 2013 11:57, Paolo Bonzini wrote: > From: Avi Kivity > > 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 > [Modified to put translation in address_space_translate - Paolo] > Signed-off-by: Paolo Bonzini 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