• Grant Likely's avatar
    [POWERPC] ppc405 Fix arithmatic rollover bug when memory size under 16M · bd942ba3
    Grant Likely authored
    mmu_mapin_ram() loops over total_lowmem to setup page tables.  However, if
    total_lowmem is less that 16M, the subtraction rolls over and results in
    a number just under 4G (because total_lowmem is an unsigned value).
    
    This patch rejigs the loop from countup to countdown to eliminate the
    bug.
    
    Special thanks to Magnus Hjorth who wrote the original patch to fix this
    bug.  This patch improves on his by making the loop code simpler (which
    also eliminates the possibility of another rollover at the high end)
    and also applies the change to arch/powerpc.
    Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
    Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
    bd942ba3
4xx_mmu.c 3.58 KB