hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/powerpc/lib/copy_32.S
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Memory copy functions for 32-bit PowerPC.
34 *
45 * Copyright (C) 1996-2005 Paul Mackerras.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117 #include <asm/processor.h>
128 #include <asm/cache.h>
....@@ -14,6 +10,7 @@
1410 #include <asm/ppc_asm.h>
1511 #include <asm/export.h>
1612 #include <asm/code-patching-asm.h>
13
+#include <asm/kasan.h>
1714
1815 #define COPY_16_BYTES \
1916 lwz r7,4(r4); \
....@@ -68,6 +65,7 @@
6865 LG_CACHELINE_BYTES = L1_CACHE_SHIFT
6966 CACHELINE_MASK = (L1_CACHE_BYTES-1)
7067
68
+#ifndef CONFIG_KASAN
7169 _GLOBAL(memset16)
7270 rlwinm. r0 ,r5, 31, 1, 31
7371 addi r6, r3, -4
....@@ -81,6 +79,7 @@
8179 sth r4, 4(r6)
8280 blr
8381 EXPORT_SYMBOL(memset16)
82
+#endif
8483
8584 /*
8685 * Use dcbz on the complete cache lines in the destination
....@@ -91,7 +90,7 @@
9190 * We therefore skip the optimised bloc that uses dcbz. This jump is
9291 * replaced by a nop once cache is active. This is done in machine_init()
9392 */
94
-_GLOBAL(memset)
93
+_GLOBAL_KASAN(memset)
9594 cmplwi 0,r5,4
9695 blt 7f
9796
....@@ -151,6 +150,7 @@
151150 bdnz 9b
152151 blr
153152 EXPORT_SYMBOL(memset)
153
+EXPORT_SYMBOL_KASAN(memset)
154154
155155 /*
156156 * This version uses dcbz on the complete cache lines in the
....@@ -163,12 +163,12 @@
163163 * We therefore jump to generic_memcpy which doesn't use dcbz. This jump is
164164 * replaced by a nop once cache is active. This is done in machine_init()
165165 */
166
-_GLOBAL(memmove)
166
+_GLOBAL_KASAN(memmove)
167167 cmplw 0,r3,r4
168168 bgt backwards_memcpy
169169 /* fall through */
170170
171
-_GLOBAL(memcpy)
171
+_GLOBAL_KASAN(memcpy)
172172 1: b generic_memcpy
173173 patch_site 1b, patch__memcpy_nocache
174174
....@@ -244,6 +244,8 @@
244244 65: blr
245245 EXPORT_SYMBOL(memcpy)
246246 EXPORT_SYMBOL(memmove)
247
+EXPORT_SYMBOL_KASAN(memcpy)
248
+EXPORT_SYMBOL_KASAN(memmove)
247249
248250 generic_memcpy:
249251 srwi. r7,r5,3