x86: unify KERNEL_PGD_PTRS
Make KERNEL_PGD_PTRS common, as previously it was only being defined for 32-bit. There are a couple of follow-on changes from this: - KERNEL_PGD_PTRS was being defined in terms of USER_PGD_PTRS. The definition of USER_PGD_PTRS doesn't really make much sense on x86-64, since it can have two different user address-space configurations. I renamed USER_PGD_PTRS to KERNEL_PGD_BOUNDARY, which is meaningful for all of 32/32, 32/64 and 64/64 process configurations. - USER_PTRS_PER_PGD was also defined and was being used for similar purposes. Converting its users to KERNEL_PGD_BOUNDARY left it completely unused, and so I removed it. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Andi Kleen <ak@suse.de> Cc: Zach Amsden <zach@vmware.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
committed by
Ingo Molnar
parent
90e9f53662
commit
68db065c84
@ -104,7 +104,7 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd)
|
||||
* -- wli
|
||||
*/
|
||||
#define UNSHARED_PTRS_PER_PGD \
|
||||
(SHARED_KERNEL_PMD ? USER_PTRS_PER_PGD : PTRS_PER_PGD)
|
||||
(SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
|
||||
|
||||
static void pgd_ctor(void *p)
|
||||
{
|
||||
@ -112,7 +112,7 @@ static void pgd_ctor(void *p)
|
||||
unsigned long flags;
|
||||
|
||||
/* Clear usermode parts of PGD */
|
||||
memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
|
||||
memset(pgd, 0, KERNEL_PGD_BOUNDARY*sizeof(pgd_t));
|
||||
|
||||
spin_lock_irqsave(&pgd_lock, flags);
|
||||
|
||||
@ -121,12 +121,12 @@ static void pgd_ctor(void *p)
|
||||
references from swapper_pg_dir. */
|
||||
if (PAGETABLE_LEVELS == 2 ||
|
||||
(PAGETABLE_LEVELS == 3 && SHARED_KERNEL_PMD)) {
|
||||
clone_pgd_range(pgd + USER_PTRS_PER_PGD,
|
||||
swapper_pg_dir + USER_PTRS_PER_PGD,
|
||||
clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY,
|
||||
swapper_pg_dir + KERNEL_PGD_BOUNDARY,
|
||||
KERNEL_PGD_PTRS);
|
||||
paravirt_alloc_pmd_clone(__pa(pgd) >> PAGE_SHIFT,
|
||||
__pa(swapper_pg_dir) >> PAGE_SHIFT,
|
||||
USER_PTRS_PER_PGD,
|
||||
KERNEL_PGD_BOUNDARY,
|
||||
KERNEL_PGD_PTRS);
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (i >= USER_PTRS_PER_PGD)
|
||||
if (i >= KERNEL_PGD_BOUNDARY)
|
||||
memcpy(pmd, (pmd_t *)pgd_page_vaddr(swapper_pg_dir[i]),
|
||||
sizeof(pmd_t) * PTRS_PER_PMD);
|
||||
|
||||
|
Reference in New Issue
Block a user