arm: mm: Use a page for the PGD with LPAE
Alex Van Brunt [Thu, 8 Nov 2012 23:57:36 +0000 (15:57 -0800)]
Allocate a free page instead of useing kmalloc for the PGD. This is
needed to work with the pgd_list_{add|del}() functions that were added
to support the change_page_attr() function. Without it, the struct
page's "lru" list is corrupted by adding the same page to the list
twice because kmalloc would have already added it.

Change-Id: I2bb1a23df2f8af394f87756a167216fdc1f22a67
Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/195681
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Chao Xu <cxu@nvidia.com>

arch/arm/mm/pgd.c

index 56c25f0..40e2119 100644 (file)
 
 #include "mm.h"
 
-#ifdef CONFIG_ARM_LPAE
-#define __pgd_alloc()  kmalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL)
-#define __pgd_free(pgd)        kfree(pgd)
-#else
 #define __pgd_alloc()  (pgd_t *)__get_free_pages(GFP_KERNEL, 2)
 #define __pgd_free(pgd)        free_pages((unsigned long)pgd, 2)
-#endif
 
 DEFINE_SPINLOCK(pgd_lock);
 LIST_HEAD(pgd_list);