aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2010-10-25 10:10:36 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-10-25 10:10:19 -0400
commit84afdcee620b1640f2a145c07febae4ed68947f9 (patch)
tree7e0e400264659064ebabc395b991d50008f35bf0 /arch/s390
parent36bf96801e3a2c4efae0bb8c1897a530fc9ca13e (diff)
[S390] pgtable: move pte_mkhuge() from hugetlb.h to pgtable.h
All architectures besides s390 have pte_mkhuge() defined in pgtable.h. So move the function to pgtable.h on s390 as well. Fixes a compile error introduced with "hugetlb: hugepage migration core" in linux-next which only happens on s390. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/hugetlb.h26
-rw-r--r--arch/s390/include/asm/pgtable.h28
2 files changed, 28 insertions, 26 deletions
diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index bb8343d157bc..b56403c2df28 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,32 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
37int arch_prepare_hugepage(struct page *page); 37int arch_prepare_hugepage(struct page *page);
38void arch_release_hugepage(struct page *page); 38void arch_release_hugepage(struct page *page);
39 39
40static inline pte_t pte_mkhuge(pte_t pte)
41{
42 /*
43 * PROT_NONE needs to be remapped from the pte type to the ste type.
44 * The HW invalid bit is also different for pte and ste. The pte
45 * invalid bit happens to be the same as the ste _SEGMENT_ENTRY_LARGE
46 * bit, so we don't have to clear it.
47 */
48 if (pte_val(pte) & _PAGE_INVALID) {
49 if (pte_val(pte) & _PAGE_SWT)
50 pte_val(pte) |= _HPAGE_TYPE_NONE;
51 pte_val(pte) |= _SEGMENT_ENTRY_INV;
52 }
53 /*
54 * Clear SW pte bits SWT and SWX, there are no SW bits in a segment
55 * table entry.
56 */
57 pte_val(pte) &= ~(_PAGE_SWT | _PAGE_SWX);
58 /*
59 * Also set the change-override bit because we don't need dirty bit
60 * tracking for hugetlbfs pages.
61 */
62 pte_val(pte) |= (_SEGMENT_ENTRY_LARGE | _SEGMENT_ENTRY_CO);
63 return pte;
64}
65
66static inline pte_t huge_pte_wrprotect(pte_t pte) 40static inline pte_t huge_pte_wrprotect(pte_t pte)
67{ 41{
68 pte_val(pte) |= _PAGE_RO; 42 pte_val(pte) |= _PAGE_RO;
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index f79e7bb9ae1e..986dc9476c21 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -772,6 +772,34 @@ static inline pte_t pte_mkspecial(pte_t pte)
772 return pte; 772 return pte;
773} 773}
774 774
775#ifdef CONFIG_HUGETLB_PAGE
776static inline pte_t pte_mkhuge(pte_t pte)
777{
778 /*
779 * PROT_NONE needs to be remapped from the pte type to the ste type.
780 * The HW invalid bit is also different for pte and ste. The pte
781 * invalid bit happens to be the same as the ste _SEGMENT_ENTRY_LARGE
782 * bit, so we don't have to clear it.
783 */
784 if (pte_val(pte) & _PAGE_INVALID) {
785 if (pte_val(pte) & _PAGE_SWT)
786 pte_val(pte) |= _HPAGE_TYPE_NONE;
787 pte_val(pte) |= _SEGMENT_ENTRY_INV;
788 }
789 /*
790 * Clear SW pte bits SWT and SWX, there are no SW bits in a segment
791 * table entry.
792 */
793 pte_val(pte) &= ~(_PAGE_SWT | _PAGE_SWX);
794 /*
795 * Also set the change-override bit because we don't need dirty bit
796 * tracking for hugetlbfs pages.
797 */
798 pte_val(pte) |= (_SEGMENT_ENTRY_LARGE | _SEGMENT_ENTRY_CO);
799 return pte;
800}
801#endif
802
775#ifdef CONFIG_PGSTE 803#ifdef CONFIG_PGSTE
776/* 804/*
777 * Get (and clear) the user dirty bit for a PTE. 805 * Get (and clear) the user dirty bit for a PTE.