From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 12/12] xen/iommu: smmu: Add Xen specific code to be able to use the driver Date: Tue, 27 Jan 2015 17:05:41 +0000 Message-ID: <54C7C565.5030308@linaro.org> References: <1421418247-30068-1-git-send-email-julien.grall@linaro.org> <1421418247-30068-13-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YG9af-00054e-61 for xen-devel@lists.xenproject.org; Tue, 27 Jan 2015 17:06:13 +0000 Received: by mail-we0-f169.google.com with SMTP id u56so16132692wes.0 for ; Tue, 27 Jan 2015 09:06:09 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 27/01/15 16:46, Stefano Stabellini wrote: > On Fri, 16 Jan 2015, Julien Grall wrote: >> The main goal is to modify as little the Linux code to be able to port >> easily new feature added in Linux repo for the driver. > > Agreed. > > >> To achieve that we: >> - Add helpers to Linux function not implemented on Xen > > Good idea, I would take it further and move the helpers to a separate > file that smmu.c #includes. Or it could work the other way around: you > could move the original code to smmu-linux.c that get #included into > smmu.c We would have to modify smmu-linux.c for disabling some functions and/or modify them. Although for the later, there is only a couple functions modified. > >> - Add callbacks used by Xen to do our own stuff and call Linux ones >> - Only modify when required the code which comes from Linux. If so a >> comment has been added with /* Xen: ... */ explaining why it's >> necessary. > > I wonder if it makes sense to keep your changes in patch format and > apply the patch at run time as part of the make system. > > Of course you would need to be careful to keep the patched smmu.c > separate from the original, otherwise it would get very confusing when > people works on their changes. IHMO, it makes more difficult to review and work with it. Although it may be easier for porting change from Linux in the future. Regards, -- Julien Grall