hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/arm64/kernel/entry.S
....@@ -297,7 +297,7 @@
297297 alternative_else_nop_endif
298298 1:
299299
300
- scs_load tsk, x20
300
+ scs_load_current
301301 .else
302302 add x21, sp, #S_FRAME_SIZE
303303 get_current_task tsk
....@@ -1122,7 +1122,7 @@
11221122 msr sp_el0, x1
11231123 ptrauth_keys_install_kernel x1, x8, x9, x10
11241124 scs_save x0, x8
1125
- scs_load x1, x8
1125
+ scs_load_current
11261126 ret
11271127 SYM_FUNC_END(cpu_switch_to)
11281128 NOKPROBE(cpu_switch_to)
....@@ -1238,9 +1238,13 @@
12381238
12391239 mov x19, x1
12401240
1241
-#if defined(CONFIG_VMAP_STACK) || defined(CONFIG_SHADOW_CALL_STACK)
1241
+ /* Store the registered-event for crash_smp_send_stop() */
12421242 ldrb w4, [x19, #SDEI_EVENT_PRIORITY]
1243
-#endif
1243
+ cbnz w4, 1f
1244
+ adr_this_cpu dst=x5, sym=sdei_active_normal_event, tmp=x6
1245
+ b 2f
1246
+1: adr_this_cpu dst=x5, sym=sdei_active_critical_event, tmp=x6
1247
+2: str x19, [x5]
12441248
12451249 #ifdef CONFIG_VMAP_STACK
12461250 /*
....@@ -1305,6 +1309,14 @@
13051309
13061310 ldr_l x2, sdei_exit_mode
13071311
1312
+ /* Clear the registered-event seen by crash_smp_send_stop() */
1313
+ ldrb w3, [x4, #SDEI_EVENT_PRIORITY]
1314
+ cbnz w3, 1f
1315
+ adr_this_cpu dst=x5, sym=sdei_active_normal_event, tmp=x6
1316
+ b 2f
1317
+1: adr_this_cpu dst=x5, sym=sdei_active_critical_event, tmp=x6
1318
+2: str xzr, [x5]
1319
+
13081320 alternative_if_not ARM64_UNMAP_KERNEL_AT_EL0
13091321 sdei_handler_exit exit_mode=x2
13101322 alternative_else_nop_endif
....@@ -1315,4 +1327,15 @@
13151327 #endif
13161328 SYM_CODE_END(__sdei_asm_handler)
13171329 NOKPROBE(__sdei_asm_handler)
1330
+
1331
+SYM_CODE_START(__sdei_handler_abort)
1332
+ mov_q x0, SDEI_1_0_FN_SDEI_EVENT_COMPLETE_AND_RESUME
1333
+ adr x1, 1f
1334
+ ldr_l x2, sdei_exit_mode
1335
+ sdei_handler_exit exit_mode=x2
1336
+ // exit the handler and jump to the next instruction.
1337
+ // Exit will stomp x0-x17, PSTATE, ELR_ELx, and SPSR_ELx.
1338
+1: ret
1339
+SYM_CODE_END(__sdei_handler_abort)
1340
+NOKPROBE(__sdei_handler_abort)
13181341 #endif /* CONFIG_ARM_SDE_INTERFACE */