[haiku-bugs] Re: [Haiku] #11896: ARM: arch_mmu assumes RAM starts at 80000000

  • From: "kallisti5" <trac@xxxxxxxxxxxx>
  • Date: Thu, 12 Mar 2015 12:13:17 -0000

#11896: ARM: arch_mmu assumes RAM starts at 80000000
------------------------------+--------------------------------------------
   Reporter:  kallisti5       |      Owner:  pdziepak
       Type:  bug             |     Status:  new
   Priority:  normal          |  Milestone:  Unscheduled
  Component:  System/Boot     |    Version:  R1/Development
  Loader                      |   Keywords:  ARM MMU pfoetchen mmu_man rpi2
 Resolution:                  |   Blocking:
 Blocked By:                  |   Platform:  arm
Has a Patch:  0               |
------------------------------+--------------------------------------------

Comment (by kallisti5):

 Actually, looking at mmu_man's comments... this makes sense.

 dynamic allocation is at the PageTableRegionEnd...

 {{{
     // allocate page directory in memory after loader
     sPageDirectory = (uint32 *)ROUNDUP((addr_t)&_end, 0x100000);
     sNextPageTableAddress = (addr_t)sPageDirectory +
 ARM_MMU_L1_TABLE_SIZE;
     sPageTableRegionEnd = (addr_t)sPageDirectory + 0x200000;

     // Mark start for dynamic allocation
     sNextPhysicalAddress =
     sNextVirtualAddress = sPageTableRegionEnd;
 }}}

 So:

 * loader 80000 - d0000
   * insert_physical_allocated_range
 * pageDirectory 100000 - 300000
   * insert_physical_allocated_range
 * dynamicAllocation 300000+

 * init_page_directory();
   * mmu_map_identity loader 80000 - d0000
   * mmu_map_identity pageDirectory 100000 - 300000

 This all means the first map_page request for a dynamic range coming in
 fails..
 {{{
 mmu_allocate: requested vaddr: 0x00000000, next free vaddr: 0x300000,
 size: 16384
 map_page: vaddr 0x300000, paddr 0x300000
 *** PANIC ***
 *** PANIC ***
 map_page: asked to map invalid page 0x00300000!
 map_page: asked to map invalid page 0x00300000!
 }}}

 mmu_allocate says the first virtual memory for the dynamic range is
 0x300000... is that right?

 {{{
 static void
 map_page(addr_t virtualAddress, addr_t physicalAddress, uint32 flags)
 {
     TRACE(("map_page: vaddr 0x%lx, paddr 0x%lx\n", virtualAddress,
         physicalAddress));

     if (virtualAddress < KERNEL_LOAD_BASE) {
         panic("map_page: asked to map invalid page %p!\n",
             (void *)virtualAddress);
     }

 }}}


 headers/private/kernel/arch/arm/arch_kernel.h:#define KERNEL_BASE
 0x80000000


 so.... there is the issue.  We're setting vaddr to start at 0x300000, but
 the mmu_page checks for >= KERNEL_BASE (0x80000000)

--
Ticket URL: <https://dev.haiku-os.org/ticket/11896#comment:8>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: