aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/lib/memset.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-12-03 16:28:52 -0500
committerMax Filippov <jcmvbkbc@gmail.com>2017-12-17 01:37:12 -0500
commitc633544a6154146a210cf158157a1ae7c55473b6 (patch)
treed670a9984373622d991c382126f341b6f32154cd /arch/xtensa/lib/memset.S
parent1af1e8a39dc0fab5e50f10462c636da8c1e0cfbb (diff)
xtensa: add support for KASAN
Cover kernel addresses above 0x90000000 by the shadow map. Enable HAVE_ARCH_KASAN when MMU is enabled. Provide kasan_early_init that fills shadow map with writable copies of kasan_zero_page. Call kasan_early_init right after mmu initialization in the setup_arch. Provide kasan_init that allocates proper shadow map pages from the memblock and puts these pages into the shadow map for addresses from VMALLOC area to the end of KSEG. Call kasan_init right after memblock initialization. Don't use KASAN for the boot code, MMU and KASAN initialization and page fault handler. Make kernel stack size 4 times larger when KASAN is enabled to avoid stack overflows. GCC 7.3, 8 or newer is required to build the xtensa kernel with KASAN. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/lib/memset.S')
-rw-r--r--arch/xtensa/lib/memset.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/xtensa/lib/memset.S b/arch/xtensa/lib/memset.S
index a6cd04ba966f..276747dec300 100644
--- a/arch/xtensa/lib/memset.S
+++ b/arch/xtensa/lib/memset.S
@@ -31,7 +31,8 @@
31 */ 31 */
32 32
33.text 33.text
34ENTRY(memset) 34ENTRY(__memset)
35WEAK(memset)
35 36
36 entry sp, 16 # minimal stack frame 37 entry sp, 16 # minimal stack frame
37 # a2/ dst, a3/ c, a4/ length 38 # a2/ dst, a3/ c, a4/ length
@@ -140,7 +141,7 @@ EX(10f) s8i a3, a5, 0
140.Lbytesetdone: 141.Lbytesetdone:
141 retw 142 retw
142 143
143ENDPROC(memset) 144ENDPROC(__memset)
144 145
145 .section .fixup, "ax" 146 .section .fixup, "ax"
146 .align 4 147 .align 4