From: Tim Deegan Subject: Re: [PATCH v2 4/4] libxc/arm: allocate xenstore and console pages Date: Thu, 12 Jul 2012 12:46:26 +0100 Message-ID: <20120712114626.GD89265@ocelot.phlegethon.org> References: <1341399349-31247-4-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1341399349-31247-4-git-send-email-stefano.stabellini@eu.citrix.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: Stefano Stabellini Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org At 11:55 +0100 on 04 Jul (1341402949), Stefano Stabellini wrote: > static int alloc_magic_pages(struct xc_dom_image *dom) > { > + int rc, i, allocsz; > + xen_pfn_t store_pfn, console_pfn, p2m[NR_MAGIC_PAGES]; > + > DOMPRINTF_CALLED(dom->xch); > - /* XXX > - * dom->p2m_guest > - * dom->start_info_pfn > - * dom->xenstore_pfn > - * dom->console_pfn > - */ > + > + for (i = 0; i < NR_MAGIC_PAGES; i++) > + p2m[i] = dom->rambase_pfn + dom->total_pages + i; > + > + for ( i = rc = allocsz = 0; > + (i < NR_MAGIC_PAGES) && !rc; > + i += allocsz) { > + allocsz = NR_MAGIC_PAGES - i; > + rc = xc_domain_populate_physmap_exact( > + dom->xch, dom->guest_domid, allocsz, > + 0, 0, &p2m[i]); > + } What does this loop do? It seems like it can only ever execute once. Cheers, Tim.