@@ -123,7 +123,8 @@ _LPP_OFFSET = __LC_LPP
123123 lg %r9 ,\sie_control # get control block pointer
124124 ni __SIE_PROG0C+3 (%r9 ),0xfe # no longer in SIE
125125 lctlg %c1,%c1,__LC_KERNEL_ASCE # load primary asce
126- ni __LC_CPU_FLAGS+7 ,255 -_CIF_SIE
126+ lg %r9 ,__LC_CURRENT
127+ mvi __TI_sie(%r9 ),0
127128 larl %r9 ,sie_exit # skip forward to sie_exit
128129 .endm
129130#endif
@@ -183,15 +184,15 @@ SYM_FUNC_END(__switch_to_asm)
183184 */
184185SYM_FUNC_START(__sie64a)
185186 stmg %r6,%r14 ,__SF_GPRS(%r15 ) # save kernel registers
186- lg %r12 ,__LC_CURRENT
187+ lg %r14 ,__LC_CURRENT
187188 stg %r2,__SF_SIE_CONTROL_PHYS(%r15 ) # save sie block physical..
188189 stg %r3,__SF_SIE_CONTROL(%r15 ) # ...and virtual addresses
189190 stg %r4,__SF_SIE_SAVEAREA(%r15 ) # save guest register save area
190191 stg %r5,__SF_SIE_GUEST_ASCE(%r15 ) # save guest asce
191192 xc __SF_SIE_REASON(8 ,%r15 ),__SF_SIE_REASON(%r15 ) # reason code = 0
192- mvc __SF_SIE_FLAGS(8 ,%r15 ),__TI_flags(%r12 ) # copy thread flags
193+ mvc __SF_SIE_FLAGS(8 ,%r15 ),__TI_flags(%r14 ) # copy thread flags
193194 lmg %r0,%r13 ,0 (%r4) # load guest gprs 0-13
194- oi __LC_CPU_FLAGS+ 7 ,_CIF_SIE
195+ mvi __TI_sie( %r14 ), 1
195196 lctlg %c1,%c1,__SF_SIE_GUEST_ASCE(%r15 ) # load primary asce
196197 lg %r14 ,__SF_SIE_CONTROL(%r15 ) # get control block pointer
197198 oi __SIE_PROG0C+3 (%r14 ),1 # we are going into SIE now
@@ -211,7 +212,8 @@ SYM_FUNC_START(__sie64a)
211212 lg %r14 ,__SF_SIE_CONTROL(%r15 ) # get control block pointer
212213 ni __SIE_PROG0C+3 (%r14 ),0xfe # no longer in SIE
213214 lctlg %c1,%c1,__LC_KERNEL_ASCE # load primary asce
214- ni __LC_CPU_FLAGS+7 ,255 -_CIF_SIE
215+ lg %r14 ,__LC_CURRENT
216+ mvi __TI_sie(%r14 ),0
215217# some program checks are suppressing. C code (e.g. do_protection_exception)
216218# will rewind the PSW by the ILC, which is often 4 bytes in case of SIE. There
217219# are some corner cases (e.g. runtime instrumentation) where ILC is unpredictable.
@@ -394,7 +396,8 @@ SYM_CODE_START(\name)
394396 tmhh %r8 ,0x0001 # interrupting from user ?
395397 jnz 1f
396398#if IS_ENABLED(CONFIG_KVM)
397- TSTMSK __LC_CPU_FLAGS,_CIF_SIE
399+ lg %r10 ,__LC_CURRENT
400+ tm __TI_sie(%r10 ),0xff
398401 jz 0f
399402 BPENTER __SF_SIE_FLAGS(%r15 ),_TIF_ISOLATE_BP_GUEST
400403 SIEEXIT __SF_SIE_CONTROL(%r15 )
@@ -469,9 +472,10 @@ SYM_CODE_START(mcck_int_handler)
469472 TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_IA_VALID
470473 jno .Lmcck_panic
471474#if IS_ENABLED(CONFIG_KVM)
472- TSTMSK __LC_CPU_FLAGS,_CIF_SIE
475+ lg %r10 ,__LC_CURRENT
476+ tm __TI_sie(%r10 ),0xff
473477 jz .Lmcck_user
474- # Need to compare the address instead of a CIF_SIE* flag.
478+ # Need to compare the address instead of __TI_SIE flag.
475479 # Otherwise there would be a race between setting the flag
476480 # and entering SIE (or leaving and clearing the flag). This
477481 # would cause machine checks targeted at the guest to be
0 commit comments