From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esmPl-00018H-F6 for qemu-devel@nongnu.org; Mon, 05 Mar 2018 04:28:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esmPi-0006oE-C6 for qemu-devel@nongnu.org; Mon, 05 Mar 2018 04:28:13 -0500 Received: from mga09.intel.com ([134.134.136.24]:64902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esmPi-0006mG-17 for qemu-devel@nongnu.org; Mon, 05 Mar 2018 04:28:10 -0500 Date: Mon, 5 Mar 2018 17:11:19 +0800 From: "Liu, Yi L" Message-ID: <20180305091119.GH2482@sky-dev> References: <1519900415-30314-1-git-send-email-yi.l.liu@linux.intel.com> <1519900415-30314-12-git-send-email-yi.l.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v3 11/12] intel_iommu: add framework for PASID AddressSpace management 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, kevin.tian@intel.com, yi.l.liu@intel.com, jasowang@redhat.com, peterx@redhat.com, alex.williamson@redhat.com, eric.auger.pro@gmail.com On Fri, Mar 02, 2018 at 04:00:23PM +0100, Paolo Bonzini wrote: > On 01/03/2018 11:33, Liu, Yi L wrote: > > +struct VTDDeviceNode { > > + PCIBus *bus; > > + uint8_t devfn; > > + QLIST_ENTRY(VTDDeviceNode) next; > > +}; > > Do you really need VTDDeviceNode? I think can you simply put the > QLIST_ENTRY in VTDAddressSpace (named e.g. next_by_pasid), since > VTDAddressSpace already includes a (bus, devfn). Existing VTDAddressSpace is actaully per-device. While for PASID tagged address space, it is possible to have multiple devices tied to a single PASID tagged address space. Reuse VTDAddressSpace could be a choice since it is a per-device structure, but it may be missleading since there is other fileds in VTDAddressSpace. This is why I proposed to have VTDDeviceNode. But consolidation is possible here. Thanks, Yi Liu > > +struct VTDPASIDAddressSpace { > > + AddressSpace as; > > + IOMMUSVAContext sva_ctx; > > + IntelIOMMUState *iommu_state; > > + /* list of devices binded to a pasid tagged address space */ > > + QLIST_HEAD(, VTDDeviceNode) device_list; > > +}; > > + > >