From: Tim Deegan Subject: Re: [v3][PATCH 03/16] xen/vtd: create RMRR mapping Date: Thu, 18 Jun 2015 11:07:33 +0100 Message-ID: <20150618100733.GB27209@deinos.phlegethon.org> References: <1433985325-16676-1-git-send-email-tiejun.chen@intel.com> <1433985325-16676-4-git-send-email-tiejun.chen@intel.com> <5579558C.30709@intel.com> <20150611140729.GC1734@deinos.phlegethon.org> <557A4745.1030608@intel.com> <557A74EE.5090805@intel.com> <557A7887.3030104@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <557A7887.3030104@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Chen, Tiejun" Cc: "Tian, Kevin" , "wei.liu2@citrix.com" , "ian.campbell@citrix.com" , "andrew.cooper3@citrix.com" , "Ian.Jackson@eu.citrix.com" , "xen-devel@lists.xen.org" , "stefano.stabellini@citrix.com" , "jbeulich@suse.com" , "Zhang, Yang Z" List-Id: xen-devel@lists.xenproject.org At 14:13 +0800 on 12 Jun (1434118407), Chen, Tiejun wrote: > > could you explain why existing guest_physmap_remove_page can't > > serve the purpose so you need invent a new identity mapping > > specific one? For unmapping suppose it should be common regardless > > of whether it's identity-mapped or not. :-) > > I have some concerns here: > > #1. guest_physmap_remove_page() is a void function without a returning > value, so you still need a little change. I'd be happy with adding a return value to it -- even if other callers don't check it yet it's better to have errors ignored by callers than ignored inside the function. :) > #2. guest_physmap_remove_page() doesn't make readable in such a code > context; > > rmrr_identity_mapping() > { > ... > guest_physmap_remove_page() > ... > } I think it's fine there. In general I'd prefer to avoid the code duplication of another helper function if we can. Cheers, Tim.