forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/arm/mm/fault-armv.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mm/fault-armv.c
34 *
45 * Copyright (C) 1995 Linus Torvalds
56 * Modifications for ARM processor (c) 1995-2002 Russell King
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118 #include <linux/sched.h>
129 #include <linux/kernel.h>
....@@ -20,7 +17,6 @@
2017 #include <asm/bugs.h>
2118 #include <asm/cacheflush.h>
2219 #include <asm/cachetype.h>
23
-#include <asm/pgtable.h>
2420 #include <asm/tlbflush.h>
2521
2622 #include "mm.h"
....@@ -94,6 +90,7 @@
9490 {
9591 spinlock_t *ptl;
9692 pgd_t *pgd;
93
+ p4d_t *p4d;
9794 pud_t *pud;
9895 pmd_t *pmd;
9996 pte_t *pte;
....@@ -103,7 +100,11 @@
103100 if (pgd_none_or_clear_bad(pgd))
104101 return 0;
105102
106
- pud = pud_offset(pgd, address);
103
+ p4d = p4d_offset(pgd, address);
104
+ if (p4d_none_or_clear_bad(p4d))
105
+ return 0;
106
+
107
+ pud = pud_offset(p4d, address);
107108 if (pud_none_or_clear_bad(pud))
108109 return 0;
109110