From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932466AbcBANMS (ORCPT ); Mon, 1 Feb 2016 08:12:18 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:30794 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932207AbcBANDN (ORCPT ); Mon, 1 Feb 2016 08:03:13 -0500 X-IronPort-AV: E=Sophos;i="5.22,380,1449532800"; d="scan'208";a="335259676" Subject: Re: [PATCH] Xen/PCI: correct notifier used for device removal To: Jan Beulich References: <56AF566002000078000CCE71@prv-mh.provo.novell.com> <56AF4911.8030208@citrix.com> <56AF5AAB02000078000CCED7@prv-mh.provo.novell.com> CC: xen-devel , Boris Ostrovsky , Konrad Rzeszutek Wilk , From: David Vrabel Message-ID: <56AF578D.6000004@citrix.com> Date: Mon, 1 Feb 2016 13:03:09 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <56AF5AAB02000078000CCED7@prv-mh.provo.novell.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/02/16 12:16, Jan Beulich wrote: >>>> On 01.02.16 at 13:01, wrote: >> On 01/02/16 11:58, Jan Beulich wrote: >>> Commit 599bad38cf added BUS_NOTIFY_REMOVED_DEVICE in order to allow >>> avoiding removal of IOMMU mappings before the driver actually got >>> unbound from the device. Naturally we should be using this too. >> >> Because otherwise...? What happens if we don't make this change? >> >> Removing IOMMU mappings for a device when the driver is still bound to >> the device looks wrong to me. Surely the device is still active and may >> still be performing DMA at this point? > > Exactly - you answered your own question (as does the commit > referred to). I misread, sorry. I think I will reword this as: "Commit 599bad38cf added BUS_NOTIFY_REMOVED_DEVICE to defer the removal of IOMMU mappings until the driver has been unbound from the device (i.e., until it is guaranteed that there are no outstanding DMA transactions). Naturally we should be using this too." David