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 12:24:39 +0100 Message-ID: <1427801079.2115.84.camel@citrix.com> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> <1426793399-6283-27-git-send-email-julien.grall@linaro.org> 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 1YcuHm-0001fW-8r for xen-devel@lists.xenproject.org; Tue, 31 Mar 2015 11:24:46 +0000 In-Reply-To: <1426793399-6283-27-git-send-email-julien.grall@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 Thu, 2015-03-19 at 19:29 +0000, Julien Grall wrote: > +int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d, > + XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) > +{ > + int ret; > + struct dt_device_node *dev; > + > + /* TODO: How to deal with XSM? */ Looks like you do in the following code? Old comment? > + /* 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. > diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h > index 7f90150..a7cb272 100644 > --- a/xen/include/public/domctl.h > +++ b/xen/include/public/domctl.h > @@ -475,12 +475,30 @@ typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t; > DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t); > > > -/* Assign PCI device to HVM guest. Sets up IOMMU structures. */ > +/* Assign a device to a guest. Sets up IOMMU structures. */ > /* XEN_DOMCTL_assign_device */ > /* XEN_DOMCTL_test_assign_device */ > -/* XEN_DOMCTL_deassign_device */ > +/* > + * XEN_DOMCTL_deassign_device: The behavior of this DOMCTL differs > + * between the different type of device: > + * - PCI device (XEN_DOMCTL_DEV_PCI) will be reassigned to DOM0 > + * - non-PCI device (XEN_DOMCTL_DEV_PCI) will left unassigned. DOM0 Did you miss a ! before XEN_DOMCTL, or did you mean to say DT? >>From an ease of review PoV it would have been nice to add dev and u.pci first since that would be mechanical, but nevermind now. Ian.