Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2999731AbdD1WlD (ORCPT ); Fri, 28 Apr 2017 18:41:03 -0400 Received: from 8bytes.org ([81.169.241.247]:39748 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1035275AbdD1Wkz (ORCPT ); Fri, 28 Apr 2017 18:40:55 -0400 Date: Sat, 29 Apr 2017 00:40:53 +0200 From: Joerg Roedel To: Gerald Schaefer Cc: Sebastian Ott , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/2] iommu/s390: Fix iommu-groups and add sysfs support Message-ID: <20170428224053.GJ1332@8bytes.org> References: <1493306905-32334-1-git-send-email-joro@8bytes.org> <20170427201018.70c8be5a@thinkpad> <20170427210325.GE1332@8bytes.org> <20170428144634.7950c8cf@thinkpad> <20170428145513.GH1332@8bytes.org> <20170428200612.42b4f3d2@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170428200612.42b4f3d2@thinkpad> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1348 Lines: 32 Hi Gerald, On Fri, Apr 28, 2017 at 08:06:12PM +0200, Gerald Schaefer wrote: > On Fri, 28 Apr 2017 16:55:13 +0200 > Joerg Roedel wrote: > Also, IIRC, add_device will get called before attach_dev. Currently we > allow to attach more than one device (apparently from different buses) to > one domain (one shared DMA table) in attach_dev. But then it would be too > late to also add all devices to the same iommu-group. That would have had > to be done earlier in add_device, but there we don't know yet if a shared > DMA table would be set up later in attach_dev. I think there is some misunderstanding here about what iommu-groups are. An iommu-group is a group of devices that are not isolated from each other wrt. DMA and/or IRQs. This means that the devices can influence each other, e.g. directly DMA to each other without IOMMU control. So the grouping relies on how the hardware is built. Domains on the other side are a software controled concept. A domain is basically an abstraction of a DMA address space. Multiple devices can share on domain/address-space, just as multiple threads can share a cpu address space. The point of iommu-grouping is to make sure that we don't assign different domains to devices in the same group, as that could break or cause security issues without proper isolation. Regards, Joerg