From: "Jan Beulich" Subject: Re: [V1 PATCH 04/11] PVH dom0: create update_memory_mapping() function Date: Fri, 15 Nov 2013 07:38:06 +0000 Message-ID: <5285DD6E02000078001035DE@nat28.tlf.novell.com> References: <1383960215-22444-1-git-send-email-mukesh.rathor@oracle.com> <1383960215-22444-5-git-send-email-mukesh.rathor@oracle.com> <5282616D02000078001028A4@nat28.tlf.novell.com> <20131114175941.31c6f087@mantra.us.oracle.com> 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 1VhDyk-0002v7-LT for xen-devel@lists.xenproject.org; Fri, 15 Nov 2013 07:38:10 +0000 In-Reply-To: <20131114175941.31c6f087@mantra.us.oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: xen-devel , keir.xen@gmail.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 15.11.13 at 02:59, Mukesh Rathor wrote: > On Tue, 12 Nov 2013 16:12:13 +0000 > "Jan Beulich" wrote: > >> >>> On 09.11.13 at 02:23, Mukesh Rathor >> >>> wrote: >> > Note, iomem_access_permitted can't be moved to the function >> > because current doesn't point to dom0 in construct_dom0. >> >> And it would be rather pointless to try to check this. For Dom0 you >> just need to make sure you don't call the function for inappropriate >> ranges. >> >> > +static long update_memory_mapping(struct domain *d, unsigned long >> > gfn, >> >> Is there any code path really returning something that doesn't >> fit in an int? > > Well, the caller arch_do_domctl() returns long and has it declared > long too. Want me to change it to int and it will implicitly get cast'd? Yes. > long arch_do_domctl( > struct xen_domctl *domctl, struct domain *d, > XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) > { > long ret = 0; > >>> + unsigned long mfn, unsigned long nr_mfns, >>> + bool_t add) >>> +{ >>> + unsigned long i; >>> + long ret; > >>Same question here. > > Original code has loop count as ulong, prob because nr_mfns is long. > > case XEN_DOMCTL_memory_mapping: > { > unsigned long gfn = domctl->u.memory_mapping.first_gfn; > .. > unsigned long i; > > Want me to change it to int also? The remark was about "ret", not "i" or some other count. Jan