Timers In a Virtual Machine
This section describes the results obtained in using timers in a virtual
machine created by CP. Interval Timer Virtual location 80 (X'50'), the interval timer, contains different
values than would be expected when operating in a real machine. On a
real machine, the interval timer is updated 300 times per second when
enabled and when the real machine is not in manual state. The interval
timer on a real machine thus reflects system time and wait state time. In a virtual machine, the interval timer reflects only virtual processor time, and not wait time. It is updated by CP whenever a virtual machine
passes control to CP, and this one updating reflects the entire time the
virtual machine had control. Note that during the time a virtual
machine has control, the virtual interval timer does not change; the
virtual processor time used is added to the virtual interval timer when CP regains control. For some privileged instructions, CP may be able to
simulate the instruction and still return control to the virtual machine
before the end of that virtual machine's tiae slice. In such cases, the
virtual interval timer is updated but only for those privileged
instructions that require normal or fast reflect entry into the
dispatcher. For those privileged instructions that do not require entry
into the dispatcheL, the virtual interval timer is not updated until CP gets control at the end of the time slice.
If the virtual machine assist feature or Extended Control - program
Support is ON, more time is charged to the virtual interval timer than
if the feature is OFF. When the virtual machine assist feature is OFF, the time spent by CP to simulate privileged instructions is Bot charged
to the virtual interval timer; Whereas, with the feature ON, the time
spent charged to the virtual interval timer.
The virtual interval timer assist feature is the updating of the virtual
interval timer and presentation of timer interrupts to the virtual
machine by the hardware. When the software simulates the interval
timer, updating occurs only when CP takes over This usually
results in an update frequency of once per time slice and repeatability
of timed intervals suffers greatly under these conditions. When the
virtual interval timer assist feature is active, the update frequency is
the same for both virtual and real interval timers, 300 times a second.
In order for the virtual interval timer assist feature to be active,
the following conditions must be met: VM/370 must be running on a Model 135-3, 138, 145-3, or 148. The virtual machine must have enabled the virtual machine assist and
the virtual interval timer (SET The virtual machine must have enabled both the virtual machine assist
and the virtual interval timer assist (SET ASSIST ON TMR). Part 2. Control Program (CP) 175
VM/370 provides an option, called the REALTIMER option, which causes
the virtual interval timer to be updated during virtual wait state as
well. With the REALTIMER option in effect, a virtual interval ti.er
reflects virtual processor time and virtual wait time, but not cp time used for services for that virtual machine, such as privileged
instruction execution. The more services a virtual machine requires
from CP, the greater the difference between the time represented by the
interval timer and the actual time used by and for the virtual machine.
The larger the number of active virtual machines contending for syste. resources, the greater the difference between virtual machine time and
actual elapsed (wall clock) time. Processor Timer
A virtual machine must have the ECMODE directory option to use the System/370 processor timer.
The processor timer is supported in a virtual machine in much the
same way as is the interval timer. That is, the processor timer in a
virtual machine records only virtual processor time, and it is updated
when the virtual machine passes control back to CP. If the real timer option is specified, the processor timer reflects
all actual elapsed time except CP time used for services, such as
privileged instruction execution, for that virtual machine.
The method of sampling the value in the processor timer causes it to
appear to a virtual machine to be updated more often than an interval
timer. The privileged instructions Set processor Timer (SPT) and Store processor Timer (STPT) are used to set a doubleword value in the
processor timer and to store it in a doubleword location of virtual
storage. When a virtual machine samples the value in the processor
timer by issuing a STPT instruction, CP regains control to execute the
rrivileged instruction, and updates the time. The act of sampling the
processor timer from a virtual machine causes it to be brought up to
date. TOO Clock The System/370 time-of-day (TaD) clock does not require simulation in a
virtual machine. The System/370 in which CP is operating may have one
real TaD clock for each processor, and all virtual machines can
interrogate the real TaD clock. The Store Clock (STCK) instruction is
nonprivileged; any virtual machine can execute it to store the current
value of the TOD clock in its virtual storage. The Set Clock (SCK) instruction, which is used to set the TOD Clock value, can be issued
from a virtual machine, but CP always returns a condition code of zero
and does not actually set the clock. Note that the TaD clock is the
only true source of actual elapsed time information for a virtual
machine. The base value for the TaD clock in VM/370 is 00:00:00 GMT, January 1,1900. In an attached processor environment, the TOO clocks are synchronized
using the procedure described in the GA22-7000. 176 System
Previous Page Next Page