[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [PATCH v3 28/43] arm64: init the memory system



On Thu, Apr 26, 2018 at 02:19:52PM +0100, Julien Grall wrote:
> 
> 
> On 16/04/18 07:32, Huang Shijie wrote:
> >+void arch_mm_preinit(void *dtb_pointer)
> >+{
> >+    paddr_t **dtb_p = dtb_pointer;
> >+    paddr_t *dtb = *dtb_p;
> >+    uintptr_t end = (uintptr_t) &_end;
> >+
> >+    dtb = to_virt(((paddr_t)dtb));
> >+    first_free_pfn = PFN_UP(to_phys(end));
> >+    min_mem_pfn = PFN_UP(to_phys(_text) + MIN_MEM_SIZE);
> >+
> >+    /*
> >+     * Setup the mapping for Device Tree, only map 2M(L2_SIZE) size.
> >+     *
> >+     * Note: The early_alloc_page() will increase @first_free_pfn.
> >+     */
> >+    build_pagetable((unsigned long)dtb, virt_to_pfn((unsigned long)dtb),
> >+                    PHYS_PFN(L2_SIZE), MEM_DEF_ATTR, early_alloc_page, 2);
> 
> I forgot to comment on this. You can't assume the DTB will be 2MB aligned
Is there any document about this?
I thought the DTB is 2M aligned.
> and the interface of build_pagetable is somewhat quite confusing to use. So
> are you going to map 2 2MB section? Or only one?
What's the "section" mean? do you mean one PMD entry.

The code only maps one PMD entry.

thanks
Huang Shijie


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.