PJ40922: CTL-571/CTL-10'S MAY OCCUR WHEN APPLYING PJ40471
Closed as program error.
See Problem Summary.
APAR NUMBER: PJ40922 PRODUCT: z/TPF FUNCTIONAL AREA: ENTER/BACK PROCESSING SHIPPED IN PUT: 10 ABSTRACT: CTL-571 and CTL-10 may occur when applying PJ40471. PACKAGE CONTENTS: Source Segments: (C) base/cp/cpsm.cpy (C) base/cp/cceh.cpy Object Only Binaries: None. Configuration Independent Binaries: None. Support Files: None. OTHER BINARIES TO BUILD: YES (C) <sys>/load/CPS0.so (C) <sys>/obj/cccpse.o (C) <sys>/obj/ccenbk.o COMMENTS: PJ40471 changed CCENBK routine CCEHOLD to replace the MONTC call with a Set PSW Key from Address (SPKA) instruction. One reason that the MONTC was executed is to change the protect key. The SPKA can also change the protect key and the overhead is much less. However, when MONTC is executed in the CP, I/O interrupts are also disabled. Because PJ40471 removed the MONTC, the CCEHOLD routine is now enabled for I/O interrupts. If an I/O interrupt is taken in the CCEHOLD routine it is possible that a deadly embrace between core locks may occur. To create this situation, a multiple entry point CSO program must be loaded and activated using the online loader (OLD). The activation of the multiple entry point CSO will cause routine CCEHOLD to be executed on entry to the program in order to determine which version to use. When ECBs on separate I-streams are entering the activated program at the same time and an I/O interrupt is taken in CCEHOLD and this I/O interrupt attempts to obtain a lock, it is possible that a deadly embrace can happen. As an example assume that CTAL was online loaded and activated. Next, I-stream 2 obtains the socket block table lock (CINFC CMMCTK2 field ck2sokb) in an E-type program. While holding this lock the E-type program calls a C function in CTAL. The linkage to CTAL will go to routine CCEHOLD and a LOCKC on the base PAT slot for CTAL is executed. While this is happening, I-stream 3 is also entering a C function in CTAL and it also goes to routine CCEHOLD. In this example, I-stream 3 obtains the PAT lock for CTAL first. After I-stream 3 obtains the lock and while it is still in CCEHOLD, an I/O interrupt is taken. The I/O interrupt is for an OSA SDA. As a result the first level interrupt routine in CIO attempts to get the socket block table lock. The result is a deadlock between core locks. I-stream 2 has the socket block table lock and wants the PAT lock for CTAL. I-stream 3 has the PAT lock for CTAL and wants the socket block table lock. Eventually, a CTL-571 will happen. In addition, in this example if an E-type program on another I-stream attempts to get the socket block table lock, it will take a CTL-10.
SOLUTION: The solution is to recognize that an I/O interrupt is being processing and that the I/O interrupt is attempting to get a lock and that the I/O interrupt happened in the CCEHOLD routine. If the PAT entry that is being used in CCEHOLD is locked by the I-stream that took the I/O interrupt, I/O interrupt processing will unlock the PAT entry and set the I/O interrupt return address to return to the LOCKC in CCEHOLD. The actual implementation is in the LOCKC monitor call routine in CCCPSE cpsm.cpy. When the first LOCKC monitor call for a specific lock request is executed, processing goes to label RESETCOUNT in cpsm.cpy. At this point logic is inserted to recognize the special I/O interrupt handling. The following checks are performed: (a) If processing is in I/O interrupt processing, continue. Otherwise, skip the special CCEHOLD logic. (b) If the I/O interrupt happened in CCEHOLD, continue. This check is done based on newly added labels in cceh.cpy. If the I/O interrupt is not in CCEHOLD, skip the special CCEHOLD logic. (c) If the monitor call interrupt happened in CIO, continue. Otherwise, skip the special CCEHOLD logic. (d) Obtain the ECB application stack address from the I/O interrupt saved registers. In CCEHOLD, R15 contains the stack frame address. If the stack address is valid, continue. Otherwise, skip the special CCEHOLD logic. (e) Obtain the address of the PAT from the ECB application stack at label ICST_BR8. CCEHOLD has been updated to save the PAT address at ICST_BR8. If the PAT address is valid, continue. Otherwise, skip the special CCEHOLD logic. (f) If the base PAT entry is locked by the I-stream that is processing the I/O interrupt, continue. Otherwise, skip the special CCEHOLD logic. (g) If all the proceeding checks have been passed, the special CCEHOLD logic is executed. (h) The base PAT entry is unlocked. (i) The I/O interrupt saved value for R7 is changed to contain the address of the base PAT entry for the program being entered. CCEHOLD may change R7. The return location expects that R7 will point to the base PAT entry. (j) The I/O interrupt return address is changed to go to label CCEH_START_SPECIAL_HANDLING in CCENBK cceh.cpy. (j) If the key on entry to CCEHOLD was not Key 0, the I/O interrupt PSW key is changed to be key E. Finally, processing continues in LOCKC monitor call routine RESETCOUNT. COREQS: NO None. MIGRATION CONSIDERATIONS: NO None. BUILD COMMANDS AND INSTRUCTIONS: YES #maketpf commands for linux maketpf -f CPS0 cccpse.o ccenbk.o maketpf CPS0 link UPDATED INFORMATION UNITS: NO None. See your IBM representative if you need additional information. DOWNLOAD INSTRUCTIONS: http://www.ibm.com/software/htp/tpf/maint/maintztpf.html APAR URL: http://www.ibm.com/software/htp/tpf/ztpfmaint/put10/PJ40922.htm
Reported component name
Reported component ID
NoSpecatt / Xsystem
Last modified date
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fixed component name
Fixed component ID
Applicable component levels
Translate this page: