From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 18/24] xen/passthrough: iommu_deassign_device_dt: By default reassign device to nobody Date: Thu, 19 Mar 2015 15:07:56 +0000 Message-ID: <550AE64C.6080408@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-19-git-send-email-julien.grall@linaro.org> <1424451889.30924.363.camel@citrix.com> <54EAFCA5.2050905@linaro.org> <1424705695.27930.168.camel@citrix.com> <54FF0DDA.2040203@linaro.org> <1426077341.21353.235.camel@citrix.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 1YYc3f-0001zi-I3 for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 15:08:27 +0000 Received: by wgbcc7 with SMTP id cc7so65010749wgb.0 for ; Thu, 19 Mar 2015 08:08:24 -0700 (PDT) In-Reply-To: <1426077341.21353.235.camel@citrix.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, tim@xen.org, Jan Beulich List-Id: xen-devel@lists.xenproject.org On 11/03/15 12:35, Ian Campbell wrote: > On Tue, 2015-03-10 at 15:29 +0000, Julien Grall wrote: >> Hi, >> >> On 23/02/15 15:34, Ian Campbell wrote: >>> On Mon, 2015-02-23 at 10:10 +0000, Julien Grall wrote: >>>> >>>> On 20/02/2015 17:04, Ian Campbell wrote: >>>>> On Tue, 2015-01-13 at 14:25 +0000, Julien Grall wrote: >>>>>> Currently, when the device is deassigned from a domain, we directly reassign >>>>>> to DOM0. >>>>>> >>>>>> As the device may not have been correctly reset, this may lead to corruption or >>>>>> expose some part of DOM0 memory. Also, we may have no way to reset some >>>>>> platform devices. >>>>>> >>>>>> If Xen reassigns the device to "nobody", it may receive some global/context >>>>>> fault because the transaction has failed (indeed the context has been >>>>>> marked invalid). Unfortunately there is no simple way to quiesce a buggy >>>>>> hardware. I think we could live with that for a first version of platform >>>>>> device passthrough. >>>>>> >>>>>> DOM0 will have to issue an hypercall to assign the device to itself if it >>>>>> wants to use it. >>>>> >>>>> Does this behaviour differ from x86? >>> >>> I realise now that x86 is a red-herring, what I really meant was differ >>> from other types of device (specifically PCI ones). >>> >>>> If so then it is worth calling that >>>>> out explicitly (even if not, good to know I think!) >>>> >>>> What do you mean by "calling that out explicitly"? >>> >>> Stating in the commit log or a suitably placed comment (at least under >>> xen/include/public hopefully) that deassignment of dt devices behaves >>> differently to deassignment of other types of devices. >> >> I tried to search any documentation explaining the behavior of those >> DOMCTL for PCI (mostly the deassign one) but I didn't find any. >> >> By any chance, do you know if there is one? If so where? > > If you didn't find it in the obvious places under xen/include/public > then it probably doesn't exist. Ok. I will add a comment in the patch extending XEN_DOMCTL_assign_device. Regards, -- Julien Grall