From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 8bytes.org ([2a01:238:4383:600:38bc:a715:4b6d:a889] helo=theia.8bytes.org) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAgm4-0006Mz-8J for kexec@lists.infradead.org; Mon, 12 Jan 2015 15:19:25 +0000 Date: Mon, 12 Jan 2015 16:18:55 +0100 From: Joerg Roedel Subject: Re: [PATCH v8 01/10] iommu/vt-d: Update iommu_attach_domain() and its callers Message-ID: <20150112151855.GB6343@8bytes.org> References: <1421046388-27925-1-git-send-email-zhen-hual@hp.com> <1421046388-27925-2-git-send-email-zhen-hual@hp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1421046388-27925-2-git-send-email-zhen-hual@hp.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: "Li, Zhen-Hua" Cc: alex.williamson@redhat.com, indou.takao@jp.fujitsu.com, bhe@redhat.com, tom.vaden@hp.com, rwright@hp.com, dwmw2@infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, lisa.mitchell@hp.com, jerry.hoemann@hp.com, iommu@lists.linux-foundation.org, ddutile@redhat.com, doug.hatch@hp.com, ishii.hironobu@jp.fujitsu.com, linux-pci@vger.kernel.org, bhelgaas@google.com, billsumnerlinux@gmail.com, li.zhang6@hp.com, dyoung@redhat.com, vgoyal@redhat.com On Mon, Jan 12, 2015 at 03:06:19PM +0800, Li, Zhen-Hua wrote: > Allow specification of the domain-id for the new domain. > This patch only adds the 'did' parameter to iommu_attach_domain() > and modifies all of its callers to specify the default value of -1 > which says "no did specified, allocate a new one". I think its better to keep the old iommu_attach_domain() interface in place and introduce a new function (like iommu_attach_domain_with_id() or something) which has the additional parameter. Then you can rewrite iommu_attach_domain(): iommu_attach_domai(...) { return iommu_attach_domain_with_id(..., -1); } This way you don't have to update all the callers of iommu_attach_domain() and the interface is more readable. Joerg _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH v8 01/10] iommu/vt-d: Update iommu_attach_domain() and its callers Date: Mon, 12 Jan 2015 16:18:55 +0100 Message-ID: <20150112151855.GB6343@8bytes.org> References: <1421046388-27925-1-git-send-email-zhen-hual@hp.com> <1421046388-27925-2-git-send-email-zhen-hual@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1421046388-27925-2-git-send-email-zhen-hual-VXdhtT5mjnY@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: "Li, Zhen-Hua" Cc: bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tom.vaden-VXdhtT5mjnY@public.gmane.org, rwright-VXdhtT5mjnY@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lisa.mitchell-VXdhtT5mjnY@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, doug.hatch-VXdhtT5mjnY@public.gmane.org, ishii.hironobu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, billsumnerlinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, li.zhang6-VXdhtT5mjnY@public.gmane.org, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Mon, Jan 12, 2015 at 03:06:19PM +0800, Li, Zhen-Hua wrote: > Allow specification of the domain-id for the new domain. > This patch only adds the 'did' parameter to iommu_attach_domain() > and modifies all of its callers to specify the default value of -1 > which says "no did specified, allocate a new one". I think its better to keep the old iommu_attach_domain() interface in place and introduce a new function (like iommu_attach_domain_with_id() or something) which has the additional parameter. Then you can rewrite iommu_attach_domain(): iommu_attach_domai(...) { return iommu_attach_domain_with_id(..., -1); } This way you don't have to update all the callers of iommu_attach_domain() and the interface is more readable. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 8bytes.org ([81.169.241.247]:45815 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753031AbbALPS5 (ORCPT ); Mon, 12 Jan 2015 10:18:57 -0500 Date: Mon, 12 Jan 2015 16:18:55 +0100 From: Joerg Roedel To: "Li, Zhen-Hua" Cc: dwmw2@infradead.org, indou.takao@jp.fujitsu.com, bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kexec@lists.infradead.org, alex.williamson@redhat.com, ddutile@redhat.com, ishii.hironobu@jp.fujitsu.com, bhelgaas@google.com, doug.hatch@hp.com, jerry.hoemann@hp.com, tom.vaden@hp.com, li.zhang6@hp.com, lisa.mitchell@hp.com, billsumnerlinux@gmail.com, rwright@hp.com Subject: Re: [PATCH v8 01/10] iommu/vt-d: Update iommu_attach_domain() and its callers Message-ID: <20150112151855.GB6343@8bytes.org> References: <1421046388-27925-1-git-send-email-zhen-hual@hp.com> <1421046388-27925-2-git-send-email-zhen-hual@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1421046388-27925-2-git-send-email-zhen-hual@hp.com> Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Jan 12, 2015 at 03:06:19PM +0800, Li, Zhen-Hua wrote: > Allow specification of the domain-id for the new domain. > This patch only adds the 'did' parameter to iommu_attach_domain() > and modifies all of its callers to specify the default value of -1 > which says "no did specified, allocate a new one". I think its better to keep the old iommu_attach_domain() interface in place and introduce a new function (like iommu_attach_domain_with_id() or something) which has the additional parameter. Then you can rewrite iommu_attach_domain(): iommu_attach_domai(...) { return iommu_attach_domain_with_id(..., -1); } This way you don't have to update all the callers of iommu_attach_domain() and the interface is more readable. Joerg