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. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel