hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/powerpc/kernel/head_44x.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Kernel execution entry point code.
34 *
....@@ -21,18 +22,13 @@
2122 * debbie_chu@mvista.com
2223 * Copyright 2002-2005 MontaVista Software, Inc.
2324 * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
24
- *
25
- * This program is free software; you can redistribute it and/or modify it
26
- * under the terms of the GNU General Public License as published by the
27
- * Free Software Foundation; either version 2 of the License, or (at your
28
- * option) any later version.
2925 */
3026
3127 #include <linux/init.h>
28
+#include <linux/pgtable.h>
3229 #include <asm/processor.h>
3330 #include <asm/page.h>
3431 #include <asm/mmu.h>
35
-#include <asm/pgtable.h>
3632 #include <asm/cputable.h>
3733 #include <asm/thread_info.h>
3834 #include <asm/ppc_asm.h>
....@@ -40,6 +36,7 @@
4036 #include <asm/ptrace.h>
4137 #include <asm/synch.h>
4238 #include <asm/export.h>
39
+#include <asm/code-patching-asm.h>
4340 #include "head_booke.h"
4441
4542
....@@ -202,6 +199,9 @@
202199 /*
203200 * Decide what sort of machine this is and initialize the MMU.
204201 */
202
+#ifdef CONFIG_KASAN
203
+ bl kasan_early_init
204
+#endif
205205 li r3,0
206206 mr r4,r31
207207 bl machine_init
....@@ -277,16 +277,15 @@
277277 FP_UNAVAILABLE_EXCEPTION
278278 #else
279279 EXCEPTION(0x2010, BOOKE_INTERRUPT_FP_UNAVAIL, \
280
- FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
280
+ FloatingPointUnavailable, unknown_exception, EXC_XFER_STD)
281281 #endif
282282 /* System Call Interrupt */
283283 START_EXCEPTION(SystemCall)
284
- NORMAL_EXCEPTION_PROLOG(BOOKE_INTERRUPT_SYSCALL)
285
- EXC_XFER_EE_LITE(0x0c00, DoSyscall)
284
+ SYSCALL_ENTRY 0xc00 BOOKE_INTERRUPT_SYSCALL
286285
287286 /* Auxiliary Processor Unavailable Interrupt */
288287 EXCEPTION(0x2020, BOOKE_INTERRUPT_AP_UNAVAIL, \
289
- AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
288
+ AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_STD)
290289
291290 /* Decrementer Interrupt */
292291 DECREMENTER_EXCEPTION
....@@ -294,7 +293,7 @@
294293 /* Fixed Internal Timer Interrupt */
295294 /* TODO: Add FIT support */
296295 EXCEPTION(0x1010, BOOKE_INTERRUPT_FIT, FixedIntervalTimer, \
297
- unknown_exception, EXC_XFER_EE)
296
+ unknown_exception, EXC_XFER_STD)
298297
299298 /* Watchdog Timer Interrupt */
300299 /* TODO: Add watchdog support */
....@@ -382,10 +381,9 @@
382381 /* Increment, rollover, and store TLB index */
383382 addi r13,r13,1
384383
384
+ patch_site 0f, patch__tlb_44x_hwater_D
385385 /* Compare with watermark (instruction gets patched) */
386
- .globl tlb_44x_patch_hwater_D
387
-tlb_44x_patch_hwater_D:
388
- cmpwi 0,r13,1 /* reserve entries */
386
+0: cmpwi 0,r13,1 /* reserve entries */
389387 ble 5f
390388 li r13,0
391389 5:
....@@ -478,10 +476,9 @@
478476 /* Increment, rollover, and store TLB index */
479477 addi r13,r13,1
480478
479
+ patch_site 0f, patch__tlb_44x_hwater_I
481480 /* Compare with watermark (instruction gets patched) */
482
- .globl tlb_44x_patch_hwater_I
483
-tlb_44x_patch_hwater_I:
484
- cmpwi 0,r13,1 /* reserve entries */
481
+0: cmpwi 0,r13,1 /* reserve entries */
485482 ble 5f
486483 li r13,0
487484 5:
....@@ -1020,10 +1017,10 @@
10201017
10211018 /* Now we can get our task struct and real stack pointer */
10221019
1023
- /* Get current_thread_info and current */
1024
- lis r1,secondary_ti@ha
1025
- lwz r1,secondary_ti@l(r1)
1026
- lwz r2,TI_TASK(r1)
1020
+ /* Get current's stack and current */
1021
+ lis r2,secondary_current@ha
1022
+ lwz r2,secondary_current@l(r2)
1023
+ lwz r1,TASK_STACK(r2)
10271024
10281025 /* Current stack pointer */
10291026 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD