2 * S390 low-level entry points.
4 * Copyright IBM Corp. 1999, 2012
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
6 * Hartmut Penner (hp@de.ibm.com),
7 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
8 * Heiko Carstens <heiko.carstens@de.ibm.com>
11 #include <linux/init.h>
12 #include <linux/linkage.h>
13 #include <asm/processor.h>
14 #include <asm/cache.h>
15 #include <asm/errno.h>
16 #include <asm/ptrace.h>
17 #include <asm/thread_info.h>
18 #include <asm/asm-offsets.h>
19 #include <asm/unistd.h>
23 #include <asm/vx-insn.h>
24 #include <asm/setup.h>
26 #include <asm/export.h>
29 __PT_R1 = __PT_GPRS + 8
30 __PT_R2 = __PT_GPRS + 16
31 __PT_R3 = __PT_GPRS + 24
32 __PT_R4 = __PT_GPRS + 32
33 __PT_R5 = __PT_GPRS + 40
34 __PT_R6 = __PT_GPRS + 48
35 __PT_R7 = __PT_GPRS + 56
36 __PT_R8 = __PT_GPRS + 64
37 __PT_R9 = __PT_GPRS + 72
38 __PT_R10 = __PT_GPRS + 80
39 __PT_R11 = __PT_GPRS + 88
40 __PT_R12 = __PT_GPRS + 96
41 __PT_R13 = __PT_GPRS + 104
42 __PT_R14 = __PT_GPRS + 112
43 __PT_R15 = __PT_GPRS + 120
45 STACK_SHIFT = PAGE_SHIFT + THREAD_SIZE_ORDER
46 STACK_SIZE = 1 << STACK_SHIFT
47 STACK_INIT = STACK_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE
49 _TIF_WORK = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
50 _TIF_UPROBE | _TIF_GUARDED_STORAGE | _TIF_PATCH_PENDING)
51 _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \
52 _TIF_SYSCALL_TRACEPOINT)
53 _CIF_WORK = (_CIF_MCCK_PENDING | _CIF_ASCE_PRIMARY | \
54 _CIF_ASCE_SECONDARY | _CIF_FPU)
55 _PIF_WORK = (_PIF_PER_TRAP | _PIF_SYSCALL_RESTART)
57 #define BASED(name) name-cleanup_critical(%r13)
60 #ifdef CONFIG_TRACE_IRQFLAGS
62 brasl %r14,trace_hardirqs_on_caller
67 #ifdef CONFIG_TRACE_IRQFLAGS
69 brasl %r14,trace_hardirqs_off_caller
73 .macro LOCKDEP_SYS_EXIT
75 tm __PT_PSW+1(%r11),0x01 # returning to user ?
77 brasl %r14,lockdep_sys_exit
81 .macro CHECK_STACK stacksize,savearea
82 #ifdef CONFIG_CHECK_STACK
83 tml %r15,\stacksize - CONFIG_STACK_GUARD
89 .macro SWITCH_ASYNC savearea,timer
90 tmhh %r8,0x0001 # interrupting from user ?
93 slg %r14,BASED(.Lcritical_start)
94 clg %r14,BASED(.Lcritical_length)
96 lghi %r11,\savearea # inside critical section, do cleanup
97 brasl %r14,cleanup_critical
98 tmhh %r8,0x0001 # retest problem state after cleanup
100 0: lg %r14,__LC_ASYNC_STACK # are we already on the async stack?
102 srag %r14,%r14,STACK_SHIFT
104 CHECK_STACK 1<<STACK_SHIFT,\savearea
105 aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
107 1: UPDATE_VTIME %r14,%r15,\timer
108 2: lg %r15,__LC_ASYNC_STACK # load async stack
109 3: la %r11,STACK_FRAME_OVERHEAD(%r15)
112 .macro UPDATE_VTIME w1,w2,enter_timer
113 lg \w1,__LC_EXIT_TIMER
114 lg \w2,__LC_LAST_UPDATE_TIMER
116 slg \w2,__LC_EXIT_TIMER
117 alg \w1,__LC_USER_TIMER
118 alg \w2,__LC_SYSTEM_TIMER
119 stg \w1,__LC_USER_TIMER
120 stg \w2,__LC_SYSTEM_TIMER
121 mvc __LC_LAST_UPDATE_TIMER(8),\enter_timer
125 stg %r8,__LC_RETURN_PSW
126 ni __LC_RETURN_PSW,0xbf
131 #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
132 .insn s,0xb27c0000,\savearea # store clock fast
134 .insn s,0xb2050000,\savearea # store clock
139 * The TSTMSK macro generates a test-under-mask instruction by
140 * calculating the memory offset for the specified mask value.
141 * Mask value can be any constant. The macro shifts the mask
142 * value to calculate the memory offset for the test-under-mask
145 .macro TSTMSK addr, mask, size=8, bytepos=0
146 .if (\bytepos < \size) && (\mask >> 8)
148 .error "Mask exceeds byte boundary"
150 TSTMSK \addr, "(\mask >> 8)", \size, "(\bytepos + 1)"
154 .error "Mask must not be zero"
156 off = \size - \bytepos - 1
160 .section .kprobes.text, "ax"
163 * This nop exists only in order to avoid that __switch_to starts at
164 * the beginning of the kprobes text section. In that case we would
165 * have several symbols at the same address. E.g. objdump would take
166 * an arbitrary symbol name when disassembling this code.
167 * With the added nop in between the __switch_to symbol is unique
173 * Scheduler resume function, called by switch_to
174 * gpr2 = (task_struct *) prev
175 * gpr3 = (task_struct *) next
180 stmg %r6,%r15,__SF_GPRS(%r15) # store gprs of prev task
182 aghi %r1,__TASK_thread # thread_struct of prev task
183 lg %r5,__TASK_stack(%r3) # start of kernel stack of next
184 stg %r15,__THREAD_ksp(%r1) # store kernel stack of prev
186 aghi %r1,__TASK_thread # thread_struct of next task
188 aghi %r15,STACK_INIT # end of kernel stack of next
189 stg %r3,__LC_CURRENT # store task struct of next
190 stg %r15,__LC_KERNEL_STACK # store end of kernel stack
191 lg %r15,__THREAD_ksp(%r1) # load kernel stack of next
192 mvc __LC_CURRENT_PID(4,%r0),__TASK_pid(%r3) # store pid of next
193 lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task
194 TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_LPP
196 .insn s,0xb2800000,__LC_LPP # set program parameter
201 #if IS_ENABLED(CONFIG_KVM)
203 * sie64a calling convention:
204 * %r2 pointer to sie control block
205 * %r3 guest register save area
208 stmg %r6,%r14,__SF_GPRS(%r15) # save kernel registers
209 stg %r2,__SF_EMPTY(%r15) # save control block pointer
210 stg %r3,__SF_EMPTY+8(%r15) # save guest register save area
211 xc __SF_EMPTY+16(8,%r15),__SF_EMPTY+16(%r15) # reason code = 0
212 TSTMSK __LC_CPU_FLAGS,_CIF_FPU # load guest fp/vx registers ?
213 jno .Lsie_load_guest_gprs
214 brasl %r14,load_fpu_regs # load guest fp/vx regs
215 .Lsie_load_guest_gprs:
216 lmg %r0,%r13,0(%r3) # load guest gprs 0-13
217 lg %r14,__LC_GMAP # get gmap pointer
220 lctlg %c1,%c1,__GMAP_ASCE(%r14) # load primary asce
222 lg %r14,__SF_EMPTY(%r15) # get control block pointer
223 oi __SIE_PROG0C+3(%r14),1 # we are going into SIE now
224 tm __SIE_PROG20+3(%r14),3 # last exit...
226 TSTMSK __LC_CPU_FLAGS,_CIF_FPU
227 jo .Lsie_skip # exit if fp/vx regs changed
231 ni __SIE_PROG0C+3(%r14),0xfe # no longer in SIE
232 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
234 # some program checks are suppressing. C code (e.g. do_protection_exception)
235 # will rewind the PSW by the ILC, which is often 4 bytes in case of SIE. There
236 # are some corner cases (e.g. runtime instrumentation) where ILC is unpredictable.
237 # Other instructions between sie64a and .Lsie_done should not cause program
238 # interrupts. So lets use 3 nops as a landing pad for all possible rewinds.
239 # See also .Lcleanup_sie
248 lg %r14,__SF_EMPTY+8(%r15) # load guest register save area
249 stmg %r0,%r13,0(%r14) # save guest gprs 0-13
250 lmg %r6,%r14,__SF_GPRS(%r15) # restore kernel registers
251 lg %r2,__SF_EMPTY+16(%r15) # return exit reason code
255 stg %r14,__SF_EMPTY+16(%r15) # set exit reason code
258 EX_TABLE(.Lrewind_pad6,.Lsie_fault)
259 EX_TABLE(.Lrewind_pad4,.Lsie_fault)
260 EX_TABLE(.Lrewind_pad2,.Lsie_fault)
261 EX_TABLE(sie_exit,.Lsie_fault)
262 EXPORT_SYMBOL(sie64a)
263 EXPORT_SYMBOL(sie_exit)
267 * SVC interrupt handler routine. System calls are synchronous events and
268 * are executed with interrupts enabled.
272 stpt __LC_SYNC_ENTER_TIMER
274 stmg %r8,%r15,__LC_SAVE_AREA_SYNC
276 lghi %r13,__TASK_thread
277 lghi %r14,_PIF_SYSCALL
279 lg %r15,__LC_KERNEL_STACK
280 la %r11,STACK_FRAME_OVERHEAD(%r15) # pointer to pt_regs
282 UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER
283 stmg %r0,%r7,__PT_R0(%r11)
284 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC
285 mvc __PT_PSW(16,%r11),__LC_SVC_OLD_PSW
286 mvc __PT_INT_CODE(4,%r11),__LC_SVC_ILC
287 stg %r14,__PT_FLAGS(%r11)
289 # load address of system call table
290 lg %r10,__THREAD_sysc_table(%r13,%r12)
291 llgh %r8,__PT_INT_CODE+2(%r11)
292 slag %r8,%r8,2 # shift and test for svc 0
294 # svc 0: system call number in %r1
295 llgfr %r1,%r1 # clear high word in r1
298 sth %r1,__PT_INT_CODE+2(%r11)
301 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
302 stg %r2,__PT_ORIG_GPR2(%r11)
303 stg %r7,STACK_FRAME_OVERHEAD(%r15)
304 lgf %r9,0(%r8,%r10) # get system call add.
305 TSTMSK __TI_flags(%r12),_TIF_TRACE
307 basr %r14,%r9 # call sys_xxxx
308 stg %r2,__PT_R2(%r11) # store return value
313 TSTMSK __PT_FLAGS(%r11),_PIF_WORK
315 TSTMSK __TI_flags(%r12),_TIF_WORK
316 jnz .Lsysc_work # check for work
317 TSTMSK __LC_CPU_FLAGS,_CIF_WORK
320 lg %r14,__LC_VDSO_PER_CPU
321 lmg %r0,%r10,__PT_R0(%r11)
322 mvc __LC_RETURN_PSW(16),__PT_PSW(%r11)
325 mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER
326 lmg %r11,%r15,__PT_R11(%r11)
327 lpswe __LC_RETURN_PSW
331 # One of the work bits is on. Find out which one.
334 TSTMSK __LC_CPU_FLAGS,_CIF_MCCK_PENDING
335 jo .Lsysc_mcck_pending
336 TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED
338 TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART
339 jo .Lsysc_syscall_restart
340 #ifdef CONFIG_UPROBES
341 TSTMSK __TI_flags(%r12),_TIF_UPROBE
342 jo .Lsysc_uprobe_notify
344 TSTMSK __TI_flags(%r12),_TIF_GUARDED_STORAGE
345 jo .Lsysc_guarded_storage
346 TSTMSK __PT_FLAGS(%r11),_PIF_PER_TRAP
348 #ifdef CONFIG_LIVEPATCH
349 TSTMSK __TI_flags(%r12),_TIF_PATCH_PENDING
350 jo .Lsysc_patch_pending # handle live patching just before
351 # signals and possible syscall restart
353 TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART
354 jo .Lsysc_syscall_restart
355 TSTMSK __TI_flags(%r12),_TIF_SIGPENDING
357 TSTMSK __TI_flags(%r12),_TIF_NOTIFY_RESUME
358 jo .Lsysc_notify_resume
359 TSTMSK __LC_CPU_FLAGS,_CIF_FPU
361 TSTMSK __LC_CPU_FLAGS,(_CIF_ASCE_PRIMARY|_CIF_ASCE_SECONDARY)
363 j .Lsysc_return # beware of critical section cleanup
366 # _TIF_NEED_RESCHED is set, call schedule
369 larl %r14,.Lsysc_return
373 # _CIF_MCCK_PENDING is set, call handler
376 larl %r14,.Lsysc_return
377 jg s390_handle_mcck # TIF bit will be cleared by handler
380 # _CIF_ASCE_PRIMARY and/or CIF_ASCE_SECONDARY set, load user space asce
383 ni __LC_CPU_FLAGS+7,255-_CIF_ASCE_PRIMARY
384 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
385 TSTMSK __LC_CPU_FLAGS,_CIF_ASCE_SECONDARY
387 larl %r14,.Lsysc_return
391 # CIF_FPU is set, restore floating-point controls and floating-point registers.
394 larl %r14,.Lsysc_return
398 # _TIF_SIGPENDING is set, call do_signal
401 lgr %r2,%r11 # pass pointer to pt_regs
403 TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL
406 lghi %r13,__TASK_thread
407 lmg %r2,%r7,__PT_R2(%r11) # load svc arguments
408 lghi %r1,0 # svc 0 returns -ENOSYS
412 # _TIF_NOTIFY_RESUME is set, call do_notify_resume
414 .Lsysc_notify_resume:
415 lgr %r2,%r11 # pass pointer to pt_regs
416 larl %r14,.Lsysc_return
420 # _TIF_UPROBE is set, call uprobe_notify_resume
422 #ifdef CONFIG_UPROBES
423 .Lsysc_uprobe_notify:
424 lgr %r2,%r11 # pass pointer to pt_regs
425 larl %r14,.Lsysc_return
426 jg uprobe_notify_resume
430 # _TIF_GUARDED_STORAGE is set, call guarded_storage_load
432 .Lsysc_guarded_storage:
433 lgr %r2,%r11 # pass pointer to pt_regs
434 larl %r14,.Lsysc_return
437 # _TIF_PATCH_PENDING is set, call klp_update_patch_state
439 #ifdef CONFIG_LIVEPATCH
440 .Lsysc_patch_pending:
441 lg %r2,__LC_CURRENT # pass pointer to task struct
442 larl %r14,.Lsysc_return
443 jg klp_update_patch_state
447 # _PIF_PER_TRAP is set, call do_per_trap
450 ni __PT_FLAGS+7(%r11),255-_PIF_PER_TRAP
451 lgr %r2,%r11 # pass pointer to pt_regs
452 larl %r14,.Lsysc_return
456 # _PIF_SYSCALL_RESTART is set, repeat the current system call
458 .Lsysc_syscall_restart:
459 ni __PT_FLAGS+7(%r11),255-_PIF_SYSCALL_RESTART
460 lmg %r1,%r7,__PT_R1(%r11) # load svc arguments
461 lg %r2,__PT_ORIG_GPR2(%r11)
465 # call tracehook_report_syscall_entry/tracehook_report_syscall_exit before
466 # and after the system call
469 lgr %r2,%r11 # pass pointer to pt_regs
471 llgh %r0,__PT_INT_CODE+2(%r11)
472 stg %r0,__PT_R2(%r11)
473 brasl %r14,do_syscall_trace_enter
480 lmg %r3,%r7,__PT_R3(%r11)
481 stg %r7,STACK_FRAME_OVERHEAD(%r15)
482 lg %r2,__PT_ORIG_GPR2(%r11)
483 basr %r14,%r9 # call sys_xxx
484 stg %r2,__PT_R2(%r11) # store return value
486 TSTMSK __TI_flags(%r12),_TIF_TRACE
488 lgr %r2,%r11 # pass pointer to pt_regs
489 larl %r14,.Lsysc_return
490 jg do_syscall_trace_exit
493 # a new process exits the kernel with ret_from_fork
496 la %r11,STACK_FRAME_OVERHEAD(%r15)
498 brasl %r14,schedule_tail
500 ssm __LC_SVC_NEW_PSW # reenable interrupts
501 tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
503 # it's a kernel thread
504 lmg %r9,%r10,__PT_R9(%r11) # load gprs
505 ENTRY(kernel_thread_starter)
511 * Program check handler routine
514 ENTRY(pgm_check_handler)
515 stpt __LC_SYNC_ENTER_TIMER
516 stmg %r8,%r15,__LC_SAVE_AREA_SYNC
517 lg %r10,__LC_LAST_BREAK
519 larl %r13,cleanup_critical
520 lmg %r8,%r9,__LC_PGM_OLD_PSW
521 tmhh %r8,0x0001 # test problem state bit
522 jnz 2f # -> fault in user space
523 #if IS_ENABLED(CONFIG_KVM)
524 # cleanup critical section for program checks in sie64a
526 slg %r14,BASED(.Lsie_critical_start)
527 clg %r14,BASED(.Lsie_critical_length)
529 lg %r14,__SF_EMPTY(%r15) # get control block pointer
530 ni __SIE_PROG0C+3(%r14),0xfe # no longer in SIE
531 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
532 larl %r9,sie_exit # skip forward to sie_exit
534 0: tmhh %r8,0x4000 # PER bit set in old PSW ?
535 jnz 1f # -> enabled, can't be a double fault
536 tm __LC_PGM_ILC+3,0x80 # check for per exception
537 jnz .Lpgm_svcper # -> single stepped svc
538 1: CHECK_STACK STACK_SIZE,__LC_SAVE_AREA_SYNC
539 aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
541 2: UPDATE_VTIME %r14,%r15,__LC_SYNC_ENTER_TIMER
542 lg %r15,__LC_KERNEL_STACK
544 aghi %r14,__TASK_thread # pointer to thread_struct
545 lghi %r13,__LC_PGM_TDB
546 tm __LC_PGM_ILC+2,0x02 # check for transaction abort
548 mvc __THREAD_trap_tdb(256,%r14),0(%r13)
549 3: stg %r10,__THREAD_last_break(%r14)
550 4: la %r11,STACK_FRAME_OVERHEAD(%r15)
551 stmg %r0,%r7,__PT_R0(%r11)
552 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC
553 stmg %r8,%r9,__PT_PSW(%r11)
554 mvc __PT_INT_CODE(4,%r11),__LC_PGM_ILC
555 mvc __PT_INT_PARM_LONG(8,%r11),__LC_TRANS_EXC_CODE
556 xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
557 stg %r10,__PT_ARGS(%r11)
558 tm __LC_PGM_ILC+3,0x80 # check for per exception
560 tmhh %r8,0x0001 # kernel per event ?
562 oi __PT_FLAGS+7(%r11),_PIF_PER_TRAP
563 mvc __THREAD_per_address(8,%r14),__LC_PER_ADDRESS
564 mvc __THREAD_per_cause(2,%r14),__LC_PER_CODE
565 mvc __THREAD_per_paid(1,%r14),__LC_PER_ACCESS_ID
567 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
568 larl %r1,pgm_check_table
569 llgh %r10,__PT_INT_CODE+2(%r11)
573 lgf %r1,0(%r10,%r1) # load address of handler routine
574 lgr %r2,%r11 # pass pointer to pt_regs
575 basr %r14,%r1 # branch to interrupt-handler
578 tm __PT_PSW+1(%r11),0x01 # returning to user ?
580 TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL
585 # PER event in supervisor state, must be kprobes
589 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
590 lgr %r2,%r11 # pass pointer to pt_regs
591 brasl %r14,do_per_trap
595 # single stepped system call
598 mvc __LC_RETURN_PSW(8),__LC_SVC_NEW_PSW
599 lghi %r13,__TASK_thread
601 stg %r14,__LC_RETURN_PSW+8
602 lghi %r14,_PIF_SYSCALL | _PIF_PER_TRAP
603 lpswe __LC_RETURN_PSW # branch to .Lsysc_per and enable irqs
606 * IO interrupt handler routine
608 ENTRY(io_int_handler)
610 stpt __LC_ASYNC_ENTER_TIMER
611 stmg %r8,%r15,__LC_SAVE_AREA_ASYNC
613 larl %r13,cleanup_critical
614 lmg %r8,%r9,__LC_IO_OLD_PSW
615 SWITCH_ASYNC __LC_SAVE_AREA_ASYNC,__LC_ASYNC_ENTER_TIMER
616 stmg %r0,%r7,__PT_R0(%r11)
617 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC
618 stmg %r8,%r9,__PT_PSW(%r11)
619 mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
620 xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
621 TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ
624 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
626 lgr %r2,%r11 # pass pointer to pt_regs
627 lghi %r3,IO_INTERRUPT
628 tm __PT_INT_CODE+8(%r11),0x80 # adapter interrupt ?
630 lghi %r3,THIN_INTERRUPT
633 TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_LPAR
637 mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
643 TSTMSK __TI_flags(%r12),_TIF_WORK
644 jnz .Lio_work # there is work to do (signals etc.)
645 TSTMSK __LC_CPU_FLAGS,_CIF_WORK
648 lg %r14,__LC_VDSO_PER_CPU
649 lmg %r0,%r10,__PT_R0(%r11)
650 mvc __LC_RETURN_PSW(16),__PT_PSW(%r11)
653 mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER
654 lmg %r11,%r15,__PT_R11(%r11)
655 lpswe __LC_RETURN_PSW
659 # There is work todo, find out in which context we have been interrupted:
660 # 1) if we return to user space we can do all _TIF_WORK work
661 # 2) if we return to kernel code and kvm is enabled check if we need to
662 # modify the psw to leave SIE
663 # 3) if we return to kernel code and preemptive scheduling is enabled check
664 # the preemption counter and if it is zero call preempt_schedule_irq
665 # Before any work can be done, a switch to the kernel stack is required.
668 tm __PT_PSW+1(%r11),0x01 # returning to user ?
669 jo .Lio_work_user # yes -> do resched & signal
670 #ifdef CONFIG_PREEMPT
671 # check for preemptive scheduling
672 icm %r0,15,__LC_PREEMPT_COUNT
673 jnz .Lio_restore # preemption is disabled
674 TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED
676 # switch to kernel stack
677 lg %r1,__PT_R15(%r11)
678 aghi %r1,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
679 mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11)
680 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1)
681 la %r11,STACK_FRAME_OVERHEAD(%r1)
683 # TRACE_IRQS_ON already done at .Lio_return, call
684 # TRACE_IRQS_OFF to keep things symmetrical
686 brasl %r14,preempt_schedule_irq
693 # Need to do work before returning to userspace, switch to kernel stack
696 lg %r1,__LC_KERNEL_STACK
697 mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11)
698 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1)
699 la %r11,STACK_FRAME_OVERHEAD(%r1)
703 # One of the work bits is on. Find out which one.
706 TSTMSK __LC_CPU_FLAGS,_CIF_MCCK_PENDING
708 TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED
710 #ifdef CONFIG_LIVEPATCH
711 TSTMSK __TI_flags(%r12),_TIF_PATCH_PENDING
712 jo .Lio_patch_pending
714 TSTMSK __TI_flags(%r12),_TIF_SIGPENDING
716 TSTMSK __TI_flags(%r12),_TIF_NOTIFY_RESUME
717 jo .Lio_notify_resume
718 TSTMSK __TI_flags(%r12),_TIF_GUARDED_STORAGE
719 jo .Lio_guarded_storage
720 TSTMSK __LC_CPU_FLAGS,_CIF_FPU
722 TSTMSK __LC_CPU_FLAGS,(_CIF_ASCE_PRIMARY|_CIF_ASCE_SECONDARY)
724 j .Lio_return # beware of critical section cleanup
727 # _CIF_MCCK_PENDING is set, call handler
730 # TRACE_IRQS_ON already done at .Lio_return
731 brasl %r14,s390_handle_mcck # TIF bit will be cleared by handler
736 # _CIF_ASCE_PRIMARY and/or CIF_ASCE_SECONDARY set, load user space asce
739 ni __LC_CPU_FLAGS+7,255-_CIF_ASCE_PRIMARY
740 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
741 TSTMSK __LC_CPU_FLAGS,_CIF_ASCE_SECONDARY
743 larl %r14,.Lio_return
747 # CIF_FPU is set, restore floating-point controls and floating-point registers.
750 larl %r14,.Lio_return
754 # _TIF_GUARDED_STORAGE is set, call guarded_storage_load
756 .Lio_guarded_storage:
757 # TRACE_IRQS_ON already done at .Lio_return
758 ssm __LC_SVC_NEW_PSW # reenable interrupts
759 lgr %r2,%r11 # pass pointer to pt_regs
760 brasl %r14,gs_load_bc_cb
761 ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts
766 # _TIF_NEED_RESCHED is set, call schedule
769 # TRACE_IRQS_ON already done at .Lio_return
770 ssm __LC_SVC_NEW_PSW # reenable interrupts
771 brasl %r14,schedule # call scheduler
772 ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts
777 # _TIF_PATCH_PENDING is set, call klp_update_patch_state
779 #ifdef CONFIG_LIVEPATCH
781 lg %r2,__LC_CURRENT # pass pointer to task struct
782 larl %r14,.Lio_return
783 jg klp_update_patch_state
787 # _TIF_SIGPENDING or is set, call do_signal
790 # TRACE_IRQS_ON already done at .Lio_return
791 ssm __LC_SVC_NEW_PSW # reenable interrupts
792 lgr %r2,%r11 # pass pointer to pt_regs
794 ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts
799 # _TIF_NOTIFY_RESUME or is set, call do_notify_resume
802 # TRACE_IRQS_ON already done at .Lio_return
803 ssm __LC_SVC_NEW_PSW # reenable interrupts
804 lgr %r2,%r11 # pass pointer to pt_regs
805 brasl %r14,do_notify_resume
806 ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts
811 * External interrupt handler routine
813 ENTRY(ext_int_handler)
815 stpt __LC_ASYNC_ENTER_TIMER
816 stmg %r8,%r15,__LC_SAVE_AREA_ASYNC
818 larl %r13,cleanup_critical
819 lmg %r8,%r9,__LC_EXT_OLD_PSW
820 SWITCH_ASYNC __LC_SAVE_AREA_ASYNC,__LC_ASYNC_ENTER_TIMER
821 stmg %r0,%r7,__PT_R0(%r11)
822 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC
823 stmg %r8,%r9,__PT_PSW(%r11)
824 lghi %r1,__LC_EXT_PARAMS2
825 mvc __PT_INT_CODE(4,%r11),__LC_EXT_CPU_ADDR
826 mvc __PT_INT_PARM(4,%r11),__LC_EXT_PARAMS
827 mvc __PT_INT_PARM_LONG(8,%r11),0(%r1)
828 xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
829 TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ
832 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
833 lgr %r2,%r11 # pass pointer to pt_regs
834 lghi %r3,EXT_INTERRUPT
839 * Load idle PSW. The second "half" of this function is in .Lcleanup_idle.
842 stg %r3,__SF_EMPTY(%r15)
843 larl %r1,.Lpsw_idle_lpsw+4
844 stg %r1,__SF_EMPTY+8(%r15)
846 larl %r1,smp_cpu_mtid
850 .insn rsy,0xeb0000000017,%r1,5,__SF_EMPTY+16(%r15)
853 oi __LC_CPU_FLAGS+7,_CIF_ENABLED_WAIT
854 STCK __CLOCK_IDLE_ENTER(%r2)
855 stpt __TIMER_IDLE_ENTER(%r2)
857 lpswe __SF_EMPTY(%r15)
862 * Store floating-point controls and floating-point or vector register
863 * depending whether the vector facility is available. A critical section
864 * cleanup assures that the registers are stored even if interrupted for
865 * some other work. The CIF_FPU flag is set to trigger a lazy restore
866 * of the register contents at return from io or a system call.
870 aghi %r2,__TASK_thread
871 TSTMSK __LC_CPU_FLAGS,_CIF_FPU
873 stfpc __THREAD_FPU_fpc(%r2)
874 lg %r3,__THREAD_FPU_regs(%r2)
875 TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX
876 jz .Lsave_fpu_regs_fp # no -> store FP regs
877 VSTM %v0,%v15,0,%r3 # vstm 0,15,0(3)
878 VSTM %v16,%v31,256,%r3 # vstm 16,31,256(3)
879 j .Lsave_fpu_regs_done # -> set CIF_FPU flag
897 .Lsave_fpu_regs_done:
898 oi __LC_CPU_FLAGS+7,_CIF_FPU
901 EXPORT_SYMBOL(save_fpu_regs)
904 * Load floating-point controls and floating-point or vector registers.
905 * A critical section cleanup assures that the register contents are
906 * loaded even if interrupted for some other work.
908 * There are special calling conventions to fit into sysc and io return work:
909 * %r15: <kernel stack>
910 * The function requires:
915 aghi %r4,__TASK_thread
916 TSTMSK __LC_CPU_FLAGS,_CIF_FPU
918 lfpc __THREAD_FPU_fpc(%r4)
919 TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX
920 lg %r4,__THREAD_FPU_regs(%r4) # %r4 <- reg save area
921 jz .Lload_fpu_regs_fp # -> no VX, load FP regs
923 VLM %v16,%v31,256,%r4
924 j .Lload_fpu_regs_done
942 .Lload_fpu_regs_done:
943 ni __LC_CPU_FLAGS+7,255-_CIF_FPU
950 * Machine check handler routines
952 ENTRY(mcck_int_handler)
954 la %r1,4095 # revalidate r1
955 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer
956 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs
958 larl %r13,cleanup_critical
959 lmg %r8,%r9,__LC_MCK_OLD_PSW
960 TSTMSK __LC_MCCK_CODE,MCCK_CODE_SYSTEM_DAMAGE
961 jo .Lmcck_panic # yes -> rest of mcck code invalid
962 lghi %r14,__LC_CPU_TIMER_SAVE_AREA
963 mvc __LC_MCCK_ENTER_TIMER(8),0(%r14)
964 TSTMSK __LC_MCCK_CODE,MCCK_CODE_CPU_TIMER_VALID
966 la %r14,__LC_SYNC_ENTER_TIMER
967 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
969 la %r14,__LC_ASYNC_ENTER_TIMER
970 0: clc 0(8,%r14),__LC_EXIT_TIMER
972 la %r14,__LC_EXIT_TIMER
973 1: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
975 la %r14,__LC_LAST_UPDATE_TIMER
977 mvc __LC_MCCK_ENTER_TIMER(8),0(%r14)
978 3: TSTMSK __LC_MCCK_CODE,(MCCK_CODE_PSW_MWP_VALID|MCCK_CODE_PSW_IA_VALID)
979 jno .Lmcck_panic # no -> skip cleanup critical
980 SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+64,__LC_MCCK_ENTER_TIMER
982 lghi %r14,__LC_GPREGS_SAVE_AREA+64
983 stmg %r0,%r7,__PT_R0(%r11)
984 mvc __PT_R8(64,%r11),0(%r14)
985 stmg %r8,%r9,__PT_PSW(%r11)
986 xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
987 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
988 lgr %r2,%r11 # pass pointer to pt_regs
989 brasl %r14,s390_do_machine_check
990 tm __PT_PSW+1(%r11),0x01 # returning to user ?
992 lg %r1,__LC_KERNEL_STACK # switch to kernel stack
993 mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11)
994 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1)
995 la %r11,STACK_FRAME_OVERHEAD(%r1)
997 ssm __LC_PGM_NEW_PSW # turn dat on, keep irqs off
998 TSTMSK __LC_CPU_FLAGS,_CIF_MCCK_PENDING
1001 brasl %r14,s390_handle_mcck
1004 lg %r14,__LC_VDSO_PER_CPU
1005 lmg %r0,%r10,__PT_R0(%r11)
1006 mvc __LC_RETURN_MCCK_PSW(16),__PT_PSW(%r11) # move return PSW
1007 tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ?
1009 stpt __LC_EXIT_TIMER
1010 mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER
1011 0: lmg %r11,%r15,__PT_R11(%r11)
1012 lpswe __LC_RETURN_MCCK_PSW
1015 lg %r15,__LC_PANIC_STACK
1016 la %r11,STACK_FRAME_OVERHEAD(%r15)
1020 # PSW restart interrupt handler
1022 ENTRY(restart_int_handler)
1023 TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_LPP
1025 .insn s,0xb2800000,__LC_LPP
1026 0: stg %r15,__LC_SAVE_AREA_RESTART
1027 lg %r15,__LC_RESTART_STACK
1028 aghi %r15,-__PT_SIZE # create pt_regs on stack
1029 xc 0(__PT_SIZE,%r15),0(%r15)
1030 stmg %r0,%r14,__PT_R0(%r15)
1031 mvc __PT_R15(8,%r15),__LC_SAVE_AREA_RESTART
1032 mvc __PT_PSW(16,%r15),__LC_RST_OLD_PSW # store restart old psw
1033 aghi %r15,-STACK_FRAME_OVERHEAD # create stack frame on stack
1034 xc 0(STACK_FRAME_OVERHEAD,%r15),0(%r15)
1035 lg %r1,__LC_RESTART_FN # load fn, parm & source cpu
1036 lg %r2,__LC_RESTART_DATA
1037 lg %r3,__LC_RESTART_SOURCE
1038 ltgr %r3,%r3 # test source cpu address
1039 jm 1f # negative -> skip source stop
1040 0: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu
1041 brc 10,0b # wait for status stored
1042 1: basr %r14,%r1 # call function
1043 stap __SF_EMPTY(%r15) # store cpu address
1044 llgh %r3,__SF_EMPTY(%r15)
1045 2: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu
1049 .section .kprobes.text, "ax"
1051 #ifdef CONFIG_CHECK_STACK
1053 * The synchronous or the asynchronous stack overflowed. We are dead.
1054 * No need to properly save the registers, we are going to panic anyway.
1055 * Setup a pt_regs so that show_trace can provide a good call trace.
1058 lg %r15,__LC_PANIC_STACK # change to panic stack
1059 la %r11,STACK_FRAME_OVERHEAD(%r15)
1060 stmg %r0,%r7,__PT_R0(%r11)
1061 stmg %r8,%r9,__PT_PSW(%r11)
1062 mvc __PT_R8(64,%r11),0(%r14)
1063 stg %r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2
1064 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
1065 lgr %r2,%r11 # pass pointer to pt_regs
1066 jg kernel_stack_overflow
1070 #if IS_ENABLED(CONFIG_KVM)
1071 clg %r9,BASED(.Lcleanup_table_sie) # .Lsie_gmap
1073 clg %r9,BASED(.Lcleanup_table_sie+8)# .Lsie_done
1076 clg %r9,BASED(.Lcleanup_table) # system_call
1078 clg %r9,BASED(.Lcleanup_table+8) # .Lsysc_do_svc
1079 jl .Lcleanup_system_call
1080 clg %r9,BASED(.Lcleanup_table+16) # .Lsysc_tif
1082 clg %r9,BASED(.Lcleanup_table+24) # .Lsysc_restore
1083 jl .Lcleanup_sysc_tif
1084 clg %r9,BASED(.Lcleanup_table+32) # .Lsysc_done
1085 jl .Lcleanup_sysc_restore
1086 clg %r9,BASED(.Lcleanup_table+40) # .Lio_tif
1088 clg %r9,BASED(.Lcleanup_table+48) # .Lio_restore
1090 clg %r9,BASED(.Lcleanup_table+56) # .Lio_done
1091 jl .Lcleanup_io_restore
1092 clg %r9,BASED(.Lcleanup_table+64) # psw_idle
1094 clg %r9,BASED(.Lcleanup_table+72) # .Lpsw_idle_end
1096 clg %r9,BASED(.Lcleanup_table+80) # save_fpu_regs
1098 clg %r9,BASED(.Lcleanup_table+88) # .Lsave_fpu_regs_end
1099 jl .Lcleanup_save_fpu_regs
1100 clg %r9,BASED(.Lcleanup_table+96) # load_fpu_regs
1102 clg %r9,BASED(.Lcleanup_table+104) # .Lload_fpu_regs_end
1103 jl .Lcleanup_load_fpu_regs
1111 .quad .Lsysc_restore
1117 .quad .Lpsw_idle_end
1119 .quad .Lsave_fpu_regs_end
1121 .quad .Lload_fpu_regs_end
1123 #if IS_ENABLED(CONFIG_KVM)
1124 .Lcleanup_table_sie:
1129 cghi %r11,__LC_SAVE_AREA_ASYNC #Is this in normal interrupt?
1131 slg %r9,BASED(.Lsie_crit_mcck_start)
1132 clg %r9,BASED(.Lsie_crit_mcck_length)
1134 oi __LC_CPU_FLAGS+7, _CIF_MCCK_GUEST
1135 1: lg %r9,__SF_EMPTY(%r15) # get control block pointer
1136 ni __SIE_PROG0C+3(%r9),0xfe # no longer in SIE
1137 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
1138 larl %r9,sie_exit # skip forward to sie_exit
1142 .Lcleanup_system_call:
1143 # check if stpt has been executed
1144 clg %r9,BASED(.Lcleanup_system_call_insn)
1146 mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER
1147 cghi %r11,__LC_SAVE_AREA_ASYNC
1149 mvc __LC_SYNC_ENTER_TIMER(8),__LC_MCCK_ENTER_TIMER
1150 0: # check if stmg has been executed
1151 clg %r9,BASED(.Lcleanup_system_call_insn+8)
1153 mvc __LC_SAVE_AREA_SYNC(64),0(%r11)
1154 0: # check if base register setup + TIF bit load has been done
1155 clg %r9,BASED(.Lcleanup_system_call_insn+16)
1157 # set up saved register r12 task struct pointer
1159 # set up saved register r13 __TASK_thread offset
1160 mvc 40(8,%r11),BASED(.Lcleanup_system_call_const)
1161 0: # check if the user time update has been done
1162 clg %r9,BASED(.Lcleanup_system_call_insn+24)
1164 lg %r15,__LC_EXIT_TIMER
1165 slg %r15,__LC_SYNC_ENTER_TIMER
1166 alg %r15,__LC_USER_TIMER
1167 stg %r15,__LC_USER_TIMER
1168 0: # check if the system time update has been done
1169 clg %r9,BASED(.Lcleanup_system_call_insn+32)
1171 lg %r15,__LC_LAST_UPDATE_TIMER
1172 slg %r15,__LC_EXIT_TIMER
1173 alg %r15,__LC_SYSTEM_TIMER
1174 stg %r15,__LC_SYSTEM_TIMER
1175 0: # update accounting time stamp
1176 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
1177 # set up saved register r11
1178 lg %r15,__LC_KERNEL_STACK
1179 la %r9,STACK_FRAME_OVERHEAD(%r15)
1180 stg %r9,24(%r11) # r11 pt_regs pointer
1182 mvc __PT_R8(64,%r9),__LC_SAVE_AREA_SYNC
1183 stmg %r0,%r7,__PT_R0(%r9)
1184 mvc __PT_PSW(16,%r9),__LC_SVC_OLD_PSW
1185 mvc __PT_INT_CODE(4,%r9),__LC_SVC_ILC
1186 xc __PT_FLAGS(8,%r9),__PT_FLAGS(%r9)
1187 mvi __PT_FLAGS+7(%r9),_PIF_SYSCALL
1188 # setup saved register r15
1189 stg %r15,56(%r11) # r15 stack pointer
1190 # set new psw address and exit
1191 larl %r9,.Lsysc_do_svc
1193 .Lcleanup_system_call_insn:
1197 .quad .Lsysc_vtime+36
1198 .quad .Lsysc_vtime+42
1199 .Lcleanup_system_call_const:
1206 .Lcleanup_sysc_restore:
1207 # check if stpt has been executed
1208 clg %r9,BASED(.Lcleanup_sysc_restore_insn)
1210 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
1211 cghi %r11,__LC_SAVE_AREA_ASYNC
1213 mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER
1214 0: clg %r9,BASED(.Lcleanup_sysc_restore_insn+8)
1216 lg %r9,24(%r11) # get saved pointer to pt_regs
1217 mvc __LC_RETURN_PSW(16),__PT_PSW(%r9)
1218 mvc 0(64,%r11),__PT_R8(%r9)
1219 lmg %r0,%r7,__PT_R0(%r9)
1220 1: lmg %r8,%r9,__LC_RETURN_PSW
1222 .Lcleanup_sysc_restore_insn:
1223 .quad .Lsysc_exit_timer
1224 .quad .Lsysc_done - 4
1230 .Lcleanup_io_restore:
1231 # check if stpt has been executed
1232 clg %r9,BASED(.Lcleanup_io_restore_insn)
1234 mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER
1235 0: clg %r9,BASED(.Lcleanup_io_restore_insn+8)
1237 lg %r9,24(%r11) # get saved r11 pointer to pt_regs
1238 mvc __LC_RETURN_PSW(16),__PT_PSW(%r9)
1239 mvc 0(64,%r11),__PT_R8(%r9)
1240 lmg %r0,%r7,__PT_R0(%r9)
1241 1: lmg %r8,%r9,__LC_RETURN_PSW
1243 .Lcleanup_io_restore_insn:
1244 .quad .Lio_exit_timer
1248 ni __LC_CPU_FLAGS+7,255-_CIF_ENABLED_WAIT
1249 # copy interrupt clock & cpu timer
1250 mvc __CLOCK_IDLE_EXIT(8,%r2),__LC_INT_CLOCK
1251 mvc __TIMER_IDLE_EXIT(8,%r2),__LC_ASYNC_ENTER_TIMER
1252 cghi %r11,__LC_SAVE_AREA_ASYNC
1254 mvc __CLOCK_IDLE_EXIT(8,%r2),__LC_MCCK_CLOCK
1255 mvc __TIMER_IDLE_EXIT(8,%r2),__LC_MCCK_ENTER_TIMER
1256 0: # check if stck & stpt have been executed
1257 clg %r9,BASED(.Lcleanup_idle_insn)
1259 mvc __CLOCK_IDLE_ENTER(8,%r2),__CLOCK_IDLE_EXIT(%r2)
1260 mvc __TIMER_IDLE_ENTER(8,%r2),__TIMER_IDLE_EXIT(%r2)
1261 1: # calculate idle cycles
1263 clg %r9,BASED(.Lcleanup_idle_insn)
1265 larl %r1,smp_cpu_mtid
1269 .insn rsy,0xeb0000000017,%r1,5,__SF_EMPTY+80(%r15)
1271 ag %r3,__LC_PERCPU_OFFSET
1272 la %r4,__SF_EMPTY+16(%r15)
1281 3: # account system time going idle
1282 lg %r9,__LC_STEAL_TIMER
1283 alg %r9,__CLOCK_IDLE_ENTER(%r2)
1284 slg %r9,__LC_LAST_UPDATE_CLOCK
1285 stg %r9,__LC_STEAL_TIMER
1286 mvc __LC_LAST_UPDATE_CLOCK(8),__CLOCK_IDLE_EXIT(%r2)
1287 lg %r9,__LC_SYSTEM_TIMER
1288 alg %r9,__LC_LAST_UPDATE_TIMER
1289 slg %r9,__TIMER_IDLE_ENTER(%r2)
1290 stg %r9,__LC_SYSTEM_TIMER
1291 mvc __LC_LAST_UPDATE_TIMER(8),__TIMER_IDLE_EXIT(%r2)
1292 # prepare return psw
1293 nihh %r8,0xfcfd # clear irq & wait state bits
1294 lg %r9,48(%r11) # return from psw_idle
1296 .Lcleanup_idle_insn:
1297 .quad .Lpsw_idle_lpsw
1299 .Lcleanup_save_fpu_regs:
1300 larl %r9,save_fpu_regs
1303 .Lcleanup_load_fpu_regs:
1304 larl %r9,load_fpu_regs
1312 .quad .L__critical_start
1314 .quad .L__critical_end - .L__critical_start
1315 #if IS_ENABLED(CONFIG_KVM)
1316 .Lsie_critical_start:
1318 .Lsie_critical_length:
1319 .quad .Lsie_done - .Lsie_gmap
1320 .Lsie_crit_mcck_start:
1322 .Lsie_crit_mcck_length:
1323 .quad .Lsie_skip - .Lsie_entry
1326 .section .rodata, "a"
1327 #define SYSCALL(esame,emu) .long esame
1328 .globl sys_call_table
1330 #include "syscalls.S"
1333 #ifdef CONFIG_COMPAT
1335 #define SYSCALL(esame,emu) .long emu
1336 .globl sys_call_table_emu
1338 #include "syscalls.S"