entry.S (3037a52f9846b9d6e233274453f2d4117a14f31b) entry.S (0a5e2ec2647737907d267c09dc9a25fab1468865)
1/*
2 * S390 low-level entry points.
3 *
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>
9 */
10
11#include <linux/init.h>
12#include <linux/linkage.h>
13#include <asm/processor.h>
14#include <asm/cache.h>
1/*
2 * S390 low-level entry points.
3 *
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>
9 */
10
11#include <linux/init.h>
12#include <linux/linkage.h>
13#include <asm/processor.h>
14#include <asm/cache.h>
15#include <asm/ctl_reg.h>
16#include <asm/errno.h>
17#include <asm/ptrace.h>
18#include <asm/thread_info.h>
19#include <asm/asm-offsets.h>
20#include <asm/unistd.h>
21#include <asm/page.h>
22#include <asm/sigp.h>
23#include <asm/irq.h>

--- 493 unchanged lines hidden (view full) ---

517 stmg %r8,%r15,__LC_SAVE_AREA_SYNC
518 lg %r10,__LC_LAST_BREAK
519 lg %r12,__LC_CURRENT
520 larl %r13,cleanup_critical
521 lmg %r8,%r9,__LC_PGM_OLD_PSW
522 tmhh %r8,0x0001 # test problem state bit
523 jnz 2f # -> fault in user space
524#if IS_ENABLED(CONFIG_KVM)
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>
20#include <asm/page.h>
21#include <asm/sigp.h>
22#include <asm/irq.h>

--- 493 unchanged lines hidden (view full) ---

516 stmg %r8,%r15,__LC_SAVE_AREA_SYNC
517 lg %r10,__LC_LAST_BREAK
518 lg %r12,__LC_CURRENT
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)
525 # cleanup critical section for sie64a
524 # cleanup critical section for program checks in sie64a
526 lgr %r14,%r9
527 slg %r14,BASED(.Lsie_critical_start)
528 clg %r14,BASED(.Lsie_critical_length)
529 jhe 0f
525 lgr %r14,%r9
526 slg %r14,BASED(.Lsie_critical_start)
527 clg %r14,BASED(.Lsie_critical_length)
528 jhe 0f
530 brasl %r14,.Lcleanup_sie
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
531#endif
5320: tmhh %r8,0x4000 # PER bit set in old PSW ?
533 jnz 1f # -> enabled, can't be a double fault
534 tm __LC_PGM_ILC+3,0x80 # check for per exception
535 jnz .Lpgm_svcper # -> single stepped svc
5361: CHECK_STACK STACK_SIZE,__LC_SAVE_AREA_SYNC
537 aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
538 j 4f

--- 405 unchanged lines hidden (view full) ---

944
945.L__critical_end:
946
947/*
948 * Machine check handler routines
949 */
950ENTRY(mcck_int_handler)
951 STCK __LC_MCCK_CLOCK
533#endif
5340: 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
5381: CHECK_STACK STACK_SIZE,__LC_SAVE_AREA_SYNC
539 aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
540 j 4f

--- 405 unchanged lines hidden (view full) ---

946
947.L__critical_end:
948
949/*
950 * Machine check handler routines
951 */
952ENTRY(mcck_int_handler)
953 STCK __LC_MCCK_CLOCK
952 la %r1,4095 # validate r1
953 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # validate cpu timer
954 sckc __LC_CLOCK_COMPARATOR # validate comparator
955 lam %a0,%a15,__LC_AREGS_SAVE_AREA-4095(%r1) # validate acrs
956 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# validate gprs
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
957 lg %r12,__LC_CURRENT
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
957 lg %r12,__LC_CURRENT
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 TSTMSK __LC_MCCK_CODE,MCCK_CODE_CR_VALID
963 jno .Lmcck_panic # control registers invalid -> panic
964 la %r14,4095
965 lctlg %c0,%c15,__LC_CREGS_SAVE_AREA-4095(%r14) # validate ctl regs
966 ptlb
967 lg %r11,__LC_MCESAD # extended machine check save area
968 nill %r11,0xfc00 # MCESA_ORIGIN_MASK
969 TSTMSK __LC_CREGS_SAVE_AREA+16-4095(%r14),CR2_GUARDED_STORAGE
970 jno 0f
971 TSTMSK __LC_MCCK_CODE,MCCK_CODE_GS_VALID
972 jno 0f
973 .insn rxy,0xe3000000004d,0,__MCESA_GS_SAVE_AREA(%r11) # LGSC
9740: l %r14,__LC_FP_CREG_SAVE_AREA-4095(%r14)
975 TSTMSK __LC_MCCK_CODE,MCCK_CODE_FC_VALID
976 jo 0f
977 sr %r14,%r14
9780: sfpc %r14
979 TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX
980 jo 0f
981 lghi %r14,__LC_FPREGS_SAVE_AREA
982 ld %f0,0(%r14)
983 ld %f1,8(%r14)
984 ld %f2,16(%r14)
985 ld %f3,24(%r14)
986 ld %f4,32(%r14)
987 ld %f5,40(%r14)
988 ld %f6,48(%r14)
989 ld %f7,56(%r14)
990 ld %f8,64(%r14)
991 ld %f9,72(%r14)
992 ld %f10,80(%r14)
993 ld %f11,88(%r14)
994 ld %f12,96(%r14)
995 ld %f13,104(%r14)
996 ld %f14,112(%r14)
997 ld %f15,120(%r14)
998 j 1f
9990: VLM %v0,%v15,0,%r11
1000 VLM %v16,%v31,256,%r11
10011: lghi %r14,__LC_CPU_TIMER_SAVE_AREA
962 lghi %r14,__LC_CPU_TIMER_SAVE_AREA
1002 mvc __LC_MCCK_ENTER_TIMER(8),0(%r14)
1003 TSTMSK __LC_MCCK_CODE,MCCK_CODE_CPU_TIMER_VALID
1004 jo 3f
1005 la %r14,__LC_SYNC_ENTER_TIMER
1006 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
1007 jl 0f
1008 la %r14,__LC_ASYNC_ENTER_TIMER
10090: clc 0(8,%r14),__LC_EXIT_TIMER
1010 jl 1f
1011 la %r14,__LC_EXIT_TIMER
10121: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
1013 jl 2f
1014 la %r14,__LC_LAST_UPDATE_TIMER
10152: spt 0(%r14)
1016 mvc __LC_MCCK_ENTER_TIMER(8),0(%r14)
963 mvc __LC_MCCK_ENTER_TIMER(8),0(%r14)
964 TSTMSK __LC_MCCK_CODE,MCCK_CODE_CPU_TIMER_VALID
965 jo 3f
966 la %r14,__LC_SYNC_ENTER_TIMER
967 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
968 jl 0f
969 la %r14,__LC_ASYNC_ENTER_TIMER
9700: clc 0(8,%r14),__LC_EXIT_TIMER
971 jl 1f
972 la %r14,__LC_EXIT_TIMER
9731: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
974 jl 2f
975 la %r14,__LC_LAST_UPDATE_TIMER
9762: spt 0(%r14)
977 mvc __LC_MCCK_ENTER_TIMER(8),0(%r14)
10173: TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_MWP_VALID
1018 jno .Lmcck_panic
1019 tmhh %r8,0x0001 # interrupting from user ?
1020 jnz 4f
1021 TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_IA_VALID
1022 jno .Lmcck_panic
10234: SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+64,__LC_MCCK_ENTER_TIMER
9783: 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
1024.Lmcck_skip:
1025 lghi %r14,__LC_GPREGS_SAVE_AREA+64
1026 stmg %r0,%r7,__PT_R0(%r11)
1027 mvc __PT_R8(64,%r11),0(%r14)
1028 stmg %r8,%r9,__PT_PSW(%r11)
1029 xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
1030 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
1031 lgr %r2,%r11 # pass pointer to pt_regs

--- 352 unchanged lines hidden ---
981.Lmcck_skip:
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

--- 352 unchanged lines hidden ---