Virtual Machine Time Management
The real processor simulates multiple virtual processors. Virtual machines that are
executing in a conversational manner are given access to the real processor more
frequently than those that are not; these conversational machines are assigned the
smaller of two possible time slices. CP determines execution characteristics of a
virtual machine at the end of each time slice on the basis of the recent frequency of
its console requests or terminal interrupts. The virtual machine is queued for sub­
sequent processor use according to whether it is a conversational or nonconversa­
tional user of system resources.
A virtual machine can gain control of the processor only if it is not waiting for
some activity or resource. The virtual machine itself may enter a virtual wait state
after an input/output operation has begun. The virtual machine cannot gain con­
trol of the real processor if it is waiting for a page of storage, if it is waiting for an
input/ output operation to be translated and started, or if it is waiting for a CP command to finish execution.
A virtual machit:le can be assigned a priority of execution. Priority is a parameter
affecting the execution of a particular virtual machine as compared with other vir­
tual machines that have the same general execution characteristics. Priority is a
parameter in the virtual machine's VM/SP directory entry. The system operator
can reset the value with the privilege class A SET PRIORITY command.
Virtual Machine Storage Management
The normal and maximum storage sizes of a virtual machine are defined as part of
the virtual machine configuration in the VM/SP directory. You may redefine vir­
tual storage size to any value that is a multiple of 4K and not greater than the max­
imum directory-defined value. VM/SP implements this storage as virtual storage.
The storage may appear as paged or unpaged to the virtual machine, depending
upon whether or not the extended control mode option was specified for that virtu­
al machine. This option is required if operating systems that control virtual storage,
such as OS/VS1, VM/370 or VM/SP are run in the virtual machine.
Storage in the virtual machine is logically divided into 4096-byte areas called pages.
A complete set of segment and page tables is used to describe the storage of each
virtual machine. These tables are updated by CP and reflect the allocation of vir­
tual storage pages to blocks of real storage. These page and segment tables allow
virtual storage addressing in a System/370 machine. Storage in the real machine is
logically and physically divided into 4096-byte areas called page frames. Only referenced virtual storage pages are kept in real storage, thus optimizing real
storage use. Further, a page can be brought into any available page frame; the
necessary relocation is done during program execution by a combination of VM/SP and dynamic address translation on the System/370. The active pages from all
logged on virtual machines and from the pageable routines of CP compete for
available page frames. When the number of page frames available for allocation
falls below a threshold value, CP determines which virtual storage pages currently
allocated to real storage are relatively inactive and initiates suitable page-out oper­
ations for them. CP keeps track of where each virtual machine's page zero resides. The normal way CP does this is to issue a TRANS macro, that checks for page residency (LRA)
and demands a page-in if the page is not in real storage. CP checks an in-storage VM/SP 3
Storage Protection
4 VM/SP System Programmer's Guide
pointer in the VMBLOK; the pointer contains the address of the virtual machine's
page zero if the page is resident. If the page is resident, CP bypasses issuing the TRANS macro, thus eliminating unnecessary LCTL and LRA instructions.
Inactive pages are kept on a direct access storage device. If an inactive page has
been changed at some time during virtual machine execution, CP assigns it to a
paging device, selecting the fastest such device with available space. If the page
has not changed, it remains allocated in its original direct access location and is
paged into real storage from there the next time the virtual machine references that
page. A virtual machine program can use the DIAGNOSE instruction to tell CP that the information from specific pages of virtual storage is no longer needed; CP then releases the areas of the paging devices which were assigned to hold the speci­
fied pages. Paging is done on demand by CPo This means that a page of virtual storage is not
read (paged) from the paging device to a real storage block until it is actually
needed for virtual machine execution. CP makes no attempt to anticipate what
pages might be required by a virtual machine. While a paging operation is per­
formed for one virtual machine, another virtual machine can be executing. Any
paging operation initiated by CP is transparent to the virtual machine.
If the virtual machine is executing in extended control mode with translate on, then
two additional sets of segment and page tables are kept. The virtual machine oper­
ating system is responsible for mapping the virtual storage created by it to the stor­
age of the virtual machine. CP uses this set of tables and the page and segment
tables created for the virtual machine at logon time to build shadow page tables for
the virtual machine. These shadow tables map the virtual storage created by the
virtual machine operating system to the storage of the real computing system. The
tables created by the virtual machine operating system may describe any page and
segment size permissible in the IBM System/370. Storage keys protect information in real storage from unauthorized use. A storage
key contains a four bit control field that is associated with an area of real storage.
When VM/SP is executing natively, each 2K area of storage is protected by one
storage key. VM/SP contains support that allows it to execute as a guest virtual machine on a
processor that uses single key real storage frames. Single key storage frames asso­
ciate one storage key for each 4K area of storage. VM/SP does not run natively
on processors that have single key storage frames; however, under control of the VM/SP High Performance Option program product, VM/SP executes as a guest
virtual machine operating system.
When VM/SP High Performance Option (Release 2 or subsequent release) is con­
trolling the processor equipped with single key storage frames, the program product
simulates for the guest, virtual storage that resembles the type of real storage
installed on the processor. If the storage simulated for the VM/SP guest requires
4K storage protection keys, VM/SP issues two key instructions to the referenced
storage frame. VM/SP provides both fetch and store protection for real storage. The contents of
real storage are protected from destruction or misuse caused by erroneous or un au-
Previous Page Next Page