From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [PATCH 00/16 v2] iommu: Move domain allocation into drivers Date: Fri, 27 Mar 2015 22:24:22 -0600 Message-ID: <1427516662.3643.906.camel@redhat.com> References: <1427373799-18662-1-git-send-email-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427373799-18662-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@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: Joerg Roedel Cc: Alexandre Courbot , linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner , Arnd Bergmann , Stephen Warren , Will Deacon , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Kukjin Kim , Thierry Reding , jroedel-l3A5Bk7waGM@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Yingjoe Chen , David Woodhouse , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Thu, 2015-03-26 at 13:43 +0100, Joerg Roedel wrote: > Changes v1-v2: > > * Rebased to v4.0-rc5 > * Converted domain-types to a bit-field > > Hi, > > here is patch-set to replace the existing domain_init and > domain_destroy iommu-ops with the new domain_alloc and > domain_free callbacks > > The new callbacks move the allocation of iommu domains into > the iommu driver, allowing them to put a generic > iommu_domain struct into their own domain struct. This makes > domain handling in the drivers more cache efficient and > prepares the introduction of default domains in another > patch-set. > > While at it, this patch-set also introduces domain types. > These are internal to the iommu core code for now, there are > three of them: > > * DMA-API domains > * Identity mapped domains > * Domains unmanaged by the iommu-core, used for > iommu-api so that the users can create their own > mappings > > The patches have been compile tested for x86, ARM and PPC > and runtime tested on x86 (Intel VT-d and AMD IOMMU). > > Please review. For 1-5,16 Reviewed-by: Alex Williamson My only comment/question is whether you'd want to consider using ERR_PTR() return values from domain_alloc(). It's an alloc functions, so NULL == -ENOMEM is pretty standard, but we could at least have the interface to the iommu driver return more info even if we continue to mask that as NULL out to the IOMMU API users for now. Thanks, Alex From mboxrd@z Thu Jan 1 00:00:00 1970 From: alex.williamson@redhat.com (Alex Williamson) Date: Fri, 27 Mar 2015 22:24:22 -0600 Subject: [PATCH 00/16 v2] iommu: Move domain allocation into drivers In-Reply-To: <1427373799-18662-1-git-send-email-joro@8bytes.org> References: <1427373799-18662-1-git-send-email-joro@8bytes.org> Message-ID: <1427516662.3643.906.camel@redhat.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, 2015-03-26 at 13:43 +0100, Joerg Roedel wrote: > Changes v1-v2: > > * Rebased to v4.0-rc5 > * Converted domain-types to a bit-field > > Hi, > > here is patch-set to replace the existing domain_init and > domain_destroy iommu-ops with the new domain_alloc and > domain_free callbacks > > The new callbacks move the allocation of iommu domains into > the iommu driver, allowing them to put a generic > iommu_domain struct into their own domain struct. This makes > domain handling in the drivers more cache efficient and > prepares the introduction of default domains in another > patch-set. > > While at it, this patch-set also introduces domain types. > These are internal to the iommu core code for now, there are > three of them: > > * DMA-API domains > * Identity mapped domains > * Domains unmanaged by the iommu-core, used for > iommu-api so that the users can create their own > mappings > > The patches have been compile tested for x86, ARM and PPC > and runtime tested on x86 (Intel VT-d and AMD IOMMU). > > Please review. For 1-5,16 Reviewed-by: Alex Williamson My only comment/question is whether you'd want to consider using ERR_PTR() return values from domain_alloc(). It's an alloc functions, so NULL == -ENOMEM is pretty standard, but we could at least have the interface to the iommu driver return more info even if we continue to mask that as NULL out to the IOMMU API users for now. Thanks, Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751697AbbC1EZ3 (ORCPT ); Sat, 28 Mar 2015 00:25:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33171 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbbC1EZ0 (ORCPT ); Sat, 28 Mar 2015 00:25:26 -0400 Message-ID: <1427516662.3643.906.camel@redhat.com> Subject: Re: [PATCH 00/16 v2] iommu: Move domain allocation into drivers From: Alex Williamson To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, Will Deacon , Kukjin Kim , David Woodhouse , Heiko Stuebner , Hiroshi Doyu , Stephen Warren , Thierry Reding , Alexandre Courbot , Arnd Bergmann , Yingjoe Chen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, jroedel@suse.de Date: Fri, 27 Mar 2015 22:24:22 -0600 In-Reply-To: <1427373799-18662-1-git-send-email-joro@8bytes.org> References: <1427373799-18662-1-git-send-email-joro@8bytes.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-03-26 at 13:43 +0100, Joerg Roedel wrote: > Changes v1-v2: > > * Rebased to v4.0-rc5 > * Converted domain-types to a bit-field > > Hi, > > here is patch-set to replace the existing domain_init and > domain_destroy iommu-ops with the new domain_alloc and > domain_free callbacks > > The new callbacks move the allocation of iommu domains into > the iommu driver, allowing them to put a generic > iommu_domain struct into their own domain struct. This makes > domain handling in the drivers more cache efficient and > prepares the introduction of default domains in another > patch-set. > > While at it, this patch-set also introduces domain types. > These are internal to the iommu core code for now, there are > three of them: > > * DMA-API domains > * Identity mapped domains > * Domains unmanaged by the iommu-core, used for > iommu-api so that the users can create their own > mappings > > The patches have been compile tested for x86, ARM and PPC > and runtime tested on x86 (Intel VT-d and AMD IOMMU). > > Please review. For 1-5,16 Reviewed-by: Alex Williamson My only comment/question is whether you'd want to consider using ERR_PTR() return values from domain_alloc(). It's an alloc functions, so NULL == -ENOMEM is pretty standard, but we could at least have the interface to the iommu driver return more info even if we continue to mask that as NULL out to the IOMMU API users for now. Thanks, Alex