real values as follows: RSK=O for each page of the shared segment, RSK=F for all other pages, and RPK=F, always, for the real PSi. The SSK instruction is ignored, except to save the key value in a table in case
the virtual machine later does an ISK to get it back.
For the CMS saved system, the RSKs and RPK are initialized as before, but resetting the virtual keys has the following effects:
If the virtual machine uses an SSK instruction to reset a VSK, CP does the following: If the new VSK is nonzero, CP resets the RSK to
the value of the VSK; if the new VSK is zero, CP resets RSK to F. If the virtual machine uses a LPSi (or other) instruction to reset
the VPK, CP does the following: If the new VPK is zero, CP resets the RPK to the value of the VPK; if the new VPK is zero, CP resets RPK to
F. If the VPK=O and
differently. In
program to store
storage key. But
unless the RPK of
the RPK=F, storage protection may be handled
a real machine, a PSi key of 0 would allow the
into any storage location, no what the
under CP, the program gets a protection violation,
the page happens to be F.
Because of this, there is extra code in the CP program check handling
routine. Whenever a protection violation occurs, CP checks to see if
the following conditions hold:
The virtual machine running is the saved CMS system, running
with a shared segment. The VPK = O. The virtual machine is operating as though its PSi key is O. The RSK of the page into which the store was attempted is
nonzero, and different from the RPK. If anyone of these three conditions fails to hold, then the
protection viclation is reflected back to the virtual machine.
If all three of these conditions hold, then the RPK (the real
protection key in the real PSW) is reset to the RSK of the page into
which the store was attempted. Q! In CMS, this works as
storage in protect key F (RSK = VSK =
key E (RSK = VSK = E).
follows: CMS keeps its system
F), and user storage in protect When the CMS supervisor is running, it runs in PSi key 0 (VPK = 0, RPK = F), so that CMS gets a protection violation the first time it
tries to store into user storage (VSK = RSK = E). At that point, CP changes the RPK to E, and lets the virtual machine re-execute the
instruction which caused the protection violation. There is not another
protection violation until the supervisor goes back to storing into
system-protected storage. Q! £MS: There are several coding restrictions which must
be imposed on CMS if it is to run as a saved system.
The first and most obvious one is that CftS may never modify segment
1, the shared segment, which runs with a RSK of C, although the VSK = F.
A less obvious,
never modify with
but just as important, restriction, is that eMS may a single machine instruction (except MVeL) a section CMS Method of Operation and Program Organization 2-109
of storage which crosses the boundary between two pages with different
storage keys. This restriction applies not only to SS instructions,
such as MVC and ZAP, but also to RS instructions, such as STft, and to RX instructions, such as ST and STD, which may have nonaligned addresses on
the Systea/370. An exception is the eVCL instruction which can be
restarted after crossing a page boundary because the registers are
updated when the paging exception occurs.
This restriction also applies to I/O instructions. If the key
specified in the CCW is zero, then the data area for input may not cross
the boundary between two pages with different storage keys. It can be seen that this system is most inefficient when
"storage-key thrashing" occurs --when the virtual machine with a VPK of
o jumps around, storing into pages with different VSK's. ERROR CODES FROft DeSFREE, DeSFRES, AND DftSFRET ! nonzero ccde, return f=o: or indicates that the request could not be satisfied. Register 15 contains
this return code, indicating which error has occurred. The codes below
apply to the DMSFRES, DMSFREE and DftSFRET macros.
Code ,-- 2
3 ErI2I DMSFREE -- Insufficient storage space is available to satisfy the
request fer free storage. In the case of a variable request,
even the minimum request could not be satisfied. DftSFREE or DMSFRET User storage pointers destroyed. DMSFREE or DMSFRET Nucleus storage pointers destroyed. 4 DMSFREE An invalid size was requested. This error exit is
taken if the requested size is not greater than zero. In the
case of variable requests, this error exit is taken if the minimum request is greater than the maximum request. However,
the error is not detected if DftSPREE is able to satisfy the maximum request.
5 DMSFRET An invalid size was passed to the DMSFRET macro. This
error exit is taken if the specified length is net positive.
6 DMSFRET -- The block of storage which is teing released was never
allocated by DMSFREE. Such an error is detected if one of the
following errors is found:
a. The block is not entirely inside either the free storage area
in low storage or the user program area between FREELOWE and FREEUPPR. b. The block crosses
allocated for user
type storage.
a page-boundary which separates a page
storage from a page allocated for nucleus
c. The block overlaps another block already on the free storage
chain.
7 DMSFRET -- The address given for the block being released is not
a doubleword boundary.
8 DMSFRES -- An illegal request code was passed to the DMSPRES routine. Because all request codes are generated by the macro, this error code should never appear.
2-110 IBM VM/370 System Logic and Program Determination--Volume 2
Previous Page Next Page