diff options
-rw-r--r-- | arch/x86/kernel/head_32.S | 20 | ||||
-rw-r--r-- | arch/x86/mm/pgtable.c | 5 |
2 files changed, 18 insertions, 7 deletions
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index abe6df15a8fb..30f9cb2c0b55 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -512,11 +512,18 @@ ENTRY(initial_code) | |||
512 | ENTRY(setup_once_ref) | 512 | ENTRY(setup_once_ref) |
513 | .long setup_once | 513 | .long setup_once |
514 | 514 | ||
515 | #ifdef CONFIG_PAGE_TABLE_ISOLATION | ||
516 | #define PGD_ALIGN (2 * PAGE_SIZE) | ||
517 | #define PTI_USER_PGD_FILL 1024 | ||
518 | #else | ||
519 | #define PGD_ALIGN (PAGE_SIZE) | ||
520 | #define PTI_USER_PGD_FILL 0 | ||
521 | #endif | ||
515 | /* | 522 | /* |
516 | * BSS section | 523 | * BSS section |
517 | */ | 524 | */ |
518 | __PAGE_ALIGNED_BSS | 525 | __PAGE_ALIGNED_BSS |
519 | .align PAGE_SIZE | 526 | .align PGD_ALIGN |
520 | #ifdef CONFIG_X86_PAE | 527 | #ifdef CONFIG_X86_PAE |
521 | .globl initial_pg_pmd | 528 | .globl initial_pg_pmd |
522 | initial_pg_pmd: | 529 | initial_pg_pmd: |
@@ -526,14 +533,17 @@ initial_pg_pmd: | |||
526 | initial_page_table: | 533 | initial_page_table: |
527 | .fill 1024,4,0 | 534 | .fill 1024,4,0 |
528 | #endif | 535 | #endif |
536 | .align PGD_ALIGN | ||
529 | initial_pg_fixmap: | 537 | initial_pg_fixmap: |
530 | .fill 1024,4,0 | 538 | .fill 1024,4,0 |
531 | .globl empty_zero_page | ||
532 | empty_zero_page: | ||
533 | .fill 4096,1,0 | ||
534 | .globl swapper_pg_dir | 539 | .globl swapper_pg_dir |
540 | .align PGD_ALIGN | ||
535 | swapper_pg_dir: | 541 | swapper_pg_dir: |
536 | .fill 1024,4,0 | 542 | .fill 1024,4,0 |
543 | .fill PTI_USER_PGD_FILL,4,0 | ||
544 | .globl empty_zero_page | ||
545 | empty_zero_page: | ||
546 | .fill 4096,1,0 | ||
537 | EXPORT_SYMBOL(empty_zero_page) | 547 | EXPORT_SYMBOL(empty_zero_page) |
538 | 548 | ||
539 | /* | 549 | /* |
@@ -542,7 +552,7 @@ EXPORT_SYMBOL(empty_zero_page) | |||
542 | #ifdef CONFIG_X86_PAE | 552 | #ifdef CONFIG_X86_PAE |
543 | __PAGE_ALIGNED_DATA | 553 | __PAGE_ALIGNED_DATA |
544 | /* Page-aligned for the benefit of paravirt? */ | 554 | /* Page-aligned for the benefit of paravirt? */ |
545 | .align PAGE_SIZE | 555 | .align PGD_ALIGN |
546 | ENTRY(initial_page_table) | 556 | ENTRY(initial_page_table) |
547 | .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */ | 557 | .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */ |
548 | # if KPMDS == 3 | 558 | # if KPMDS == 3 |
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 47b5951e592b..db6fb7740bf7 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -343,7 +343,8 @@ static inline pgd_t *_pgd_alloc(void) | |||
343 | * We allocate one page for pgd. | 343 | * We allocate one page for pgd. |
344 | */ | 344 | */ |
345 | if (!SHARED_KERNEL_PMD) | 345 | if (!SHARED_KERNEL_PMD) |
346 | return (pgd_t *)__get_free_page(PGALLOC_GFP); | 346 | return (pgd_t *)__get_free_pages(PGALLOC_GFP, |
347 | PGD_ALLOCATION_ORDER); | ||
347 | 348 | ||
348 | /* | 349 | /* |
349 | * Now PAE kernel is not running as a Xen domain. We can allocate | 350 | * Now PAE kernel is not running as a Xen domain. We can allocate |
@@ -355,7 +356,7 @@ static inline pgd_t *_pgd_alloc(void) | |||
355 | static inline void _pgd_free(pgd_t *pgd) | 356 | static inline void _pgd_free(pgd_t *pgd) |
356 | { | 357 | { |
357 | if (!SHARED_KERNEL_PMD) | 358 | if (!SHARED_KERNEL_PMD) |
358 | free_page((unsigned long)pgd); | 359 | free_pages((unsigned long)pgd, PGD_ALLOCATION_ORDER); |
359 | else | 360 | else |
360 | kmem_cache_free(pgd_cache, pgd); | 361 | kmem_cache_free(pgd_cache, pgd); |
361 | } | 362 | } |