From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH ARM v4 10/12] mini-os: get RAM base and size from the FDT Date: Wed, 18 Jun 2014 18:38:08 +0100 Message-ID: <53A1CE80.6090408@linaro.org> References: <1403104106-32538-1-git-send-email-talex5@gmail.com> <1403104106-32538-11-git-send-email-talex5@gmail.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 1WxJoK-0001s3-Rh for xen-devel@lists.xenproject.org; Wed, 18 Jun 2014 17:38:13 +0000 Received: by mail-we0-f171.google.com with SMTP id q58so1232544wes.16 for ; Wed, 18 Jun 2014 10:38:10 -0700 (PDT) In-Reply-To: <1403104106-32538-11-git-send-email-talex5@gmail.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: Thomas Leonard , xen-devel@lists.xenproject.org Cc: samuel.thibault@ens-lyon.org, stefano.stabellini@eu.citrix.com, Dave.Scott@eu.citrix.com, anil@recoil.org List-Id: xen-devel@lists.xenproject.org Hi Thomas, On 06/18/2014 04:08 PM, Thomas Leonard wrote: > + const char *device_type = fdt_getprop(device_tree, node, "device_type", NULL); > + if (device_type && !strcmp(device_type, "memory")) > + { > + /* Note: we assume there's only a single region of memory. > + * Since Xen is already translating our "physical" > + * addresses to the real physical RAM, there's no > + * reason for it to give us multiple blocks. */ This comment looks wrong to me. Even tho, Xen is providing a stage-2 translation to show you a virtual layout (your guest physical memory), the new layout in Xen upstream may contain multiple banks. The first bank will contain up to 3G of RAM. > index d2d5264..d31ef97 100644 > --- a/extras/mini-os/mm.c > +++ b/extras/mini-os/mm.c > @@ -409,8 +409,8 @@ void init_mm(void) > * now we can initialise the page allocator > */ > printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n", > - (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), > - (u_long)to_virt(PFN_PHYS(max_pfn)), PFN_PHYS(max_pfn)); > + (u_long)to_virt(PFN_PHYS(start_pfn)), (u_long)PFN_PHYS(start_pfn), > + (u_long)to_virt(PFN_PHYS(max_pfn)), (u_long)PFN_PHYS(max_pfn)); I don't see any modification of the type of max_pfn, start_pfn, PFN_PHYS. This change should not be part of this patch. Regards, -- Julien Grall