From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC 12/19] xen/passthrough: iommu_deassign_device_dt: By default reassign device to nobody Date: Thu, 03 Jul 2014 13:07:41 +0100 Message-ID: <53B5478D.8070107@linaro.org> References: <1402935486-29136-1-git-send-email-julien.grall@linaro.org> <1402935486-29136-13-git-send-email-julien.grall@linaro.org> <1404388132.17859.27.camel@kazak.uk.xensource.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 1X2fno-0004Uv-9W for xen-devel@lists.xenproject.org; Thu, 03 Jul 2014 12:07:48 +0000 Received: by mail-wg0-f46.google.com with SMTP id y10so125586wgg.17 for ; Thu, 03 Jul 2014 05:07:46 -0700 (PDT) In-Reply-To: <1404388132.17859.27.camel@kazak.uk.xensource.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 List-Id: xen-devel@lists.xenproject.org Hi Ian, On 07/03/2014 12:48 PM, Ian Campbell wrote: > On Mon, 2014-06-16 at 17:17 +0100, 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 corrupt or >> expose some part of DOM0 memory. > > "corruption". > > I'd go further and say "and we may have no way to reset some platform > devices". Ok. >> 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). > > Can you describe here what happen in this case (I presume Xen tears down > the iommu to quiesce them somehow?) The SMMU drivers will mark the different Context Bank, S2CR, SMR as invalid. If the device is attempt to access the memory then, we will receive an interrupt in Xen. Actually it's only happen once, if the device is still enabled when the domain is shutdown. Regards, -- Julien Grall