diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
commit | d864991b220b7c62e81d21209e1fd978fd67352c (patch) | |
tree | b570a1ad6fc1b959c5bcda6ceca0b321319c01e0 /arch/x86/mm/pgtable.c | |
parent | a688c53a0277d8ea21d86a5c56884892e3442c5e (diff) | |
parent | bab5c80b211035739997ebd361a679fa85b39465 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/x86/mm/pgtable.c')
-rw-r--r-- | arch/x86/mm/pgtable.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 089e78c4effd..59274e2c1ac4 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -115,6 +115,8 @@ static inline void pgd_list_del(pgd_t *pgd) | |||
115 | 115 | ||
116 | #define UNSHARED_PTRS_PER_PGD \ | 116 | #define UNSHARED_PTRS_PER_PGD \ |
117 | (SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD) | 117 | (SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD) |
118 | #define MAX_UNSHARED_PTRS_PER_PGD \ | ||
119 | max_t(size_t, KERNEL_PGD_BOUNDARY, PTRS_PER_PGD) | ||
118 | 120 | ||
119 | 121 | ||
120 | static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) | 122 | static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) |
@@ -181,6 +183,7 @@ static void pgd_dtor(pgd_t *pgd) | |||
181 | * and initialize the kernel pmds here. | 183 | * and initialize the kernel pmds here. |
182 | */ | 184 | */ |
183 | #define PREALLOCATED_PMDS UNSHARED_PTRS_PER_PGD | 185 | #define PREALLOCATED_PMDS UNSHARED_PTRS_PER_PGD |
186 | #define MAX_PREALLOCATED_PMDS MAX_UNSHARED_PTRS_PER_PGD | ||
184 | 187 | ||
185 | /* | 188 | /* |
186 | * We allocate separate PMDs for the kernel part of the user page-table | 189 | * We allocate separate PMDs for the kernel part of the user page-table |
@@ -189,6 +192,7 @@ static void pgd_dtor(pgd_t *pgd) | |||
189 | */ | 192 | */ |
190 | #define PREALLOCATED_USER_PMDS (static_cpu_has(X86_FEATURE_PTI) ? \ | 193 | #define PREALLOCATED_USER_PMDS (static_cpu_has(X86_FEATURE_PTI) ? \ |
191 | KERNEL_PGD_PTRS : 0) | 194 | KERNEL_PGD_PTRS : 0) |
195 | #define MAX_PREALLOCATED_USER_PMDS KERNEL_PGD_PTRS | ||
192 | 196 | ||
193 | void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) | 197 | void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) |
194 | { | 198 | { |
@@ -210,7 +214,9 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) | |||
210 | 214 | ||
211 | /* No need to prepopulate any pagetable entries in non-PAE modes. */ | 215 | /* No need to prepopulate any pagetable entries in non-PAE modes. */ |
212 | #define PREALLOCATED_PMDS 0 | 216 | #define PREALLOCATED_PMDS 0 |
217 | #define MAX_PREALLOCATED_PMDS 0 | ||
213 | #define PREALLOCATED_USER_PMDS 0 | 218 | #define PREALLOCATED_USER_PMDS 0 |
219 | #define MAX_PREALLOCATED_USER_PMDS 0 | ||
214 | #endif /* CONFIG_X86_PAE */ | 220 | #endif /* CONFIG_X86_PAE */ |
215 | 221 | ||
216 | static void free_pmds(struct mm_struct *mm, pmd_t *pmds[], int count) | 222 | static void free_pmds(struct mm_struct *mm, pmd_t *pmds[], int count) |
@@ -428,8 +434,8 @@ static inline void _pgd_free(pgd_t *pgd) | |||
428 | pgd_t *pgd_alloc(struct mm_struct *mm) | 434 | pgd_t *pgd_alloc(struct mm_struct *mm) |
429 | { | 435 | { |
430 | pgd_t *pgd; | 436 | pgd_t *pgd; |
431 | pmd_t *u_pmds[PREALLOCATED_USER_PMDS]; | 437 | pmd_t *u_pmds[MAX_PREALLOCATED_USER_PMDS]; |
432 | pmd_t *pmds[PREALLOCATED_PMDS]; | 438 | pmd_t *pmds[MAX_PREALLOCATED_PMDS]; |
433 | 439 | ||
434 | pgd = _pgd_alloc(); | 440 | pgd = _pgd_alloc(); |
435 | 441 | ||