From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esmrO-0000yE-Kh for qemu-devel@nongnu.org; Mon, 05 Mar 2018 04:56:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esmrJ-0005Xw-4k for qemu-devel@nongnu.org; Mon, 05 Mar 2018 04:56:46 -0500 Received: from mga14.intel.com ([192.55.52.115]:54764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esmrI-0005XH-R0 for qemu-devel@nongnu.org; Mon, 05 Mar 2018 04:56:41 -0500 Date: Mon, 5 Mar 2018 17:39:49 +0800 From: "Liu, Yi L" Message-ID: <20180305093949.GJ2482@sky-dev> References: <1519900415-30314-1-git-send-email-yi.l.liu@linux.intel.com> <1519900415-30314-10-git-send-email-yi.l.liu@linux.intel.com> <866c7e97-26c7-334c-634b-ecf10c8e0efb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <866c7e97-26c7-334c-634b-ecf10c8e0efb@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 09/12] intel_iommu: record assigned devices in a list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com, david@gibson.dropbear.id.au, alex.williamson@redhat.com, eric.auger.pro@gmail.com, yi.l.liu@intel.com, peterx@redhat.com, kevin.tian@intel.com, jasowang@redhat.com On Fri, Mar 02, 2018 at 04:08:47PM +0100, Paolo Bonzini wrote: > On 01/03/2018 11:33, Liu, Yi L wrote: > > > > +struct IntelIOMMUAssignedDeviceNode { > > + VTDAddressSpace *vtd_as; > > + QLIST_ENTRY(IntelIOMMUAssignedDeviceNode) next; > > +}; > > + > > This QLIST_ENTRY can also be placed directly in VTDAddressSpace (e.g. > next_assigned_dev), so that the notify function can simply do a > QLIST_REMOVE when an assigned device is hot-unplugged. Thanks for this idea, would try to do consolidation together with another comments from you. > Does the notify_func need an "unbind from PASID address space" step, > that does the opposite of vtd_bind_device_to_pasid_as? yes, it is possible that a device is un-tied from a PASID tagged address space. And this should be emulated in Qemu. Thanks for the remind. Regards, Yi Liu