File tree Expand file tree Collapse file tree 6 files changed +24
-10
lines changed Expand file tree Collapse file tree 6 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,10 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
78
78
79
79
#define kmap_get_fixmap_pte (vaddr ) \
80
80
pte_offset_kernel( \
81
- pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), \
82
- (vaddr) \
83
- )
81
+ pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), \
82
+ (vaddr)), \
83
+ (vaddr)), \
84
+ (vaddr)), \
85
+ (vaddr))
84
86
85
87
#endif
Original file line number Diff line number Diff line change 8
8
#ifndef _XTENSA_PGTABLE_H
9
9
#define _XTENSA_PGTABLE_H
10
10
11
- #define __ARCH_USE_5LEVEL_HACK
12
11
#include <asm/page.h>
13
12
#include <asm/kmem_layout.h>
14
13
#include <asm-generic/pgtable-nopmd.h>
Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ void do_page_fault(struct pt_regs *regs)
197
197
struct mm_struct * act_mm = current -> active_mm ;
198
198
int index = pgd_index (address );
199
199
pgd_t * pgd , * pgd_k ;
200
+ p4d_t * p4d , * p4d_k ;
200
201
pud_t * pud , * pud_k ;
201
202
pmd_t * pmd , * pmd_k ;
202
203
pte_t * pte_k ;
@@ -212,8 +213,13 @@ void do_page_fault(struct pt_regs *regs)
212
213
213
214
pgd_val (* pgd ) = pgd_val (* pgd_k );
214
215
215
- pud = pud_offset (pgd , address );
216
- pud_k = pud_offset (pgd_k , address );
216
+ p4d = p4d_offset (pgd , address );
217
+ p4d_k = p4d_offset (pgd_k , address );
218
+ if (!p4d_present (* p4d ) || !p4d_present (* p4d_k ))
219
+ goto bad_page_fault ;
220
+
221
+ pud = pud_offset (p4d , address );
222
+ pud_k = pud_offset (p4d_k , address );
217
223
if (!pud_present (* pud ) || !pud_present (* pud_k ))
218
224
goto bad_page_fault ;
219
225
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ void __init kasan_early_init(void)
20
20
{
21
21
unsigned long vaddr = KASAN_SHADOW_START ;
22
22
pgd_t * pgd = pgd_offset_k (vaddr );
23
- pud_t * pud = pud_offset (pgd , vaddr );
23
+ p4d_t * p4d = p4d_offset (pgd , vaddr );
24
+ pud_t * pud = pud_offset (p4d , vaddr );
24
25
pmd_t * pmd = pmd_offset (pud , vaddr );
25
26
int i ;
26
27
@@ -43,7 +44,8 @@ static void __init populate(void *start, void *end)
43
44
unsigned long i , j ;
44
45
unsigned long vaddr = (unsigned long )start ;
45
46
pgd_t * pgd = pgd_offset_k (vaddr );
46
- pud_t * pud = pud_offset (pgd , vaddr );
47
+ p4d_t * p4d = p4d_offset (pgd , vaddr );
48
+ pud_t * pud = pud_offset (p4d , vaddr );
47
49
pmd_t * pmd = pmd_offset (pud , vaddr );
48
50
pte_t * pte = memblock_alloc (n_pages * sizeof (pte_t ), PAGE_SIZE );
49
51
Original file line number Diff line number Diff line change 22
22
static void * __init init_pmd (unsigned long vaddr , unsigned long n_pages )
23
23
{
24
24
pgd_t * pgd = pgd_offset_k (vaddr );
25
- pud_t * pud = pud_offset (pgd , vaddr );
25
+ p4d_t * p4d = p4d_offset (pgd , vaddr );
26
+ pud_t * pud = pud_offset (p4d , vaddr );
26
27
pmd_t * pmd = pmd_offset (pud , vaddr );
27
28
pte_t * pte ;
28
29
unsigned long i ;
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ static unsigned get_pte_for_vaddr(unsigned vaddr)
169
169
struct task_struct * task = get_current ();
170
170
struct mm_struct * mm = task -> mm ;
171
171
pgd_t * pgd ;
172
+ p4d_t * p4d ;
172
173
pud_t * pud ;
173
174
pmd_t * pmd ;
174
175
pte_t * pte ;
@@ -178,7 +179,10 @@ static unsigned get_pte_for_vaddr(unsigned vaddr)
178
179
pgd = pgd_offset (mm , vaddr );
179
180
if (pgd_none_or_clear_bad (pgd ))
180
181
return 0 ;
181
- pud = pud_offset (pgd , vaddr );
182
+ p4d = p4d_offset (pgd , vaddr );
183
+ if (p4d_none_or_clear_bad (p4d ))
184
+ return 0 ;
185
+ pud = pud_offset (p4d , vaddr );
182
186
if (pud_none_or_clear_bad (pud ))
183
187
return 0 ;
184
188
pmd = pmd_offset (pud , vaddr );
You can’t perform that action at this time.
0 commit comments