• A
    powerpc/mm: Check memblock_add against MAX_PHYSMEM_BITS range · 6aba0c84
    Aneesh Kumar K.V 提交于
    With SPARSEMEM config enabled, we make sure that we don't add sections beyond
    MAX_PHYSMEM_BITS range. This results in not building vmemmap mapping for
    range beyond max range. But our memblock layer looks the device tree and create
    mapping for the full memory range. Prevent this by checking against
    MAX_PHSYSMEM_BITS when doing memblock_add.
    
    We don't do similar check for memeblock_reserve_range. If reserve range is beyond
    MAX_PHYSMEM_BITS we expect that to be configured with 'nomap'. Any other
    reserved range should come from existing memblock ranges which we already
    filtered while adding.
    
    This avoids crash as below when running on a system with system ram config above
    MAX_PHSYSMEM_BITS
    
     Unable to handle kernel paging request for data at address 0xc00a001000000440
     Faulting instruction address: 0xc000000001034118
     cpu 0x0: Vector: 300 (Data Access) at [c00000000124fb30]
         pc: c000000001034118: __free_pages_bootmem+0xc0/0x1c0
         lr: c00000000103b258: free_all_bootmem+0x19c/0x22c
         sp: c00000000124fdb0
        msr: 9000000002001033
        dar: c00a001000000440
      dsisr: 40000000
       current = 0xc00000000120dd00
       paca    = 0xc000000001f60000^I irqmask: 0x03^I irq_happened: 0x01
         pid   = 0, comm = swapper
     [c00000000124fe20] c00000000103b258 free_all_bootmem+0x19c/0x22c
     [c00000000124fee0] c000000001010a68 mem_init+0x3c/0x5c
     [c00000000124ff00] c00000000100401c start_kernel+0x298/0x5e4
     [c00000000124ff90] c00000000000b57c start_here_common+0x1c/0x520
    Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
    Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
    6aba0c84
prom.c 23.8 KB