diff options
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/4level-fixup.h | 1 | ||||
-rw-r--r-- | include/asm-generic/pgtable.h | 168 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 1 |
3 files changed, 11 insertions, 159 deletions
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 77ff547730af..5bdab6bffd23 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #define __ARCH_HAS_4LEVEL_HACK | 4 | #define __ARCH_HAS_4LEVEL_HACK |
5 | #define __PAGETABLE_PUD_FOLDED | 5 | #define __PAGETABLE_PUD_FOLDED |
6 | 6 | ||
7 | #define PUD_SHIFT PGDIR_SHIFT | ||
7 | #define PUD_SIZE PGDIR_SIZE | 8 | #define PUD_SIZE PGDIR_SIZE |
8 | #define PUD_MASK PGDIR_MASK | 9 | #define PUD_MASK PGDIR_MASK |
9 | #define PTRS_PER_PUD 1 | 10 | #define PTRS_PER_PUD 1 |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 177d5973b132..4d46085c1b90 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -244,10 +244,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
244 | # define pte_accessible(mm, pte) ((void)(pte), 1) | 244 | # define pte_accessible(mm, pte) ((void)(pte), 1) |
245 | #endif | 245 | #endif |
246 | 246 | ||
247 | #ifndef pte_present_nonuma | ||
248 | #define pte_present_nonuma(pte) pte_present(pte) | ||
249 | #endif | ||
250 | |||
251 | #ifndef flush_tlb_fix_spurious_fault | 247 | #ifndef flush_tlb_fix_spurious_fault |
252 | #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) | 248 | #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) |
253 | #endif | 249 | #endif |
@@ -474,21 +470,6 @@ static inline pte_t pte_swp_clear_soft_dirty(pte_t pte) | |||
474 | { | 470 | { |
475 | return pte; | 471 | return pte; |
476 | } | 472 | } |
477 | |||
478 | static inline pte_t pte_file_clear_soft_dirty(pte_t pte) | ||
479 | { | ||
480 | return pte; | ||
481 | } | ||
482 | |||
483 | static inline pte_t pte_file_mksoft_dirty(pte_t pte) | ||
484 | { | ||
485 | return pte; | ||
486 | } | ||
487 | |||
488 | static inline int pte_file_soft_dirty(pte_t pte) | ||
489 | { | ||
490 | return 0; | ||
491 | } | ||
492 | #endif | 473 | #endif |
493 | 474 | ||
494 | #ifndef __HAVE_PFNMAP_TRACKING | 475 | #ifndef __HAVE_PFNMAP_TRACKING |
@@ -688,155 +669,24 @@ static inline int pmd_trans_unstable(pmd_t *pmd) | |||
688 | #endif | 669 | #endif |
689 | } | 670 | } |
690 | 671 | ||
691 | #ifdef CONFIG_NUMA_BALANCING | 672 | #ifndef CONFIG_NUMA_BALANCING |
692 | /* | ||
693 | * _PAGE_NUMA distinguishes between an unmapped page table entry, an entry that | ||
694 | * is protected for PROT_NONE and a NUMA hinting fault entry. If the | ||
695 | * architecture defines __PAGE_PROTNONE then it should take that into account | ||
696 | * but those that do not can rely on the fact that the NUMA hinting scanner | ||
697 | * skips inaccessible VMAs. | ||
698 | * | ||
699 | * pte/pmd_present() returns true if pte/pmd_numa returns true. Page | ||
700 | * fault triggers on those regions if pte/pmd_numa returns true | ||
701 | * (because _PAGE_PRESENT is not set). | ||
702 | */ | ||
703 | #ifndef pte_numa | ||
704 | static inline int pte_numa(pte_t pte) | ||
705 | { | ||
706 | return ptenuma_flags(pte) == _PAGE_NUMA; | ||
707 | } | ||
708 | #endif | ||
709 | |||
710 | #ifndef pmd_numa | ||
711 | static inline int pmd_numa(pmd_t pmd) | ||
712 | { | ||
713 | return pmdnuma_flags(pmd) == _PAGE_NUMA; | ||
714 | } | ||
715 | #endif | ||
716 | |||
717 | /* | 673 | /* |
718 | * pte/pmd_mknuma sets the _PAGE_ACCESSED bitflag automatically | 674 | * Technically a PTE can be PROTNONE even when not doing NUMA balancing but |
719 | * because they're called by the NUMA hinting minor page fault. If we | 675 | * the only case the kernel cares is for NUMA balancing and is only ever set |
720 | * wouldn't set the _PAGE_ACCESSED bitflag here, the TLB miss handler | 676 | * when the VMA is accessible. For PROT_NONE VMAs, the PTEs are not marked |
721 | * would be forced to set it later while filling the TLB after we | 677 | * _PAGE_PROTNONE so by by default, implement the helper as "always no". It |
722 | * return to userland. That would trigger a second write to memory | 678 | * is the responsibility of the caller to distinguish between PROT_NONE |
723 | * that we optimize away by setting _PAGE_ACCESSED here. | 679 | * protections and NUMA hinting fault protections. |
724 | */ | 680 | */ |
725 | #ifndef pte_mknonnuma | 681 | static inline int pte_protnone(pte_t pte) |
726 | static inline pte_t pte_mknonnuma(pte_t pte) | ||
727 | { | ||
728 | pteval_t val = pte_val(pte); | ||
729 | |||
730 | val &= ~_PAGE_NUMA; | ||
731 | val |= (_PAGE_PRESENT|_PAGE_ACCESSED); | ||
732 | return __pte(val); | ||
733 | } | ||
734 | #endif | ||
735 | |||
736 | #ifndef pmd_mknonnuma | ||
737 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) | ||
738 | { | ||
739 | pmdval_t val = pmd_val(pmd); | ||
740 | |||
741 | val &= ~_PAGE_NUMA; | ||
742 | val |= (_PAGE_PRESENT|_PAGE_ACCESSED); | ||
743 | |||
744 | return __pmd(val); | ||
745 | } | ||
746 | #endif | ||
747 | |||
748 | #ifndef pte_mknuma | ||
749 | static inline pte_t pte_mknuma(pte_t pte) | ||
750 | { | ||
751 | pteval_t val = pte_val(pte); | ||
752 | |||
753 | VM_BUG_ON(!(val & _PAGE_PRESENT)); | ||
754 | |||
755 | val &= ~_PAGE_PRESENT; | ||
756 | val |= _PAGE_NUMA; | ||
757 | |||
758 | return __pte(val); | ||
759 | } | ||
760 | #endif | ||
761 | |||
762 | #ifndef ptep_set_numa | ||
763 | static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, | ||
764 | pte_t *ptep) | ||
765 | { | ||
766 | pte_t ptent = *ptep; | ||
767 | |||
768 | ptent = pte_mknuma(ptent); | ||
769 | set_pte_at(mm, addr, ptep, ptent); | ||
770 | return; | ||
771 | } | ||
772 | #endif | ||
773 | |||
774 | #ifndef pmd_mknuma | ||
775 | static inline pmd_t pmd_mknuma(pmd_t pmd) | ||
776 | { | ||
777 | pmdval_t val = pmd_val(pmd); | ||
778 | |||
779 | val &= ~_PAGE_PRESENT; | ||
780 | val |= _PAGE_NUMA; | ||
781 | |||
782 | return __pmd(val); | ||
783 | } | ||
784 | #endif | ||
785 | |||
786 | #ifndef pmdp_set_numa | ||
787 | static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, | ||
788 | pmd_t *pmdp) | ||
789 | { | ||
790 | pmd_t pmd = *pmdp; | ||
791 | |||
792 | pmd = pmd_mknuma(pmd); | ||
793 | set_pmd_at(mm, addr, pmdp, pmd); | ||
794 | return; | ||
795 | } | ||
796 | #endif | ||
797 | #else | ||
798 | static inline int pmd_numa(pmd_t pmd) | ||
799 | { | 682 | { |
800 | return 0; | 683 | return 0; |
801 | } | 684 | } |
802 | 685 | ||
803 | static inline int pte_numa(pte_t pte) | 686 | static inline int pmd_protnone(pmd_t pmd) |
804 | { | 687 | { |
805 | return 0; | 688 | return 0; |
806 | } | 689 | } |
807 | |||
808 | static inline pte_t pte_mknonnuma(pte_t pte) | ||
809 | { | ||
810 | return pte; | ||
811 | } | ||
812 | |||
813 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) | ||
814 | { | ||
815 | return pmd; | ||
816 | } | ||
817 | |||
818 | static inline pte_t pte_mknuma(pte_t pte) | ||
819 | { | ||
820 | return pte; | ||
821 | } | ||
822 | |||
823 | static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, | ||
824 | pte_t *ptep) | ||
825 | { | ||
826 | return; | ||
827 | } | ||
828 | |||
829 | |||
830 | static inline pmd_t pmd_mknuma(pmd_t pmd) | ||
831 | { | ||
832 | return pmd; | ||
833 | } | ||
834 | |||
835 | static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, | ||
836 | pmd_t *pmdp) | ||
837 | { | ||
838 | return ; | ||
839 | } | ||
840 | #endif /* CONFIG_NUMA_BALANCING */ | 690 | #endif /* CONFIG_NUMA_BALANCING */ |
841 | 691 | ||
842 | #endif /* CONFIG_MMU */ | 692 | #endif /* CONFIG_MMU */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bee5d683074d..ac78910d7416 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -478,6 +478,7 @@ | |||
478 | #define KERNEL_CTORS() . = ALIGN(8); \ | 478 | #define KERNEL_CTORS() . = ALIGN(8); \ |
479 | VMLINUX_SYMBOL(__ctors_start) = .; \ | 479 | VMLINUX_SYMBOL(__ctors_start) = .; \ |
480 | *(.ctors) \ | 480 | *(.ctors) \ |
481 | *(SORT(.init_array.*)) \ | ||
481 | *(.init_array) \ | 482 | *(.init_array) \ |
482 | VMLINUX_SYMBOL(__ctors_end) = .; | 483 | VMLINUX_SYMBOL(__ctors_end) = .; |
483 | #else | 484 | #else |