From: Wei Liu Subject: Re: [PATCH v3 1/9] libxc: reorganize domain builder guest memory allocator Date: Wed, 28 Oct 2015 16:21:47 +0000 Message-ID: <20151028162147.GA8097@zion.uk.xensource.com> References: <1444741878-16610-1-git-send-email-jgross@suse.com> <1444741878-16610-2-git-send-email-jgross@suse.com> <20151028153256.GF18674@zion.uk.xensource.com> <5630EEE9.2000902@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5630EEE9.2000902@suse.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: Juergen Gross Cc: Wei Liu , Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, roger.pau@citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, Oct 28, 2015 at 04:51:05PM +0100, Juergen Gross wrote: [...] > >>+static int xc_dom_alloc_pad(struct xc_dom_image *dom, xen_vaddr_t end) > >>+{ > >>+ unsigned int page_size = XC_DOM_PAGE_SIZE(dom); > >>+ xen_pfn_t pages; > >>+ > >>+ if ( end & (page_size - 1) ) > >> { > >> xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, > >> "%s: segment start isn't page aligned (0x%" PRIx64 ")", > > > >"segment end"? > > No. This function is called to add a padding allocation before the start > of a new segment, which has to start at page boundary. Maybe a comment > should clarify this. :-) > Heh, I worked out this function was used to add padding segment but was confused by the dissonance. A simpler solution might be just change "end" to "start"? I think it is sensible because it is the start of the padding. In any case, it's up to you. :-) Wei.