From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v8 for-xen-4.5 2/2] dpci: Replace tasklet with an softirq (v8) Date: Sun, 2 Nov 2014 16:09:45 -0400 Message-ID: <20141102200945.GA31191@andromeda.dapyr.net> References: <544E397F0200007800042651@mail.emea.novell.com> <20141027170115.GC11893@laptop.dumpdata.com> <544E8283.1030907@citrix.com> <20141027180010.GB12989@laptop.dumpdata.com> <20141027211338.GA17750@laptop.dumpdata.com> <544F81640200007800042BE5@mail.emea.novell.com> <20141028200734.GA31298@laptop.dumpdata.com> <5450B32E0200007800042FC8@mail.emea.novell.com> <20141029211125.GA7967@laptop.dumpdata.com> <54520D3202000078000435FA@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xl1TI-0001pP-Tt for xen-devel@lists.xenproject.org; Sun, 02 Nov 2014 20:09:57 +0000 Content-Disposition: inline In-Reply-To: <54520D3202000078000435FA@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: keir@xen.org, ian.campbell@citrix.com, Andrew Cooper , tim@xen.org, xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org > > -void pci_release_devices(struct domain *d) > > +int pci_release_devices(struct domain *d) > > { > > struct pci_dev *pdev; > > u8 bus, devfn; > > + int ret; > > > > spin_lock(&pcidevs_lock); > > - pci_clean_dpci_irqs(d); > > + ret = pci_clean_dpci_irqs(d); > > + if ( ret == -ERESTART ) > > + { > > + spin_unlock(&pcidevs_lock); > > + return ret; > > + } > > while ( (pdev = pci_get_pdev_by_domain(d, -1, -1, -1)) ) > > { > > bus = pdev->bus; > > Even if errors other than -ERESTART aren't possible right now, the > code now looks like it is ignoring such. I think it would be better if > you simply dropped the special casing of -ERESTART and propagated > all errors here. The will cause a regression. The pci_clean_dpci_irqs will now return -EINVAL if the iommu is turned off - which will mean that we won't be able to kill an HVM guest without passthrough. I can do: 1). if ( ret && !(ret == -EINVAL || ret == -E..)) 2). Or remove the various 'return -EINVAL' in the pci_clean_dpci_irqs for the causes where IOMMU is off or there are no PCI passthrough devices - and just make them return 0. 3). Leave it as is.