hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/sh/kernel/io_trapped.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Trapped io support
34 *
45 * Copyright (C) 2008 Magnus Damm
56 *
67 * Intercept io operations by trapping.
7
- *
8
- * This file is subject to the terms and conditions of the GNU General Public
9
- * License. See the file "COPYING" in the main directory of this archive
10
- * for more details.
118 */
129 #include <linux/kernel.h>
1310 #include <linux/mm.h>
....@@ -102,10 +99,9 @@
10299
103100 return 0;
104101 bad:
105
- pr_warning("unable to install trapped io filter\n");
102
+ pr_warn("unable to install trapped io filter\n");
106103 return -1;
107104 }
108
-EXPORT_SYMBOL_GPL(register_trapped_io);
109105
110106 void __iomem *match_trapped_io_handler(struct list_head *list,
111107 unsigned long offset,
....@@ -134,11 +130,11 @@
134130 spin_unlock_irqrestore(&trapped_lock, flags);
135131 return NULL;
136132 }
137
-EXPORT_SYMBOL_GPL(match_trapped_io_handler);
138133
139134 static struct trapped_io *lookup_tiop(unsigned long address)
140135 {
141136 pgd_t *pgd_k;
137
+ p4d_t *p4d_k;
142138 pud_t *pud_k;
143139 pmd_t *pmd_k;
144140 pte_t *pte_k;
....@@ -148,7 +144,11 @@
148144 if (!pgd_present(*pgd_k))
149145 return NULL;
150146
151
- pud_k = pud_offset(pgd_k, address);
147
+ p4d_k = p4d_offset(pgd_k, address);
148
+ if (!p4d_present(*p4d_k))
149
+ return NULL;
150
+
151
+ pud_k = pud_offset(p4d_k, address);
152152 if (!pud_present(*pud_k))
153153 return NULL;
154154