diff options
Diffstat (limited to 'include/asm-s390/pgalloc.h')
-rw-r--r-- | include/asm-s390/pgalloc.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index af4aee856df3..cc47dd65a499 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h | |||
@@ -73,11 +73,17 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm) | |||
73 | 73 | ||
74 | static inline unsigned long pgd_entry_type(struct mm_struct *mm) | 74 | static inline unsigned long pgd_entry_type(struct mm_struct *mm) |
75 | { | 75 | { |
76 | return _REGION3_ENTRY_EMPTY; | 76 | return _REGION2_ENTRY_EMPTY; |
77 | } | 77 | } |
78 | 78 | ||
79 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) | 79 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address) |
80 | #define pud_free(mm, x) do { } while (0) | 80 | { |
81 | unsigned long *table = crst_table_alloc(mm, mm->context.noexec); | ||
82 | if (table) | ||
83 | crst_table_init(table, _REGION3_ENTRY_EMPTY); | ||
84 | return (pud_t *) table; | ||
85 | } | ||
86 | #define pud_free(mm, pud) crst_table_free(mm, (unsigned long *) pud) | ||
81 | 87 | ||
82 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | 88 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) |
83 | { | 89 | { |
@@ -88,8 +94,21 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | |||
88 | } | 94 | } |
89 | #define pmd_free(mm, pmd) crst_table_free(mm, (unsigned long *) pmd) | 95 | #define pmd_free(mm, pmd) crst_table_free(mm, (unsigned long *) pmd) |
90 | 96 | ||
91 | #define pgd_populate(mm, pgd, pud) BUG() | 97 | static inline void pgd_populate_kernel(struct mm_struct *mm, |
92 | #define pgd_populate_kernel(mm, pgd, pud) BUG() | 98 | pgd_t *pgd, pud_t *pud) |
99 | { | ||
100 | pgd_val(*pgd) = _REGION2_ENTRY | __pa(pud); | ||
101 | } | ||
102 | |||
103 | static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | ||
104 | { | ||
105 | pgd_t *shadow_pgd = get_shadow_table(pgd); | ||
106 | pud_t *shadow_pud = get_shadow_table(pud); | ||
107 | |||
108 | if (shadow_pgd && shadow_pud) | ||
109 | pgd_populate_kernel(mm, shadow_pgd, shadow_pud); | ||
110 | pgd_populate_kernel(mm, pgd, pud); | ||
111 | } | ||
93 | 112 | ||
94 | static inline void pud_populate_kernel(struct mm_struct *mm, | 113 | static inline void pud_populate_kernel(struct mm_struct *mm, |
95 | pud_t *pud, pmd_t *pmd) | 114 | pud_t *pud, pmd_t *pmd) |