From: "Jan Beulich" Subject: Re: [PATCH v3 06/13] xen/passthrough: iommu: Split generic IOMMU code Date: Wed, 12 Mar 2014 07:15:32 +0000 Message-ID: <532017A40200007800123136@nat28.tlf.novell.com> References: <1394552999-14171-1-git-send-email-julien.grall@linaro.org> <1394552999-14171-7-git-send-email-julien.grall@linaro.org> <531F4CCC0200007800122F5F@nat28.tlf.novell.com> <531F433F.8000009@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNdO4-0007Ye-Pv for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 07:15:37 +0000 In-Reply-To: <531F433F.8000009@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel , stefano.stabellini@citrix.com, ian.campbell@citrix.com, Xiantao Zhang , tim@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 11.03.14 at 18:09, Julien Grall wrote: > On 03/11/2014 04:50 PM, Jan Beulich wrote: >>>>> On 11.03.14 at 16:49, Julien Grall wrote: >>> --- a/xen/drivers/passthrough/pci.c >>> +++ b/xen/drivers/passthrough/pci.c >>> ... >>> +static int iommu_populate_page_table(struct domain *d) >>> +{ >> >> I continue to be of the opinion that this is misplaced here. There's >> nothing PCI-related in this function, and I doubt you can get away >> on ARM without similar code (if you can, this should go into >> .../x86/iommu.c imo). > > On ARM, the page table is shared with the processor, we don't need to > populate the page table. Furthermore, this function is using > "arch.relmem_list", which is not implemented on ARM. > > I can move it in x86/iommu.c and implemented the function is no-op on ARM. Yes, please. >>> --- /dev/null >>> +++ b/xen/include/asm-x86/iommu.h >>> ... >>> +void iommu_set_dom0_mapping(struct domain *d); >> >> How is this x86-specific? > > iommu_set_dom0_mapping is implemented in vtd/x86/vtd.c and only used by > vtd/iommu.c. > > I think this function should be renamed to iommu_vtd_set_dom0_mapping. Ah, indeed. But apart from naming the function properly, it being VT-d only its declaration should be moved into xen/drivers/passthrough/vtd/extern.h instead. Jan