llllllllllllllIllllllllllllllllllllllIlllllllllllllllllllllllllllllllllllll US005253344A United States Patent [191 [11] Patent Number: 5,253,344 Bostick et al. [45] Date of Patent: Oct. 12, 1993

[54] METHOD AND APPARATUS FOR [56] References Cited DYNAMICALLY CHANGING THE S P A NT ENT CONFIG TION OF A LOGICALLY 4 541 04:1- 9l/l985rEBall DOCI-llM 5 364/200 §$§TEMONEDI‘III D ATA PROCESSING 4,779,194, , 10/1988 egeer et ...... 4,8l5,03l 3/1989 _ 4,843,541 6/1989 [75] Inventors: James E. Bostick, Poughkeepsie; 4,853,117 g/19s9 Roger E. Hough, Highland; Suzanne 5,027,271 6/1991 M. John, Poughkeepsie; Jeffrey P. 5,155,837 10/1992 Kubala, Poughquag; Karen M. 53701472 12/1992 Noon“; Nofman E' Shift‘, both of Primary Examiner-Michael R. Fleming Poughkeepsie; Ira G. Siegel, New Assistant Examine,_Gopa1 c_ Ray Paul’ an of N-Y- Attorney, Agent, or Finn-William B. Porter CI‘ [73] Assignee: International Business Machines [57] _ _ _ _ Corp” Armonk, NY, A request is made by a system in a ?rst logical partition, within a logically partitioned data processing system, to _ dynamically change the I/O con?guration of the host [21] Appl' No" 755’246 system in a way that affects a system in a second logical partition. The intercepts the request, ensures [22] Filed! sep- 5’ 1991 the serialization of such dynamic I/O requests, and allows dynamic recon?guration to proceed. Subse [51] Int. Cl.5 ...... G06F 13/00 quently, the hypervisor determines the effect of the [52] US. Cl...... 395/275; 395/325; recon?guration on the second partition, and notifies the 364/9494; 364/D1G. 2 second partition of the change. [58] Field of Search ...... 395/725, 325, 650, 200, 395/425, 275; 340/825.5; 370/852 12 Claims, 8 Drawing Sheets

SET UP CONFIGURATION MODE P01

DYNAMIC I/O COMMAND AND suaszousm PROCESSING /

PROCESS DYNAMIC l/O COMMAND

DETERMINE THE EFFECT or / conncummu ounces ON ALL LOGICAL PARTITTONS l NOTIFY AFFECTED LOGICAL PARTITIONS 0F DELETED SUBCHANNELS VIA CHANNEL REPORTS

NO ——L EXIT CONFIGURATION MODE YES

NOTIFY AFFECTED LOGICAL PARTITIONS OF ADDED OR MODIFIED SUBCHANNELS VIA CHANNEL REPORTS US.‘ Patent 0a. 12, 1993 Sheet 1 of 8 5,253,344

FIG.1

1m SET UP CONFIGURATION MODE /

102 SE FIGs 2-5 DYNAMIC I/O COMMAND AND / FOR DETAILS SUBSEQUENT PROCESSING

102A PROCESS DYNAMIC I /o COMMAND

102B DETERMINE THE EFFECT OF / ' CONFIGURATION CHANGES on ALL LOGICAL PARTITIONS

1D2c NOTIFY AFFECTED LOGICAL / PARTITIONS 0F DELETED SUBCHANNELS VIA CHANNEL REPORTS

N0 103 EXIT CONFIGURATION MODE /

YES

104 NOTIFY AFFECTED LOGICAL / PARTITIONS 0F ADDED DR MODIFIED ' SUBCHANNELS VIA CHANNEL REPORTS US. Patent Oct. 12, 1993 Sheet 2 of 8 5,253,344

FIG. 2

201 \ PRE-CHECK

N0 REQUEST VALID

202 \ POST CONDITION cons N0 v - COMMAND OK >

203 \ PASS REQUEST 20s . TO 10p \ ANALYZE CHANGES

204 \ WAIT FOR 206 COMPLETION \ UPDATE INTERRUPTION I/O nzvrce CONTROL BLOCKS 207

SET up FOR POST CRW POSTING COMPLETION CODE US. Patent Oct. 12, 1993 Sheet 3 of 8 5,253,344

FIG.3

301 \ PRE-CHECK

N0 N0 VALID REQUEST > COMMAND 0K

302 306 \ POST \ UPDATE coumnow CODE CONFIGURATION INFORMATION

303 - 307 i \ INVOKE v \ POST PROCESSOR -— —-—+- COMPLETION 3 CONTROLLER ‘ CODE

YES ERROR

304 \ PASS REQUEST To IOP

305 \ wAIT FOR COMPLETION INTERRUPTION US. Patent Oct.12,1993 Sheet 4 of 8 5,253,344

F I G . 4

\ PREI-CHECK

VALID REQUEST

\ PASS REQUEST TO IOP

\ POST CONDITION cons

\ WAIT FOR COMPLETION INTERRUPTION

\ POST i COMPLETION cone US. Patent Oct. 12, 1993 Sheet 5 of 8 5,253,344

F l G . 5 ‘

\ PRE-CHECK V COMMAND OK > CLEAN UP / CONTROL BLOCKS N0 5o7\ VALID REQUEST > POST -4——-| COMPLETION CODE \ UPDATE LPAR CONTROL BLOCKS

\ PASS REQUEST TO IOP

\ POST CONDITION CODE

ses \ WAIT FOR COMPLETION INTERRUPTION US. Patent 0¢¢.12,199s Sheet 6 of 8 5,253,344

501 YES 605’\ \ PRE-CHECK > COMMAND ox > UPDATE LPAR . CONTROL N0 60? BLOCKS VALID REQUEST 7 POST COMPLETION cone <-——-'

502 \ PASS COMMAND T0 IOP FIG.6 e03 \ POST common CODE

60:: \ WAIT FOR COMPLETION INTERRUPTION

FIG.7

I I 0 NUMBER OF I POSSIBLE SUBCHANNELS SUBCHANNELS US. Patent Oct. 12,1993 Sheet 7 of 8 5,253,344

FIG.9B STATE TYPE DESCRIPTION O OPEN , DISABLED(AND IDLE) CLOSED BEING ENABLED OR DISABLED OPEN ENABLED AND IDLE CLOSED MAKE FUNCTION ACTIVE OPEN FUNCTION PENDING WAITING FOR LOCKS CLOSED CHECK COUNT CLOSED MAKE REAL FUNCTION ACTIVE CLOSED ISSUE SERVICE PROCESSOR REQUEST AND IGNORE UNSOLICITED INTERRUPTIONS OPEN FOR REAL STATUS SUBCHANNEL OPEN WAITING FOR REAL STATUS FUNCTION PENDING 0 CLOSED DRAIN ANY REAL STATUS. UPDATE FUNCTION PENDING CLOSED REBUILD SYSTEM CONTROL BLOCKS CLOSED FILTER RESPONSE AND MAKE STATUS PENDING CLOSED UNLOCK PICLs OPEN STATUS PENDING CLOSED CHECK FOR ADDITIONAL REAL PENDING STATUS CLOSED UNABLE TO OBTAIN PICLs-CHECK COUNT CLOSED MAKE INVALID RESPONSE PENDING CLOSED MAKE UNSOLICITED STATUS PENDING CLOSED MAKE ERROR PENDING FOR SERVICE PROCESSOR REQUEST FAILURE CLOSED CHECK FOR ANY PENDING UNSOLICITED STATUS NOTE: AN OPEN STATE IS ONE FROM WHICH MORE THAN ONE ' PROCESS CAN ATTEMPT TO MAKE A TRANSITION. A CLOSED STATE IS ONE FROM WHICH ONLY ONE PROCESS CAN ATTEMPT TO MAKE A TRANSITION. COMPARE AND SWAP IS REQUIRED TO MAKE SUCH A TRANSITION . NOTE: ANY PROCESS WHICH CHANGES THE STATE FROM AN OPEN ONE IS DOCUMENTED WITH A LIST OF STATES AND WHAT TO DO FOR EACH.

TAMCCODE AMCLPNUM AMCDLSNM FIG, 8 US. Patent Oct. 12, 1993 Sheet 8 of 8 5,253,344

Irpt or MIH Reset M F IG. 9A Dis- Make <-— Lock abled any V100, and L> unsol . Clear 4 ldle r> status any pend ‘ status < 0 20 15

’ l A I A A Reset v I v I ITSCH

PNCW Idle > Status Unlock Filter CDLRB, being — and Pend. PICLs Resp & attach up- Ena- ignore if Make detach - e dated <-> bled irpts <—- held. <- Status <-— CRUS, Reset Pend ignore <- waits. < irpts 1 2 14 13 12 11 | A A A A A V! l l ‘—1 I Reset Hake Make Make Set Drain func status Status Resp. Any pend. pend. Pend. Make Uns Real Bump Err Set Set Uns <- Status — - Count —> resp fail Status Check Resp. Pend. Resp. 3 17 19 18 10 [cm A A AAAA V I [Err (2C0 Func PICL Issue Make pend Time- reqst Real CCZ — await out. to —> CHSC ing Check Proc. Active > locks count. Cntrlr > 6 cm! V V V

Wait Wait I for for real real status status func subch pend active 9 8 5,253,344 1 2 The IODF contains the I/O de?nition. The dynamic METHOD AND APPARATUS FOR con?guration feature provides the user with an ACT I DYNAMICALLY CHANGING THE VATE capability. When the user wants to run with a CONFIGURATION OF A LOGICALLY new I/O con?guration, he enters the ACTIVATE PARTITIONED DATA PROCESSING SYSTEM 5 command in the HCD and speci?es the IODF he wishes to use. The HCD compares the current active FIELD OF THE INVENTION con?guration with the target con?guration and builds a This invention relates to the ?eld of computers and list of changes required. MVS/ESA then validates the computer system complexes comprising a logically changes, requests I/O con?guration changes, updates partitioned processor governed by a hypervisor. More MVS/ESA control blocks, and downloads a new particularly, this invention provides a mechanism for IOCDS to the Processor Controller DASD. In a hyper handling dynamic I/O recon?guration requests in a visor environment in which the operating systems in the logically partitioned environment. partitions are capable of dynamic modi?cations to the BACKGROUND ART physical system’s I/O con?guration, novel situations 15 are presented which call for decisions as to how the In a logically partitioned computer processor, such as hypervisor will react to the proposed dynamic changes. IBM's PR/SM-LPAR, a plurality of operating systems It is therefore an object of the present invention to operate in logical partitions, with the partitions con provide a method and apparatus by which a hypervisor trolled by a hypervisor. Such an approach is described can control and respond to dynamic I/O recon?gura in US. Pat. No. 4,843,541, "Logical Resource Partition tions by an in a partition. ing of a Data Processing System”, by Bean, et al., as It is a further object of this invention to permit con signed to the assignee of the present invention, and tinued operation by systems in other partitions during incorporated herein by reference. In such an environ dynamic changes to a system’s I/O con?guration by a ment, each operating system operates to a very large system in a then controlling partition. degree independently, with its own resources, and with 25 the hypervisor intercepting requests for certain privi theIt involvement is still a further of theobject hypervisor of this invention in dynamic to changes leged operations, and reissuing them (perhaps in a changed form) on behalf of the requesting operating to a systems con?guration by a then controlling parti system/partition. tion, until after the changes have been effected. In most prior art environments, the physical I/O 30 SUMMARY OF THE INVENTION con?guration (channels, channel paths, devices, etc.) is “static” in that major con?guration changes/redefmi In operation, the PR/ SM hypervisor ?rst ensures that tions could only be made by stopping active work on dynamic recon?guration requests are serialized (i.e., the system, rede?ning the con?guration, then reinitial that only one logical partition at a time can perform izing (IPLing) the system with the new con?guration. 35 dynamic recon?guration). Next-and counter to the In such environments, a role of the hypervisor is to map usual philosophy of -the (authorized) par a partition’s logical view of the (static) system con?gu tition is permitted to recon?gure (add/delete/modify) ration to the physical con?guration, intercept and reis system resources, even those affecting other partitions. sue I/O operation requests, pass along (to the appropri The hypervisor becomes actively involved only after ate partition) error indications, etc. the changes are made-determining what partitions are Recently, inventions have been made that enable an affected, and notifying them appropriately. All parti operating system to make and/or tolerate dynamic tions continue to operate while the changes are made. changes to the systems physical l/O con?guration. DESCRIPTION OF THE DRAWINGS Exemplary of these mechanisms are those described in a series of copending applications related to IBM’s 45 FIG. 1 is a ?owchart showing the method by which ESA/390 systems and MVS/ESA Operating Systems: the hypervisor manages dynamic changes, by a parti “Method and Apparatus for Dynamic Changes to Sys tion, to the system’s I/O con?guration. tern I/O Con?guration”, Ser. No. 07/676,603, by S. M. FIG. 2 is a ?owchart showing processing by the Benson, et al.; “Dynamically Changing a System I/O hypervisor of requests by a system in a partition for a Con?guration De?nition”, issued as US Pat. No. change to the system’s I/O configuration that does not 5,170,472, on Dec. 8, 1992, by R. Cwiakala, et al.; “Es involve the PCE. ' tablishing and Restoring Resources in a Data Process FIG. 3 is a ?owchart showing processing by the ing I/O System”, Ser. No. 07/754,859, (?led Sep. 4, hypervisor of requests by a system in a partition for the 1991), by T. E. Cook, et al. All these applications are addition or deletion of a channel path (involving the assigned to the assignee of the present invention, and are 55 PCB). ‘ incorporated herein by reference. Dynamic I/O gives FIG. 4 is a ?owchart showing processing by the an operating system the ability to add, delete or modify hypervisor of requests for informational CHSC com the de?nition of devices, control units and channel mands by a system in a partition. paths without a hardware or software re-IML, or re FIG. 5 is a ?owchart showing processing by the IPL. Dynamic I/O allows the installation to add new 60 hypervisor of requests by a system in a partition to enter devices with less disruption, or having to wait for a con?guration mode. scheduled outage. The user interface for Dynamic I/O FIG. 6 is a ?owchart showing processing by the Con?guration, in the environment of the aforemen hypervisor of requests by a system in a partition to exit tioned applications, is through MVS/ESA. MVS/ESA con?guration mode. has an interactive front-end guide called the Hardware 65 FIG. 7 is a control block diagram showing the format Con?guration Dialog (HCD) function. HCD allows the of the device detection CRW bit map (BFYCBM). user to de?ne the hardware con?guration to MVS. The FIG. 8 is a control block diagram showing the struc output of the HCD is an I/O De?nition File (IODF). ture of the Add-Modify CRW structure (BFYAMC). 5,253,344 3 4 FIG. 9A is a state diagram providing a representation rization is administered on the Logical Partition Secu of the state engine for a CHSC subchannel in the pres rity (LPSEC) frame. ent invention. In LPAR mode, each authorized partition is allowed FIG. 9B is a table de?ning the states in the state dia to enter con?guration mode via the I-ICD running in gram of FIG. 9A. MVS. Only one partition is allowed to be in con?gura tion mode at a time. The partition running in con?gura DESCRIPTION OF THE PREFERRED tion mode may add or delete I/O devices, control units EMBODIMENT and channel paths for itself, or for other partitions. The preferred embodiment of the present invention is At a level below the I‘ICD user interface, 1/0 is described within the framework of a logically parti added, deleted, and modi?ed via Channel Subsystem tioned IBM BSA/390 processing system, using the Call commands (CHSCs). The general format of a chan MVS/ESA operating system within the logical parti nel subsystem call command is as follows: There are tions. two pieces: a command-request block, and a command Processor Resource/System Manager (PR/SM) is response block. In storage, the command-request block IBM's name for the system facilities that enable the is found ?rst, followed immediately by the command logical partitioning of a processor complex. When response block. The command-request block contains PR/SM is installed, the processor complex (or side of a information necessary to execute a channel subsystem physically-partitioned processor complex) can be ini call. One piece of information that every CHSC has in tialized for logically-partitioned (LPAR mode) opera its command-request block is the command code. This tion. When the LPAR mode of operation is selected, the indicates which command is to be executed. Other in operator can de?ne the resources that are to be allo formation in the command-request block is speci?c to cated to each logical partition. After an BSA/390 logi the command being issued. The command-RESPONSE cal partition is de?ned and activated, MVS/ESA can be block contains speci?c information ?lled-in by the I/O loaded into that logical partition and begin operation. subsystem and/or the LPAR hypervisor after the This invention provides the LPAR facilities that are CHSC is executed. A response code and other support necessary to adapt the system so that dynamic con?gu ing data are found here. The following are the CHSC commands that an oper ration changes can be made successfully in an LPAR ating system running in a logical partition would use for mode operating environment. performing Dynamic I/O recon?gurations on an In this description, the term LPAR hypervisor (or BSA/390 system. LPAR) is used to denote the processing that is done to Change Con?guration Mode support the PR/SM LPAR mode of operation. Change Channel Path Con?guration Overview Change Control Unit Con?guration Change I/O Device Con?guration The LPAR hypervisor employs a passthrough ap Store Con?guration Information proach to requests issued within the logical partition Principles of this invention that relate to adapting that has begun a dynamic I/O recon?guration request. Dynamic 1/0 to operate in a logically partitioned Each request is passed along to the I/O Processor (IOP) (LPAR) system environment. for processing by the basic Dynamic I/O facility. At the The LPAR hypervisor maintains the status of the end of a Dynamic I/O recon?guration request, the 40 CHSC Subchannel in its storage so that it can synchro LPAR hypervisor compares the new con?guration nize activity between the partition, the Processor Con with the old one and generates channel reports to notify troller (PCB), and the channel subsystem (CS5). The any other logical partitions that have been affected by CHSC subchannel in LPAR storage is necessary be the con?guration changes. cause of the asynchronous commands used in Dynamic A state engine is employed to represent the subchan I/O, and the LPAR hypervisor’s need to update its own nel for CHSC requests which enact changes in the I/O control blocks. con?guration. The state engine is depicted in FIG. 9A The status which LPAR maintains includes a multi and described in detail below. bit lock to control the processing of the CHSC subchan A bit map for each logical partition is employed to nel. MODIFY SUBCHANNEL (MSCI-I) and STORE represent channel report words (CRWs) for each poten 50 SUBCHANNEL (STSCH) are instructions known in tial subchannel number that are pending for the removal the prior art that can be executed against the CHSC of the associated subchannel number from the logical subchannel. A MSCl-I/STSCH lock is used to interlock partition, either as the result of dynamic I/O recon?gu the information between MSCH and STSCH. ration, or as the result of decon?guring a channel path CHSC commands that cause the Processor Control from the logical partition. Channel reports exist in the ler to participate in the processing, such as Add Chan prior art, for example, see the IBM publication IBM nel Path and Delete Channel Path, leave the CI-ISC System/ 370 Extended Architecture Principles of Oper subchannel in the function-pending and not-active state ation IBM publication number SA22-7085), page l7~l5. while that processing is in .progress. This subchannel A subchannel extension containing an Add/Modify state is necessary because of the possibility of receiving code is employed to represent channel report 60 unsolicited status on the actual CHSC subchannel, words(CRWs) that are pending for the addition or alter where function-pending must be I and subchannel ac ation of the subchannel, either as the result of dynamic tive must be zero. I/O recon?guration, or as the result of con?guring a The CRWs for new and modi?ed devices are not channel path into a logical partition. Manipulation of presented to the logical partitions that are not in con?g the states of this code is de?ned through the use of a 65 uration mode until con?guration mode is successfully state engine. ended for the logical partition in con?guration mode. In order to change the current I/O de?nition, a parti The purpose of waiting for the ending of con?guration tion must be given the proper authorization. This autho mode is to lessen the amount of confusion in case the 5,253,344 5 6 logical partition in con?guration mode adds and deletes processing outlined at 102 in FIG. 1 summarizes this the same subchannels from the same logical partition. more detailed processing. While the logical partition could issue STSCHs to dis To modify the I/O con?guration, the logical parti cover the existence of new devices, it would then be up tion issues a CHSC instruction requesting a change to the logical partition to realize that this device could (102A). LPAR passes the request to the channel subsys “disappear” at any time while con?guration mode pro tem to allow it to perform the requested change. After cessing is taking place. A logical partition in con?gura the channel subsystem makes the requested I/O con?g‘ tion mode receives noti?cation of any new subchannels uration change, the LPAR hypervisor determines the in its CHSC command-response block, so it does not effect of the con?guration change on all the logical need CRWs for noti?cation. partitions (102B). The LPAR hypervisor does this by Logical Partition system reset on CHSC subchannels examination of the channel subsystem control blocks. will be complete before Logical Partition system reset These channel subsystem control blocks are in Hard starts on I/O subchannels. This sequencing leaves the ware System Area (I-ISA). The LPAR hypervisor then CHSC subchannel disabled during I/O subchannel pro updates its view of the I/O con?guration. Other logical cessing and lessens the chance of CHSC interference in 15 partitions are noti?ed via channel report words of any UC subsystem processing. deleted subchannels(l02C). The logical partition can The LPAR hypervisor passes the Logical Partition then make additional requests to change the I/O con?g ID (LPID) of a channel path to the processor controller uration, or end the I/O recon?guration session by issu prior to issuing the CHSC command to Add Channel ing the appropriate CHSC instruction (103). After the Path because this information is not otherwise available 20 U0 con?guration session is completed, the LPAR to the processor controller. hypervisor noti?es other logical partitions of subchan It is important that a channel path be decon?gured nels added or modi?ed via channel report words, before it is deleted. Therefore, on all Delete Channel CRWs(104). Path CHSC commands, the LPAR hypervisor decon CRWs for devices added, modi?ed, or deleted are not ?gures the channel path if it is still con?gured at the presented to the logical partition in con?guration mode, time that the LPAR hypervisor receives the CHSC for which receives a list of subchannels added, modi?ed, or Delete Channel Path. If the CHSC command for Delete deleted in each CHSC command response block. Channel Path fails after the LPAR hypervisor has CRWs are not presented to System/370 mode logical decon?gured the channel path, the channel path will partitions (that is, logical partitions that do not operate remain decon?gured. 30 in S/370-XA, BSA/370, or BSA/390 mode). The Store Con?guration Information command re There are ?ve categories of Dynamic I/O CHSC turns the LPID of the logical partition in con?guration commands. These commands are processed as de mode. The CSS puts the LPID in for the LPAR hyper scribed below and summarized in FIGS. 2 through 6. visor’s recovery processing. In LPAR mode, the hyper visor is responsible for clearing the LPID from the 35 1. Changes I/O con?guration but does not involve command-response block before giving the response to Processor Controller the requesting logical partition. This command also Precheck validity of request block 201, such as fea returns an LPID/logical partition name map which the ture installed and requesting logical partition being in LPAR hypervisor must clear unless the requesting logi con?guration mode. If error is found, then return a cal partition is the one in con?guration mode. response code describing the error and post the comple A logical partition can be allowed to add, delete and tion code 208. If no error, then post condition code 202 modify devices in the I/O con?gurations of other logi and pass the request to the I/O processor (IOP) 203. cal partitions. A logical partition is given authorization Wait for the completion interruption 204. If the com to rede?ne its own I/O, or the I/O of other logical mand executed successfully, then analyze the changes partitions via the LPSEC frame. 45 to the con?guration by comparing the device-number If a logical partition has a device added to its con?gu valid bit, the path-installed mask, and the con?gured~ ration, it is not noti?ed about the new device until con path mask to their previous values for each subchannel ?guration mode is completed. This noti?cation is pro 205. Update the LPAR hypervisor’s I/O device control vided via a CRW. If a logical partition has a device blocks as appropriate 206, and set up for channel report deleted from its con?guration, the logical partition is word (CRW) noti?cation by updating the BFYAMC noti?ed immediately via a CRW; the idea being that the array and the BFYCBM array 207. Post completion logical partition, when noti?ed of the deletion immedi code 208. ately, will not try to use the deleted device any longer. lfa deleted device CRW is not processed, a new device 2. Add/Delete channel path (Involves the Processor added on the same subchannel, while still in con?gura 55 Controller tion mode, will not be known to the logical partition Pre-check validity of request block 301, such as fea until the deleted device CRW is processed. ture installed and requesting partition being in con?gu ration mode. If error is found then return a response Dynamic I/O Functions code describing the error, and post the completion code FIG. 1 shows a general ?ow of a Dynamic l/O con 60 307. If no error then post condition code 302. In the case ?guration session using CHSCs. of an Add Channel Path command, the logical partition First a logical partition enters con?guration mode by ID is passed to the Processor Controller 303. In the case executing the appropriate CHSC instruction (101). A of a Delete Channel Path command the Processor Con logical partition may then modify the I/O con?guration troller is signalled to decon?gure the channel path, it‘ (102). necessary 303. If not OK then post completion code The processing of such modi?cations varies with the 307. If OK then pass request to IOP 304. Wait for the nature of the modi?cation-possible modi?cation cases completion interruption 305. When command executes are shown in FIG. Z-FIG. 6, and described below. The OK, then update con?guration information 306. Post 5,253,344 7 8 completion code 307. No subchannel de?nition changes CRWs are queued to logical partitions other than the occur as a result of Add/Delete channel path. one operating in con?guration mode. The logical parti tion is made aware of the CRW via a machine-check 3. Strictly Informational interruption. The logical partition processes the CRWs Pre~check validity of request block 401, such as fea~ 5 by issuing a Store CRW command. If the logical parti ture installed and partition in con?guration mode. If tion being affected is a logical partition operating in error in request is found then return an appropriate S/370 mode, there is no noti?cation of devices being response code describing the error, and post the com added or deleted, because a 5/370 logical partition can pletion code 405. If request is valid then issue the CHSC not process CRWs. to IOP 402 and post condition code 403. On interrupt After each CHSC command that generates subchan» 404, post completion code 405. nels in its response block, the LPAR hypervisor com 4. Con?g On pletely rebuilds its internal con?guration tables. The LPAR hypervisor is not dependent for this on the sub Pre-check validity of request block 501, such as no channels in the response block. other partitions in con?guration mode, partition autho Change Con?guration Mode: Change Con?guration rized, and request block ?elds contain allowed values. If Mode either begins or ends con?guration mode. This error found then return an appropriate response code mode must be activated to ensure successful execution and post completion code 507. If pre-check passes, then of those CHSC commands that modify the I/O con?gu update LPAR control blocks S02, and issue the CHSC ration de?nition in the channel subsystem. The base to the IOP 503. Post Condition code 504. On interrupt rules for entry into this mode are: 505, restore hypervisor’s information blocks if error 1. No logical partition can be already in con?guration 506, and post completion code, 507. mode, including the same logical partition. 5. Con?g OFF 2. There must be an enabled CHSC subchannel speci ?ed in a partition. Pre-check for validity of request block 601, such as 3. The CHSC subchannel must not be busy. requestor currently in con?guration mode, and request 4. The partition must be authorized to make con?gura block ?elds containing allowed values. If error found tion changes. then return an appropriate response code and post a While in con?guration mode, the change-channel completion code 606. If pre-check passes then issue the path, change-control-unit, and change-device con?gu CHSC to the IOP 602. Post Condition code 603. On ration commands must be serialized with the channel interrupt 604, update information block 605 if command swap, con?gure-channel-path, and decon?gure-chan OK, and post completion code 606. nel-path commands. CHSC Commands Change Con?guration Mode either begins or ends 35 con?guration mode. This mode must be activated to Dynamic I/O CHSC commands are executed asyn ensure successful execution of those CHSC commands chronously, so a CHSC subchannel must be speci?ed by that modify the I/O con?guration de?nition in the the CHSC instruction. When in LPAR mode, there is channel subsystem. These commands are: one of these subchannels for each possible logical parti Change channel-path con?guration tion, plus one more. A portion of an asynchronous Change control-unit con?guration CHSC instruction is executed synchronously and an other portion is asynchronously. Successful execution Change I/O device con?guration of the synchronous portion results in a CC: 1. In this If the machine is operating in LPAR mode, and a system reset is issued by the operator for the logical case, an I/O interruption can be anticipated on the spec partition that initiated con?guration mode, con?gura i?ed CHSC Subchannel. A CC=0 result requires analy 45 sis of the response-code ?eld to identify the reason for tion mode is reset, and the I/O con?guration de?nition the failure; the response-code ?eld of the command is set invalid. The LPAR hypervisor is responsible for response block describes any abnormal conditions en issuing this con?guration mode terminate. countered. When the LPAR hypervisor issues the Set Con?gu The states of a CHSC subchannel that control the ration Mode On command for a logical partition, byte 3 execution of all the Dynamic l/O functions in LPAR of word 1 contains the logical partition number of the mode are shown and de?ned in FIG. 9A and FIG. 9B, program that executed this instruction. When the ma respectively. The actual Dynamic I/O CHSC com chine is not operating in LPAR mode, this ?eld must be mands are described below, and the processing is sum zero. marized in Table 1. 55 Response code ‘0104’X indicates that a logical parti When a change has been completed, the LPAR tion other than the one that executed this command has hypervisor will generate a subchannel installed-parame already initiated con?guration mode and is currently ters-initialized channel report for each subchannel that running in con?guration mode. A response code of provides a ?rst path to a logical partition other than the ‘0104’X is returned when a logical partition is initiating logical partition that issued the con?guration change 60 con?guration mode while another logical partition is CHSC. also attempting to enter con?guration mode. When devices are added to logical partitions, CRWs Change Channel Path Con?guration: This CHSC is are queued to the respective logical partitions and pro issued to add, delete or modify the de?nition of a chan cessed when the logical partition that is in con?guration nel path. Each of these has a set of rules associated with mode leaves con?guration mode. When devices are 65 them. The ADD rules are as follows: deleted from logical partitions, CRWs are presented 1. The channel subsystem must be in con?guration immediately; the LPAR hypervisor does not wait until mode. con?guration mode ends. 2. The channel path must not be already de?ned. 5,253,344 10 3. The 1/0 de?nition must not contain any control unit con?guration de?nition. Also, the I/O con?guration descriptions which indicate that the control unit is de?nition must contain a description of the speci?ed attached to the channel path being added. channel path. The DELETE rules are as follows: Change Control Unit Con?guration: This CHSC is 1. The channel subsystem must be in con?guration issued to add, delete or modify the de?nition of a con mode. trol unit. Each of these has a set of rules associated with 2. The channel path must be de?ned in the current them. con?guration. Add Control Unit: Certain rules apply to the addition 3. The 1/0 de?nition must not contain any control unit of control units: descriptions which indicate that the control unit is The 1/0 Con?guration de?nition must not already attached to the channel path being deleted. contain a description of the speci?ed control unit. The Processor Controller is signalled as a result of The 1/0 Con?guration de?nition must contain a the IOP communicating the change request. Results of description of speci?ed channel paths. the Processor Controller actions are returned via the The 1/0 Con?guration de?nition must not contain same mechanism and appear as response codes in the 15 any I/O device descriptions that indicate that the asso CHSC command-response block. Processor Controller ciated I/O devices are attached to the speci?ed control involvement is needed to maintain the current assign unit. ment of channel paths to logical partitions. These dy The program must have initiated con?guration mode. namic I/O changes are combined with any con?gure Delete Control Unit: Certain rules apply to the dele channel-path or decon?gure-channel-path recon?gura~ tion of control units: tion commands. Change Channel Path Con?guration is used to mod The 1/0 Con?guration de?nition must not contain ify channel path descriptions in the I/O Con?guration any I/O device descriptions that indicate that the asso ciated I/O devices are attached to the speci?ed control De?nition. The command has the ability to add or de umt. lete channel path descriptions. 25 In the command-request block, bytes 0-1 of word 6 The 1/0 Con?guration de?nition must contain a specify which eight-byte entries in the logical-partition description of the speci?ed control unit. names ?eld contain valid logical-partition names. The program must have initiated con?guration mode. Bytes 2-3 of word 6 specify which of the logical Modify Control Unit: Certain rules apply to the mod partitions designated by valid logical-partition names 30 i?cation of control units: are to have initial access to the speci?ed channel path. The 1/0 Con?guration de?nition must contain a Bits 0-15 correspond from left to right. with the 16 description of the speci?ed channel paths. 8-byte entries in the logical-partition-names ?eld. The 1/0 Con?guration de?nition must contain a At byte 0 of word 7, the logical-partition names be description of the speci?ed control unit. gin. Each of the contiguous eight-byte ?elds can con The program must have initiated con?guration mode. tain an eight-character (EBCDIC) logical-partition When the system is running in LPAR mode, and a name. Valid logical-partition names are determined by channel path is added to, or deleted from, the list of bits that are one in the candidate-logical-partitions ?eld. channel paths that can be used to access the speci?ed In the command-response block, certain LPAR control unit and if, as a result, I/O devices that are speci?c inforrnation is maintained. A response code of 40 attached to the speci?ed control unit can be accessed ‘0104’X occurs when the machine is in LPAR mode, differently by logical partitions other than the logical and the Operation-Code Quali?er (OCQ) ?eld of the partition operating in con?guration mode, all other command-request block contains a value of 2. This logical partitions are noti?ed of this event by means of means that either or both of the candidate-logical-parti a channel report. tions or access-logical-partitions ?elds of the command 45 The results of a modify control unit can contain a list request block contain all zeros. of subchannels that have been added, deleted or modi A response code of ‘0108’X may indicate that an add ?ed as result of the command. The LPAR hypervisor operation was speci?ed, and the machine is operating in updates its internal control blocks to re?ect these LPAR mode, but the OCQ does not contain a l or a 2. changes. A response code of ‘010C’X speci?es that the ma 50 When the system is running in LPAR mode, and a chine is running in LPAR mode, and the speci?ed chan channel path is added to the list of channel paths that nel path is the only channel path for one or more logical can be used to access the speci?ed control unit, logical partitions. partitions other than the one in con?guration mode will Add Channel Path: In order to add a channel path be noti?ed by CRWs at the end of con?guration mode de?nition to the I/O Con?guration, the I/O Con?gura of devices that are attached to the speci?ed control unit tion de?nition can not contain a description of the speci for which access was added. ?ed channel path. Also, the I/O con?guration de?ni When the change to a control unit causes subchannels tion can not contain any control unit descriptions that to be deleted, the LPAR hypervisor generates and indicate that the associated control units are attached to makes immediately pending a subchannel installed the speci?ed channel path. The program must have parameters-initialized CRW for each subchannel that initiated con?guration mode prior to adding the chan was deleted from or for which the last path was re nel path to the I/O con?guration de?nition. moved from a logical partition. CRWs are not gener Delete Channel Path: In order to delete a channel ated for the logical partition that is in con?guration path from the I/O Con?guration, it can not contain any mode. control unit descriptions that indicate that the associ 65 Change I/O Device Con?guration: This CHSC is ated control units are attached to the specified channel issued to add, delete or modify the de?nition of an I/O path. The program must have initiated con?guration device. Each of these has a set of rules associated with mode, prior to deleting the channel path from the I/O them. 5,253,344 11 12 Adding a Device: Certain rules apply to adding a -continued device to the I/O con?guration de?nition: Subchannel is enabled. The 1/0 con?guration de?nition must not already State 1 exists whenever the CHSC contain a description of the speci?ed I/O devices. Subchannel PMCW is being updata‘l. After One or more control units must be speci?ed and de the Channel System successfully completes scribed in the I/O con?guration de?nition. a real MSCH for the logical partition and the LPAR hypervisor updates the logical The requesting logical partition must be operating in partition's CHSC Subchannel, the value of con?guration mode. theloeltisupdatedtoOil'theCHSC When the system is running in LPAR mode, and I/O Subchannel is disabled. devices are added so that they can be accessed for the The CHSC Subchannel is enabled and idle when a logical partition issues an MSCH ?rst time by logical partitions other than the logical instruction to update the PMCW of the partition that is executing in con?guration mode, the CHSC Subchannel. The value of the lock other logical partitions are noti?ed of this event by is changed to l. means of a channel report. 2-20 The CHSC Subchannel is idle and enabled when an unsolicited interruption is Modifying a Device: Certain rules apply to modify received for it. The lock value is ing a device in the I/O con?guration de?nition: updated to 20. One or more control units must be speci?ed and de 2-3 The CHSC Subchannel must be enabled and scribed in the I/O con?guration de?nition. idle in order for the LPAR hypervisor to The 1/0 con?guration de?nition must contain a de process an asynchronous CHSC instruction. 20 The value of the lock is updated to 3 scription of the speci?ed I/O devices. when the LPAR hypervisor begins to check The requesting logical partition must be operating in forCC = OorCC = leonditions. While con?guration mode. in state 3, logical partition system resets and unsolicited interruptions are When the system is running in LPAR mode, and I/O locked out, and must spin until the state devices are modi?ed so that they can be accessed for is no longer 3. the ?rst time by a logical partition other than the logical Prior to completing the CHSC instruction partition operating in con?guration mode, or can be processing, an error is detected. The value of the loclt is changed to 2. A accessed differently by a logical partition other than the response code is set and the CHSC logical partition operating in con?guration mode, the instruction completes with condition code other logical partitions are noti?ed of this event by 0, or a program exception interruption 30 means of a channel report. occurs, or an exigent machine check interruption occurs, or the logical CPU Deleting a Device: Certain rules apply to deleting a enters a checkstopped state. device in the I/O con?guration de?nition: 3-4 The CHSC instruction executed by the The 1/0 con?guration de?nition must contain a de logical partition completes with CC -= l scription of the speci?ed I/O devices. and the value of the lock is updated to 4. The requesting logical partition must be operating in An asynchronous CHSC instruction which con?guration mode. does not alter the 1/0 con?guration, and When the system is running in LPAR mode, and I/O for which PlCLOCKs are therefore not devices are deleted, that had been accessed by logical required, is executed by the logical partition and receives a CC = l in partitions other than the logical partition operating in response. The value of the lock is con?guration mode, the other logical partitions are updated to 9. noti?ed of this event by means of a channel report. While making a function pending, an error occurs which must be reported as an Dynamic I/O CHSC Subchannel State Transitions asynchronous error to the logical partition. The CHSC instruction As noted, FIG. 9A shows a diagram representing the 45 completes with condition code 1. The state engine for a CHSC subchannel. The states indi lock value is updated to 17. cated in FIG. 9A are de?ned in FIG. 9B. The current A PICLOCK obtainer attempts to obtain all of the PICLOCKs for all of the logical state value is kept in the lock word that is used to serial partitions as well as a global logical ize access to the CHSC subchannel, thus the terms partition activation lock. If it is “lock value,” “state,” and “state value” are synony 50 unsuccessful, the value of the lock is mous. updated to 16. If this request is no longer the current The following list describes all the allowable state synchronous CHSC request for the logical transitions of a CHSC subchannel depicted in FIG. 9A. partition, as determined by an inspection The terms PICL and PICLOCK refer to a logical Parti of a count in the CHSC Subchannel, a tion I/O Con?guration Lock that is used to serialize logical partition system reset has 55 occurred while unsuccessfully attempting I/O con?guration changes. to obtain the loclts and the value of the lock is restored to 4. A PICDOCK obtainer attempts to obtain all 0--l State 0 exists whenever the CHSC of the PICLOCKs for all of the logical Subchannel is disabled, as determined by partitions as well as a global logical the enablement bit in its Path Management partition activation look. If it is Control Word (PMCW). Enter state 1 successful, the value of the lock is whenever the CHSC Subchannel PMCW is updated to 5. being updated. A logical partition system reset must l-2 State 1 exists whenever the CHSC - clear the active function and update the Subchannel PMCW is being updated. After PMCW. The value of the lock is changed the Channel System successfully completes 65 to 1. a real MSCH for the logical partition and While the CHSC Subchannel is in a the LPAR hypervisor updates the logical function-pending state awaiting PlCLOCKs partition‘s CHSC Subchannel. the value of or interrupt, an unsolicited interruption the lock is updated to 2 if the CHSC is presented by the Channel Subsystem. 5,253,344 13 14 -continued -continued The lock value is changed to 20. CHSC subchannel from the Channel 5-4 If this request is no longer the current Subsystem. asynchronous Cl-ISC request for the logical After the LPAR hypervisor has updated all partition, as determined by an inspection of its control blocks for all logical of a count in the CHSC Subchannel, a partitions whose l/O definitions changed logical partition system reset has as a result of the CHSC instruction, the occurred while successfully obtaining the lock is updated to 12. locks and the value of the lock is 18-43 Unsolicited status presented by the restored to 4. Channel Subsystem is placed into the 5-7 For a command type which must be passed 10 storage in which the status is maintained to the Processor Controller before being for the CHSC subchannel by the LPAR passed to the Channel subsystem, the lock hypervisor. The lock value is changed to is set to a value of 7, and the command 13 is passed to the Processor Controller. The LPAR hypervisor presents the response For a command type which is not passed to from the Channel Subsystem to the logical the Processor Controller before being 15 partition, with whatever ?ltering is passed to the Channel subsystem, the appropriate. I/O completion status is value of the lock is changed to 6, and made pending for the CHSC subchannel in the command is passed to the channel the storage maintained by the LPAR subsystem. hypervisor. The value of the lock is 7-6 The command passed to the Processor changed to 13. Controller has successfully completed. It was not possible to obtain the The lock value is updated to 6 before the PlCLOCKs. An appropriate response code command is pused to the Channel is presented to the logical partition. Subsystem. l/O completion status is made pending for The command passed to the Processor the CHSC subchannel in the storage Controller has completed unsuccessfully. maintained by the LPAR hypervisor. The The lock is updated to 19. lock is updated to 17. 6--9 The command is passed to the channel 25 Updating of the PMCW of the CHSC subsystem, for which the real CHSC subchannel on behalf of an MSCH instruction completes with CC = 1. The instruction by the logical partition is lock value is updated to 9. rejected by the Channel Subsystem due to 6-10 The command is passed to the channel pending status. The MSCl-l instruction by subsystem, for which the real Cl-lSC the logical partition is completed with instruction completes with CC = 0 or CC = CC=1 and the lock is updated to 20. 2. The lock value is updated to l0. The PICLOCKs are released and the lock The LPAR hypervisor either receives an value is updated to 14. Reset of the interruption from the Channel Subsystem CHSC subchannel for logical partition for the CHSC subchannel, or is systern reset, which may be accepted as intercepted for a STSCH, MSCl-l or TSCH soon as its PICLOCK is released, cannot instruction from the logical partition 35 proceed so long as the lock has a value and decides to inspect the status of the of 13. real CHSC Subchannel. The value of the A logical partition system reset occurs lock is updated to 10 before the status while the lock is in state 14, or a TSCH in the real CHSC Subchannel is inspected. instruction for the CHSC subchannel is The LPAR hypervisor obtains any pending issued by the logical partition while the status for the CHSC subchannel from the lock is in state 14. The lock is updated Channel Subsystem. If no status is to 15 before status is removed from the pending and the function-pending bit is storage maintained for the CHSC zero, then the value of the lock is subchannel by the LPAR hypervisor. Any changed to 8. additional, unsolicited status in the The LPAR hypervisor obtains any pending channel subsystem is held pending in the status for the CHSC subchannel from the 45 channel subsystem while the lock value is Channel Subsystem. If no status is 14. pending and the function-pending bit is 15-20 Status is cleared from the storage one, then the value of the lock is maintained for the CHSC subchannel by the changed to 9. LPAR hypervisor. The value of the lock lO-ll The LPAR hypervisor obtains any pending is changed to 20 before attempting to status for the CHSC subchannel from the obtain any additional, unsolicited status Channel Subsystem. 1f status was pending from the channel subsystem. and the response indicates that the Logical Partition System reset changes command was successful, the value of the the value of the lock to l to show that lock is changed to 11. the PMCW of the CHSC subchannel is being The LPAR hypervisor obtains any pending updated. status for the CHSC subchannel from the 19-13 [/0 completion status is made pending for Channel Subsystem. If status was pending 55 the CHSC subchannel in the storage and the response indicates that the maintained by the LPAR hypervisor after command was unsuccessful, the value of the command passed to the Processor the lock is changed to 12. Controller has completed unsuccessfully. The LPAR hypervisor obtains any pending The value of the lock is changed to 13. status for the CHSC subchannel from the 20--2 No unsolicited status was obtained from Channel Subsystem. If unsolicited status the Channel Subsystem for the CHSC became pending prior to execution of the subchannel. The CHSC subchannel is idle command by the channel subsystem, the and enabled. The value of the lock is value of the lock is changed to 18. updated to 2. The LPAR hypervisor receives an 20-4 t No unsolicited status was obtained from interruption for the CHSC Subchannel from the Channel Subsystem for the CHSC the Channel Subsystem, or is intercepted 65 subchannel. The CHSC subchannel is for a STSCH, MSCH, or TSCH instruction function pending. The value of the lock from the logical partition. The value of is restored to a previous value of 4. the lock is updated to 10 before 20-- 14 Unsolicited status obtained from the obtaining any any pending status for the Channel Subsystem is made pending in the 5,253,344 15 16 -continued system reset, the LPAR hypervisor clears the AMC storage maintained for the CHSC CODE of the BFYAMC entries for that logical parti subchannel by the LPAR hypervisor. tion, (See Table 4). When con?guration mode is ended, I/O completion status is made pending for the BFYAMC entries are updated so that all of the the CHSC subchannel in the storage maintained by the LPAR hypervisor for an AMCCODE values specify immediate noti?cation, error which occurred while making a (See Table 3). function pending, which must be reported When a logical partition has con?gured a channel as an asynchronous error to the logical path on-line such that a device previously unknown to partition. The value of the lock is updated to 14. the partition becomes accessible, then the correspond ing BFYAMC entry is updated to specify immediate noti?cation, (See Table 5). Data Structures When a subchannel is removed from the con?gura BFYCBM: There is one BFYCBM CRW bit map per tion, the corresponding BFYAMC entry is updated to logical partition (See FIG. 7). BFYCBM is a bit map purge noti?cation (See Table 6). containing one bit per possible subchannel. The length System Reset of a Logical Partition of this bit map is determined by the number of possible subchannel numbers in the machine. The bit positions in The reset of a logical partition that is in con?guration BFYCBM are numbered starting with zero, and each mode results in the LPAR hypervisor issuing the bit position represents the corresponding subchannel 20 change con?guration mode CHSC with the request numbers. The BFYCBM is created during LPAR ini block requesting a terminate con?guration mode and tialization for each logical partition in the I/O Con?gu establishes the I/O-con?guration session as incomplete. ration. Store Con?guration Information When a Dynamic I/O con?guration change occurs that causes a partition not in con?guration mode to lose 25 Store Con?guration Information allows a program to access to a device, the bit position in the BFYCBM that obtain con?guration information from the channel sub corresponds to the number of the subchannel associated system. The execution of this command does not with that device is set to one. A bit set to one in change any information contained in the channel sub BFYCBM signi?es that there is a deletion CRW pend system. ing for the corresponding subchannel. When the logical 30 When the system is operating in LPAR mode, byte 3 partition stores a CRW which is represented in the of word 2 in the command-response block is set to the BFYCBM, the corresponding bit in the BFYCBM is set logical-partition number of the logical partition which to zero by LPAR. initiated con?guration mode. This ?eld is set to zero BFYAMC: There is one global structure called before being presented to the logical partition. If the BFYAMC, Add Modify CRW, per machine (See FIG. system is not operating in LPAR mode, byte 3 of word 8.). There is an entry for each possible subchannel in the two of the command-response block is not used by the machine. The BFYAMC array is created during LPAR channel subsystem. initialization. In LPAR mode the CSS sets the partition-names Each entry of the BFYAMC array contains the fol validity ?eld and the partition-names ?eld in the CHSC lowing: response block. If the partition is not in con?guration AMCCODE-possible values are described in Table mode, LPAR clears the partition-names validity ?eld 2. and the partition-names ?eld before the response block AMCLPNUM-speci?es the logical partition to re is presented to the logical partition. ceive any CRW described by AMCCODE. AMCDLSNM-Current session number, which is 45 Differences Between LPAR Mode and Basic Mode one plus the the number of completed dynamic I/O There are some differences between executing Dy con?guration sessions. namic I/O con?guration commands in LPAR mode The AMCCODE for a subchannel indicates if the and in the basic mode of the machine. CRW is to be made pending, either immediately or after the con?guration session has ended, and the type of In LPAR mode, if a logical partition is already in CRW, either alteration or creation. (See Table 2). When con?guration mode, and another logical partition at the logical partition stores a CRW which is represented tempts to enter con?guration mode, the attempt is re in a BFYAMC entry, LPAR clears the AMCCODE for jected with a response code of ‘0l04'X. the corresponding subchannel. In LPAR mode, a logical partition must be autho~ BFYAMC represents any pending addition and mod 55 rized to change the I/O con?guration. This is achieved i?cation CRWs. Whenever a Dynamic I/O command by having the proper authorization speci?ed on the causes a partition to receive a new device (See Table LPSEC frame. 17), or have the path-installed-masks change from one If the logical partition is not authorized, and attempts nonzero mask to another nonzero mask in a subchannel to enter con?guration mode, the attempt is rejected for the logical partition (See Table 7), the LPAR hyper 60 with a response code of ‘OlOS’X. visor updates the corresponding entry for the subchan In LPAR mode, if the logical partition issues a Store nel in the global BFYAMC to describe the pending Con?guration Information CHSC instruction, byte 3 of CRW. word 2 of the command-response block contains the BFYAMC is searched only after searching logical partition number of the logical partition which BFYCBM, when storing CRWs for a logical partition. 65 initiated con?guration mode. In BASIC mode, this byte The LPAR hypervisor clears an entry in the BFYAMC of the command response block is zero. when the logical partition stores a corresponding CRW For the Set Con?guration Mode On command, in for a subchannel. When a logical partition undergoes a LPAR mode, the LPAR hypervisor places the logical 5,253,344 17 18 partition number (LPID) in the command-request the function-active, function-pending, and status-pend block. In BASIC mode, this ?eld must be zero. ing ?elds implied by the value of the lock. This compo CHSC Subchannel, Subchannel Commands, and sition is repeated until the asynchronous request count Facilities Affected for the CHSC subchannel at completion of the composi tion has not changed from the previously fetched value. The LPAR hypervisor maintains the status of the Otherwise, if the value of the lock is 14, a compare CHSC Subchannel in its storage so that it can synchro and-swap attempts to change the value to 15. If success nize activity between the partition, the Service Proces ful, the PMCW and SCSW are composed from values sor (PCB), and the channel subsystem (CSS). System maintained in the storage of the LPAR hypervisor and reset clears any pending status from the CHSC and the value of the lock is returned to 14. If unsuccessful, resets the multi-bit lock state in the CHSC subchannel this processing begins again for the new value of the block to zero. CHSC command code processing sets lock. The MSCH/STSCH lock is released before com and resets certain bits as described in the various CHSC pleting execution of the STSCH instruction. Subchannel Lock State diagrams throughout this appli cation. CHSC Test Subchannel Simulation The executions of TEST SUBCHANNEL (T SCH), MODIFY SUBCHANNEL (MSCH), and STORE (See Table 10) SUBCHANNEL (STSCH) instructions are modi?ed to This processing occurs after invocation of the CHSC work with the CHSC subchannels as described below. missing interruption handler and after it has been deter Information that must be returned to the CHSC issuer is 20 mined that no storage operand exceptions prevent suc constructed by the LPAR hypervisor and placed into cessful storing of a storage operand. For some values of the appropriate locations in the command-response the lock for the CHSC subchannel, instruction execu block according to the de?nition of the CHSC instruc tion is nulli?ed. tion. The asynchronous request count for the CHSC sub The MSCH is reissued by the LPAR hypervisor to a 25 channel is fetched. If the value of the lock is not 14, a logical partition’s CHSC subchannel to update the en Subchannel Channel Status Word(SCSW) is composed able bit, the ISC#, and the interruption parameter. using an address of any current request block and the value of the function-active, function-pending, and CHSC Missing Interruption Handler status-pending ?elds implied by the value of the lock. (See Table ll) 30 This composition is repeated until the asynchronous request count for the CHSC subchannel at completion This is a missing interruption handler for CHSC sub of the composition has not changed from the previously channels, which is invoked for logical partition execu fetched value. Instruction execution is completed with tion of TSCH, STSCH, and MSCH instructions which condition code 1. refer to a CHSC subchannel. The LPAR hypervisor Otherwise, if the value of the lock is 14, a compare calls different modules to check for solicited or unsolic and-swap attempts to change the value to 15. If success ited status based on the value of the lock for the CHSC subchannel. ful in changing the lock value to 15, an attempt is made to acquire the VIOQLOCK, which is the lock for the CHSC Modify Subchannel Simulation virtual I/O interruption queue to which the subchannel is assigned. If unsuccessful in acquiring the VIOQ (See Table 8) LOCK, the value of the lock for the CHSC subchannel This processing occurs after invocation of the CHSC is restored to 14 and the instruction is nulli?ed. If suc missing interruption handler. The operand of a MSCH cessful in acquiring the VIOQLOCK, the CHSC sub is a path management control word(PMCW). The channel is removed from any I/O interruption queue, MSCH/STSCH lock is obtained before examining the the VIOQLOCK is released, status is stored in the stor value of the lock for the CHSC subchannel. The update age operand from storage maintained for the CHSC of the PMCW is passed to the channel subsystem. If subchannel by the LPAR hypervisor, status is cleared successful, the LPAR hypervisor updates its storage to from storage maintained for the CHSC subchannel by re?ect the change in the PMCW for the CHSC sub the LPAR hypervisor, any unsolicited status is obtained channel. lf unsuccessful due to unsolicited status held from the channel subsystem and made pending in stor pending at the channel subsystem, this status may be age maintained for the CHSC subchannel by the LPAR accepted and made pending. The MSCH/STSCH lock hypervisor, and instruction execution is completed with is released before completing execution of the MSCH CC=0. instruction. CHSC Interruption Look For Status CHSC Store Subcharmel Simulation 55 (See Table 12) (See Table 9) This processing occurs in response to an interruption This processing occurs after invocation of the CHSC presented by the Channel Subsystem for a CHSC sub missing interruption handler. The MSCH/STSCH lock channel. Solicited or unsolicited status may be pending. is obtained before examining the value of the lock for the CHSC subchannel. For some values of the lock, the Dynamic I/O Locking MSCH/STSCH lock is released and instruction execu Besides the multi-bit CHSC Subchannel lock, the tion is nulli?ed. The asynchronous request count for the LPAR hypervisor needs a MSCH/STSCH lock to CHSC subchannel is fetched. If the value of the lock is maintain consistency between the MSCH and the not 14, the PMCW is taken from value maintained in the 65 STSCH command on the CHSC Subchannel. storage of the LPAR hypervisor and a Subchannel In a Dynamic I/O environment, where one logical Channel Status Word(SCSW) is composed using an partition can be changing another logical partitions’ address of any current request block and the value of I/O con?guration, it is necessary to lock all logical 5,253,344 19 20 partition’s I/O con?gurations before proceeding with entries for its subchannels and clearing its BFYCBM bit the Dynamic I/O con?guration change. The logical map to zero. partition in Con?guration Mode obtains all the PI CLOCKs before the LPAR hypervisor passes the I/O Con?guration Changing CHSC Commands CHSC command to the channel subsystem. See Table Whenever a CHSC command is issued to change the 13. I/O con?guration, the LPAR hypervisor gets control. If all the PICLOCKs are not obtained in a reasonable For the Add/Delete Channel Path CHSC commands it time, the ones that were obtained must be released See is necessary for the LPAR hypervisor to do some pre Table 14. If the PICLOCKs are not obtained, the value processing. The LPAR hypervisor does only as much of the CHSC Subchannel lock is changed from 4 to 16 command-request-block validation as is needed to en using CS logic and an interruption is generated to the sure that the proper order of condition code setting and logical partition with a response value of X‘Ol 10’. If the program interruptions is maintained. The LPAR hyper PlCLOCKs are successfully obtained, the value of the visor then passes the CHSC command to the channel CHSC Subchannel lock is changed from 4 to 5 using subsystem. compare and swap and the Cl-lSC command is passed to the channel subsystem. Once the channel subsystem has completed its pro Many values of the lock for the CHSC subchannel cessing of the con?guration-change request, it signals cannot be present at completion of the attempt to ac the LPAR hypervisor with an I/O interruption. If the quire PlCLOCKs for the request unless a logical parti LPAR hypervisor determines that a good response code has been returned, it updates its I/O con?guration tion system reset has occurred and the request has been 20 cancelled. control blocks to re?ect what the channel subsystem There is a count of the number of CHSC instructions currently has de?ned as determined by examination of issued for the subchannel which is used to determine the channel subsystem control blocks. when a system reset has occurred and the command is Exit of Con?guration Mode no longer the active request. When the request is no longer the active request, any PICLOCKs which were The completion of a Dynamic I/O con?guration obtained are released and the state is restored to a value session can occur either because a logical partition in of 4, in order to allow the active request to proceed. con?guration mode executes a CHSC command to exit con?guration mode, or because system reset is done to Logical Partition System Reset a partition in con?guration mode. When con?guration (See Table 16) mode is terminated, the LPAR hypervisor updates If the Logical partition is in con?guration mode, the BFYAMC entries for CRWs pending at the end of con?guration session is ended with an indication that session. (See Table 3). the session was incomplete. GLOSSARY OF TERMS (See Table 15) The following terms and acronyms are used in this The resetting of the CHSC subchannel takes place document. prior to the resetting of the logical partition’s I/O sub BFYAMC (Add Modify CRW table) channels. The VIOQLOCK for the CHSC subchannel Contains information about the pending addition and is obtained before examining the value of the lock for 40 modi?cation CRWs. the CHSC subchannel. When the VIOQLOCK is not BFYCBM (CRW Bit Map) available, any pending interruptions are accepted before Each bit indicates whether or not a deletion CRW is attempting to reacquire the VIOQLOCK. For some .pending for a subchannel. values of the lock, the VIOQLOCK is released and any pending interruptions are accepted before reacquiring 45 LPAR routine which builds or re-builds LPAR’s I/O the VIOQLOCK and repeating the process. con?guration control structures. If the value of the lock was 14, a compare-and-swap CC attempts to change the value to 15. If successful in Condition Code. changing the lock value to 15, the CHSC subchannel is CHSC removed from any I/O interruption queue, the VIOQ Channel Subsystem Call. LOCK is released, status is cleared from storage main Console Function Mode. tained for the CHSC subchannel by the LPAR hypervi A partition is in console function mode when all of its sor, and the lock value is changed to 1. logical processors are in a state so they are not running If the value of the lock was 6, the reset of the CHSC on a physical processor and will not be dispatched on a subchannel enqueues itself to resume when an interrup physical processor. tion is presented by the channel subsystem for the CRW Cl-lSC subchannel, and the VIOQLOCK is released. Channel Report Word. If the value of the lock was 0, 2 or 4, a compare-and CS swap attempts to change the value to 1. Compare and Swap instruction. When the value of the lock for the CHSC subchannel CSS is changed to l by compare-and-swap, any unsolicited Channel Subsystem. status for the CHSC subchannel is cleared from the HCD (Hardware Con?guration Dialog) channel subsystem and the PMCW is set to its initial Interactive front-end guide that allows the user to value. de?ne the hardware con?guration. HSA (Hardware System Area) (See Table 4) A logical area of central storage that is used to store CRWs for the logical partition are cleared by storing Licensed'lnternal Code and control information (not zero into the AMCCODE values of the BFYAMC addressable by programs). 5,253,344 21 22 IODF TABLE 3 I/O De?nition File. LPAR Subchannel Add/Modify CRW Code Update When Con?g Mode Oil‘ is Processed Logical Partitioning. CRW State Action LPID Logical Partition ID. 0 none 1 none LPSEC 2 If AMCLP#l=LPlD,Compare&Swap from 2 to l Logical Partition Security Frame. Else Compare&Swap from 2 to 0. NEWSTATE 3 none New state of the state engine employed to represent 10 4 If AMCLP#!=LPID,Compare&Swap from 4 to 3 the CHSC subchannel. Else OomparedtSwap from 4 to 0. Note: This update cannot be performed from a stacked console function call because OLDSTATE it occurs within console function mode reset, and any attempt to use STKCR would Old state of the state engine employed to represent result in a deadlock. the CHSC subchannel. Update the entries for all partitions in a single pas, updating the scan pointer to the minimum of its current value and (subchannel-l) for each entry changed to l or 3, PCE (Processor Controller Engine) 15 keeping track of partitions for which the scan pointer was changed and had a See Processor Controller. previous value of X'GXDFFFF‘. A bit map(which may be kept in a register), can be used to indicate the partitions for PICL (Partition I/O Con?guration Lock) whichan AMCst-atevaluehaschangedto l or3.sothattheacanpointeriaupdated Lock that is held whenever a partition’s I/O con?gu only on the ?rst occurrence. Another bit map(which may be kept in a register), can be used to indicate the partitions for which the scan pointer whm updated was ration is being changed. found to have previously been X'G'XDFFFF'. PICLOCK For each such partition that turned out to be XA, make sure the partition is active, lock the CHCBK, test CHCRWOCl, set it to one and generate a CHCMCV See PICL. MCVBLK it‘ CHCRWCCI was zero, and release the CHCBK look. Processor Controller For each partition for which a Cl-lCMCV MCV'BK was generated, go around its The PCE provides support and diagnostic function local cyclic list and call STKWB with PARM=SDXWKSCI to force and interrup for the central processors. tion scan. POR 25 Power On Reset. TABLE 4 Service Processor Subchannel Add/Modify CRW Code Update For Logical See Processor Controller. Partition 1/0 Subsystem Reset VIOQ CRW State Action Virtual l/O Queue. 3O 0 none TABLE 1 CHSC instruction Simulation Action Table State Action 0 CC3 l nullify instruction 2 Compare 8: Swap from 2 to 3. For operations which may change the con?guration and therefore require all of the PICL locks, the new count value is loaded, the state is changed from 3 to 4, the new count value is passed in a stacked call or goto on the system SDXBK, and end instruction with CCl. For operations which are strictly informational and require no PICL locks, the LPAR hypervisor issures the real CSCl-l while in state 3. If the resulting condition code is O. the LPAR hypervisor ?lters the response, sets state 2 and ends instruction with CCO If the resulting condition code is 2, the LPAR hypervisor sets state 2 and ends instruction with CC2. If the resulting condition code is l, the LPAR hypervisor changes the state to 9 and end instruction with CCl. 3 nullify instruction 4 CC2 5 CC2 6 CC2 7 CC2 8 CC2 9 CC2 1O CC2 ll CC2 l2 CC2 13 ~ CC2 l4 CC2 l5 nullify instruction l6 CC2 l7 CC2 l8 CC2 l9 CC2 20 nullify instruction

l store 0 as new state value 2 store 0 as new state value 3 store 0 as new state value TABLE 2 6O 4 store 0 as new state value Subchannel Add/Modify CRW Code Values Note. AMCLH; mus‘ mach SDXLPID CRW State Description 0 no creation or alteration CRW pending l alteration CRW pending immediately TABLE 5 2 alteration CRW pending at end of session 65 Subchannel Add/Modify CRW Code Update When Con?gured 3 creation CRW pending immediately Path Mask Chan es from Zero to Non-Zero 4 creation CRW pending at end of session CRw 5mg Action 0 ComparedzSwap from 0 to 3