From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [V1 PATCH 04/11] PVH dom0: create update_memory_mapping() function Date: Thu, 14 Nov 2013 17:59:41 -0800 Message-ID: <20131114175941.31c6f087@mantra.us.oracle.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vh8hK-0003gq-Gf for xen-devel@lists.xenproject.org; Fri, 15 Nov 2013 01:59:50 +0000 In-Reply-To: <5282616D02000078001028A4@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel , keir.xen@gmail.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org 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? 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? thanks Mukesh