Thus, after the CKON option has been invoked, each call to DMSFREE or DMSFRET takes many times as long to be completed as before. This can
impact the efficiency of system functions. CKOFF--Use of this option turns off the flag that was turned by the CKON option, described in the preceding paragraph. UREC--This option is called by DMSABN during the ABEND recovery
process to release all USER storage. CALOC--This option is called by DMSABN after the ABEND recovery
process has been completed. It invokes a routine that returns, in
register 0, the number of doublewords of free storage that have been
allocated. This figure is used by DMSABN to determine whether ABEND recovery has been successful. STORAGE PROTECTION KEYS In general, the following rule applies: storage is assigned the
storage key of X'F', while user storage assigned the key of X'E'. This is the storage key associated with the protected areas of storage,
not to be confused with the PSi or CAW key used to access that storage.
The specific key assignments are as follows: The NUCON area is assigned the key of X'F', with the exception of a
half-page containing the OPSECT and TSOBLOKS areas, which has a key
of X'E'. Free storage allocated by DMSFREE is broken up into user storage and
nucleus storage. The user storage has a protection key of X'E', while the nucleus storage has a key of X'P'. The transient program area has a key of X'E'. The CMS nucleus code has a storage key of X'F'. In saved systems,
this entire segment is protected by CP from modification even by the CMS system, and so must be entirely reentrant. The user program area is assigned the storage key of X'E', except for
those pages which contain Nucleus DMSFREE storage. These latter
pages are assigned the key of X'F'. The loader tables are assigned the key of X'F'. CMS SYSTEM HANDLING OF PSi KEYS The CMS nucleus protection scheme protects the CMS nucleus fro.
inadvertent destruction by a user program. This mechanism, however,
does not prevent a user from writing in system storage intentionally.
Because a CMS user can execute privileged instructions, he can issue a LOAD PSi (LPSW) instruction and load any PSi key he wishes. If a user
defeats nucleus protection in this way there is nothing to prevent his
program from: Modifying nucleus code CMS Method of Operation and Program Organization 2-107
Modifying a table or constant area Losing files by modifying a CMS file directory
In general, user programs and disk-resident CMS commands run with a PSi key of X'E', while nucleus code runs with PSi key of X'O'. There are, however, some exceptions to
disk-resident CMS commands run with a PSi key of
to modify nucleus pointers and storage. On the
routines called by the GET, PUT, READ and WRITE PSi key of X'E', to increase efficiency.
this rule. Certain X'O', because they need
other hand, the nucleus
macros run with a user
Two macros, DMSKEY and DMSEXS, are available for changing the PSi key. The DMSKEY macro changes the PSi key to the user value or the
nucleus value. DMSKEY NUCLEUS causes the current PSi key to be placed
in a stack, and a value of 0 to be placed in the PSi key. DMSKEY USER causes the current PSi key to be placed in a stack, and a value of X'E' to be placed in the PSi key. DMSKEY RESET causes the top value in the DMSKEY stack to be removed and re-inserted into the PSW. It is a CMS requirement when a routine terminates, that the DMSKEY stack must be empty. This means that a routine should execute a DMSKEY RESET macro instruction for each DMSKEY NUCLEUS macro instruction and
each DMSKEY USER macro instruction executed by the routine.
The DMSKEY key stack has a maximum depth of seven for each routine.
In this context, a "routine" is anything invoked by an SVC call. The DMSEXS ("execute in system mode") macro instruction is useful in
situations where a routine is running with a user PSW key, but wishes to
execute a single instruction with the nucleus PSi key. The single
instruction may be specified as the argument to the DMSEXS macro, and
that instruction is executed with a system PSi key. CP HANDLING FOR SAVED SYSTEMS The explanation of saved system nucleus protection depends on the VSK, RSK, VPK and RPK: 1. Virtual Storage Key (VSK) - This is the storage key assigned by the
virtual machine using the virtual SSK instruction.
2. Real Storage Key (RSK) - This is the actual storage key assigned
by CP to the 2K page.
3. Virtual PSi Key (VPK) - This is the PSi storage key assigned by the
virtual machine, by means of an instruction such as LPSW (Load PSi). 4. Real PSi Key
which is in
running. (RPK) - This is the PSW storage key assigned by CP, the real hardware PSi when the virtual machine is When there are no shared segments
storage protection works as it does on
pages, and RPK=VPK for the PSi. in the virtual machine, then
a real machine. RSK=VSK for all
However, when there is a shared segment (as in the case of segment 1
of CMS in the saved system), it is necessary for CP to protect the
shared segment. For non-CMS shared systems, it does this by,
essentially, ignoring the values of the VSKs and VPK, and assigning the 2-108 IBM VM/370 System Logic and Program Determination--Volume 2
Previous Page Next Page