]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86/mm: account for PGDIR_SIZE alignment
authorJerry Hoemann <jerry.hoemann@hp.com>
Tue, 30 Apr 2013 21:15:55 +0000 (15:15 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 May 2013 20:48:15 +0000 (13:48 -0700)
commit94544e2e6ef40c33b760f0c8649904db262dfd64
tree808d75bf9fa91db463c5ae4a705a235e9b032145
parente4727b26cd5c972a1688e23c877538ccdd5513be
x86/mm: account for PGDIR_SIZE alignment

Patch for -stable.  Function find_early_table_space removed upstream.

Fixes panic in alloc_low_page due to pgt_buf overflow during
init_memory_mapping.

find_early_table_space sizes pgt_buf based upon the size of the
memory being mapped, but it does not take into account the alignment
of the memory.  When the region being mapped spans a 512GB (PGDIR_SIZE)
alignment, a panic from alloc_low_pages occurs.

kernel_physical_mapping_init takes into account PGDIR_SIZE alignment.
This causes an extra call to alloc_low_page to be made.  This extra call
isn't accounted for by find_early_table_space and causes a kernel panic.

Change is to take into account PGDIR_SIZE alignment in find_early_table_space.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/mm/init.c