From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 16/24] xen/passthrough: Introduce iommu_construct Date: Tue, 20 Jan 2015 14:28:33 +0000 Message-ID: <54BE6611.1070701@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-17-git-send-email-julien.grall@linaro.org> <54BD46C60200007800056A6B@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDZnj-0003T2-SV for xen-devel@lists.xenproject.org; Tue, 20 Jan 2015 14:29:03 +0000 Received: by mail-wi0-f169.google.com with SMTP id bs8so24291327wib.0 for ; Tue, 20 Jan 2015 06:29:02 -0800 (PST) In-Reply-To: <54BD46C60200007800056A6B@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org Hi Jan, On 19/01/15 17:02, Jan Beulich wrote: >>>> On 13.01.15 at 15:25, wrote: >> --- a/xen/drivers/passthrough/device_tree.c >> +++ b/xen/drivers/passthrough/device_tree.c >> @@ -41,6 +41,10 @@ int iommu_assign_dt_device(struct domain *d, struct dt_device_node *dev) >> if ( !list_empty(&dev->domain_list) ) >> goto fail; >> >> + rc = iommu_construct(d); >> + if ( rc ) >> + goto fail; > > Considering that the only (current) caller of this it domain_build.c I'm > afraid you're going to get into trouble if you get back -ERESTART > here. Note that on x86 Dom0 setup works via iommu_hwdom_init(), > which deals with the preemption needs (at that point in time) by > calling process_pending_softirqs() every once in a while. iommu_hwdom_init is also called for ARM (it's part of the common domain creation code). So, I don't see any issue here as we match the same behavior as PCI. FWIW, on the previous version you asked to check the need_iommu(d) in iommu_construct. For DOM0 it will return 0 and therefore never return -ERESTART. Regards, -- Julien Grall