Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753508AbdHKSre (ORCPT ); Fri, 11 Aug 2017 14:47:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:41858 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752883AbdHKSrd (ORCPT ); Fri, 11 Aug 2017 14:47:33 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,359,1498546800"; d="scan'208";a="122652940" Subject: Re: [PATCH 3/3] iommu: prevent VMD child devices from being remapping targets To: Robin Murphy , linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org, Keith Busch , Bjorn Helgaas , David Fugate , David Woodhouse , Scott Bauer References: <20170807195713.10963-1-jonathan.derrick@intel.com> <20170807195713.10963-3-jonathan.derrick@intel.com> From: Jon Derrick Message-ID: Date: Wed, 9 Aug 2017 11:13:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1128 Lines: 21 Hi Robin, thanks for the reply. On 08/11/2017 12:25 PM, Robin Murphy wrote: > On 07/08/17 20:57, Jon Derrick wrote: >> VMD child devices must use the VMD endpoint's ID as the DMA source. >> Because of this, there needs to be a way to link the parent VMD >> endpoint's DMAR domain to the VMD child devices' DMAR domain such that >> attaching and detaching child devices modify the endpoint's DMAR mapping >> and prevents early detaching. > > That sounds like either pci_device_group() needs modifying, or perhaps > that intel-iommu needs its own extended iommu_ops::device_group > implementation, to ensure that VMD child devices get put in the same > group as their parent - if they share requester IDs they can't feasibly > be attached to different domains anyway. > > Robin. Yes it seems like that to me too. I have a high-level understanding of the changes required but not too much in the nitty-gritty details. It's a bit more complicated anyways because VMD emerges a set of root ports, and AFAICT, PCI ACS end at the root ports and iommu groups rely on ACS to group devices. Either way it's not within the scope of VMD.