From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 26/33] xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device Date: Tue, 31 Mar 2015 14:16:41 +0100 Message-ID: <1427807801.2115.123.camel@citrix.com> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> <1426793399-6283-27-git-send-email-julien.grall@linaro.org> <1427801079.2115.84.camel@citrix.com> <551A934C.6090908@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 1Ycw2A-0003Tq-D6 for xen-devel@lists.xenproject.org; Tue, 31 Mar 2015 13:16:46 +0000 In-Reply-To: <551A934C.6090908@linaro.org> 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: Wei Liu , Ian Jackson , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Tue, 2015-03-31 at 13:30 +0100, Julien Grall wrote: > >> + /* TODO: Do we need to check is_dying? Mostly to protect against > >> + * hypercall trying to passthrough a device while we are > >> + * dying. > > > > iommu_do_pci_domctl does in specific casses (i.e. assign device). I > > guess you should follow that lead. > > I'm not sure to fully understand when is_dying should be used or not. > > Looking to the PCI code, the is_dying has been added when we add code to > deal with page. > > I would be inclined to say it's only necessary when deadling with page. > Can someone confirm me? > > Otherwise, I don't why is_dying should be check here and not in other call. it makes little sense to add a device to a domain which is dying, but it's just about plausible you might want to remove it (e.g. to unwedge something which has gone wrong). Overall I think being consistent with other similar cases (e.g. PCI) is the way to go.