diff options
Diffstat (limited to 'arch/x86/mm/pgtable.c')
-rw-r--r-- | arch/x86/mm/pgtable.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index e848a4811785..089e78c4effd 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -269,7 +269,7 @@ static void mop_up_one_pmd(struct mm_struct *mm, pgd_t *pgdp) | |||
269 | if (pgd_val(pgd) != 0) { | 269 | if (pgd_val(pgd) != 0) { |
270 | pmd_t *pmd = (pmd_t *)pgd_page_vaddr(pgd); | 270 | pmd_t *pmd = (pmd_t *)pgd_page_vaddr(pgd); |
271 | 271 | ||
272 | *pgdp = native_make_pgd(0); | 272 | pgd_clear(pgdp); |
273 | 273 | ||
274 | paravirt_release_pmd(pgd_val(pgd) >> PAGE_SHIFT); | 274 | paravirt_release_pmd(pgd_val(pgd) >> PAGE_SHIFT); |
275 | pmd_free(mm, pmd); | 275 | pmd_free(mm, pmd); |
@@ -494,7 +494,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma, | |||
494 | int changed = !pte_same(*ptep, entry); | 494 | int changed = !pte_same(*ptep, entry); |
495 | 495 | ||
496 | if (changed && dirty) | 496 | if (changed && dirty) |
497 | *ptep = entry; | 497 | set_pte(ptep, entry); |
498 | 498 | ||
499 | return changed; | 499 | return changed; |
500 | } | 500 | } |
@@ -509,7 +509,7 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, | |||
509 | VM_BUG_ON(address & ~HPAGE_PMD_MASK); | 509 | VM_BUG_ON(address & ~HPAGE_PMD_MASK); |
510 | 510 | ||
511 | if (changed && dirty) { | 511 | if (changed && dirty) { |
512 | *pmdp = entry; | 512 | set_pmd(pmdp, entry); |
513 | /* | 513 | /* |
514 | * We had a write-protection fault here and changed the pmd | 514 | * We had a write-protection fault here and changed the pmd |
515 | * to to more permissive. No need to flush the TLB for that, | 515 | * to to more permissive. No need to flush the TLB for that, |
@@ -529,7 +529,7 @@ int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address, | |||
529 | VM_BUG_ON(address & ~HPAGE_PUD_MASK); | 529 | VM_BUG_ON(address & ~HPAGE_PUD_MASK); |
530 | 530 | ||
531 | if (changed && dirty) { | 531 | if (changed && dirty) { |
532 | *pudp = entry; | 532 | set_pud(pudp, entry); |
533 | /* | 533 | /* |
534 | * We had a write-protection fault here and changed the pud | 534 | * We had a write-protection fault here and changed the pud |
535 | * to to more permissive. No need to flush the TLB for that, | 535 | * to to more permissive. No need to flush the TLB for that, |
@@ -637,6 +637,15 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t pte) | |||
637 | { | 637 | { |
638 | unsigned long address = __fix_to_virt(idx); | 638 | unsigned long address = __fix_to_virt(idx); |
639 | 639 | ||
640 | #ifdef CONFIG_X86_64 | ||
641 | /* | ||
642 | * Ensure that the static initial page tables are covering the | ||
643 | * fixmap completely. | ||
644 | */ | ||
645 | BUILD_BUG_ON(__end_of_permanent_fixed_addresses > | ||
646 | (FIXMAP_PMD_NUM * PTRS_PER_PTE)); | ||
647 | #endif | ||
648 | |||
640 | if (idx >= __end_of_fixed_addresses) { | 649 | if (idx >= __end_of_fixed_addresses) { |
641 | BUG(); | 650 | BUG(); |
642 | return; | 651 | return; |