From mboxrd@z Thu Jan 1 00:00:00 1970 From: "joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org" Subject: Re: [RFC PATCH 0/6] Auxiliary IOMMU domains and Arm SMMUv3 Date: Mon, 12 Nov 2018 15:55:41 +0100 Message-ID: <20181112145541.GB25808@8bytes.org> References: <20181019181158.2395-1-jean-philippe.brucker@arm.com> <11f88122-afd3-a34c-3cd4-db681bf5498b@arm.com> <20181106162539.4gmkvg57mja3bn7k@8bytes.org> <42949d93-e22c-dd4d-cd49-46efc0b73cdb@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <42949d93-e22c-dd4d-cd49-46efc0b73cdb-5wv7dgnIgG8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Jean-Philippe Brucker Cc: "Tian, Kevin" , "rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org" , "will.deacon-5wv7dgnIgG8@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Robin Murphy , "christian.koenig-5C7GfCeVMHo@public.gmane.org" List-Id: iommu@lists.linux-foundation.org Hi Jean-Philippe, On Thu, Nov 08, 2018 at 06:29:42PM +0000, Jean-Philippe Brucker wrote: > (1) My initial approach would have been to use the same page tables for > the default_domain and this new domain, but it might be precisely what > you were trying to avoid with this new proposal: a device attached to > two domains at the same time. My request was about the initial assumptions a device driver can make about a device. This assumptions is that DMA-API is set up and initialized for it, for everything else (like SVA) the device driver needs to take special action, like allocating an SVA domain and attaching the device to it. This should of course not break any IRQ setups for the device, and also enforcing an ordering is not a good and maintainable solution. So what you could do here is to either: 1) Save the needed IRQ mappings in some extra datastructure and duplicate it in the SVA domain. This also makes it easier to use the same SVA domain with multiple devices. 2) Just re-use the 'page-tables' from the default domain in the sva-domain. This needs to happen at attach-time, because at allocation time you don't know the device yet. I think 1) is the best solution, what do you think? Btw, things would be different if we could expose SVA through the DMA-API to drivers. In this case we could just make the default domain of type SVA and be done, but we are not there yet. Regards, Joerg