diff options
Diffstat (limited to 'include/asm-s390/tlb.h')
-rw-r--r-- | include/asm-s390/tlb.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-s390/tlb.h b/include/asm-s390/tlb.h index 9b2ddb7aac49..3d8a96d39d9d 100644 --- a/include/asm-s390/tlb.h +++ b/include/asm-s390/tlb.h | |||
@@ -109,10 +109,15 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte) | |||
109 | /* | 109 | /* |
110 | * pmd_free_tlb frees a pmd table and clears the CRSTE for the | 110 | * pmd_free_tlb frees a pmd table and clears the CRSTE for the |
111 | * segment table entry from the tlb. | 111 | * segment table entry from the tlb. |
112 | * If the mm uses a two level page table the single pmd is freed | ||
113 | * as the pgd. pmd_free_tlb checks the asce_limit against 2GB | ||
114 | * to avoid the double free of the pmd in this case. | ||
112 | */ | 115 | */ |
113 | static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | 116 | static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) |
114 | { | 117 | { |
115 | #ifdef __s390x__ | 118 | #ifdef __s390x__ |
119 | if (tlb->mm->context.asce_limit <= (1UL << 31)) | ||
120 | return; | ||
116 | if (!tlb->fullmm) { | 121 | if (!tlb->fullmm) { |
117 | tlb->array[--tlb->nr_pxds] = pmd; | 122 | tlb->array[--tlb->nr_pxds] = pmd; |
118 | if (tlb->nr_ptes >= tlb->nr_pxds) | 123 | if (tlb->nr_ptes >= tlb->nr_pxds) |
@@ -125,10 +130,15 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | |||
125 | /* | 130 | /* |
126 | * pud_free_tlb frees a pud table and clears the CRSTE for the | 131 | * pud_free_tlb frees a pud table and clears the CRSTE for the |
127 | * region third table entry from the tlb. | 132 | * region third table entry from the tlb. |
133 | * If the mm uses a three level page table the single pud is freed | ||
134 | * as the pgd. pud_free_tlb checks the asce_limit against 4TB | ||
135 | * to avoid the double free of the pud in this case. | ||
128 | */ | 136 | */ |
129 | static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) | 137 | static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) |
130 | { | 138 | { |
131 | #ifdef __s390x__ | 139 | #ifdef __s390x__ |
140 | if (tlb->mm->context.asce_limit <= (1UL << 42)) | ||
141 | return; | ||
132 | if (!tlb->fullmm) { | 142 | if (!tlb->fullmm) { |
133 | tlb->array[--tlb->nr_pxds] = pud; | 143 | tlb->array[--tlb->nr_pxds] = pud; |
134 | if (tlb->nr_ptes >= tlb->nr_pxds) | 144 | if (tlb->nr_ptes >= tlb->nr_pxds) |