Key ill Storage
For purposes of protection and recording of refer­
ences and changes, main storage is divided into
blocks of 2,048 bytes, each block having an address
that is a multiple of 2,048. A control field, called "key in storage," is associated with each block of
storage.
The key in storage has the following format: o 4 6
The bit positions in the key are allocated as fol­
lows: Access-Control Bits (ACC): Bits 0-3 are matched
against the four-bit protection key whenever infor­
mation is stored, or whenever information is fetched
from a location that is protected against fetching.
Fetch-P,rotection Bit (F): Bit 4 controls whether
protection applies to fetch-type references: a zero
indicates that only store-type references are moni­
tored and that fetching with any protection key is a one indicates that protection applies to
both fetching and storing. No distinction is made
between the fetching of instructions and of oper­
ands. Reference Bit (R): Bit 5 normally is set to one each
time a location in the corresponding storage block is
referred to either for storing or for fetching of in­
formation. This bit is associated with dynamic ad­
dress translation.
Change Bit (C): Bit 6 is set to one each time in­
formation is stored into the corresponding storage
block. This bit is associated with dynamic address translatilon. The key in storage is not part of addressable stor­
age. program can explictly place information in
all seven bits of the key by SET STORAGE KEY,
and the contents of the key can be inspected by IN­
sERT STORAGE KEY. Additionally, the instruc­
tion RESET REFERENCE BIT provides a means of
inspecting the reference and change bits and of set­
ting the reference bit to zero.
Protection
The protection facility is provided to protect. the
contents of main storage from destruction or misuse
caused by erroneous or unauthorized storing or
fetching by the program. It provides protection
38 System/370 Principles of Operation
against improper storing or against both improper
storing and fetching, but not against improper fetch-
ing alone.
Protection Action
When protection applies to a storage access, the key
in storage is compared with the protection key asso­
ciated with the request for storage access. A store is
permitted only when the key in storage matches the
protection key. The keys are said to match when the
four high-order bits of the key in storage are equal
to t.he protection key or when the protection key is
zero. A fetch is permitted when the keys match or
when bit 4 of the key in storage is zero. The protec­
tion action is summarized in the table "Summary of
Protection Action. " Conditions
Bit 4 of Key Key
in Storage Relation 0 Match 0 Mismatch
Match
Mismatch Explanation: I s Access to Storage
Permitted?
Fetch Store
Yes Yes
Yes No
Yes Yes
No No
Match The four high-order bits of the key in storage are equal to the protection key, or the protection key
is zero.
Yes Access is permitted.
No Access is not permitted; on fetching, the information
is not made available to the program, and, on storing,
the contents of the storage location are not changed.
Summary of Protection Action
When the access to storage is initiated by the CPU, and protection applies, the protection key of
the current PSW is used as the comparand. The pro­
tection key of the CPU occupies bit positions 8-11
of the PSW. When the reference is made by a chan­
nel, and protection applies, the protection key asso­
ciated with the I/O operation is used as the compa­
rand. The protection key for an I/O operation is
specified in bit positions 0-3 of the channel address
word ( CAW) and is recorded in bit positions 0-3 of
the channel status word (CSW) stored as a result of
an I/O operation.
When a CPU access is prohibited because of pro­
tection, the operation is suppressed or terminated,
and a program interruption for a protection excep­
tion takes place. When a channel access is prohibit­
ed, a protection-check condition is indicated in the
channel status word (CSW) stored as a result of the
operation.
When a store access is prohibited because of pro­
tection, the contents of the protected location re­
main unchanged. On fetching, the protected informa­
tion is not loaded into an addressable register,
moved to another storage location, or provided to an I/O device.
The protection system is always active, regardless
of whether the CPU is in the problem or supervisor
state and regardless of the type of CPU instruction
or channel command word being executed.
Accesses Protected
All main-storage accesses to locations that are ex­ plicitly designated by the program and that are used
by the CPU or channel to store or fetch information
are subject to protection.
Protection is not appHed to accesses that are im­
plicitly made by the CPU or channel for such se­
quences as interruptions, updating the interval timer,
logout, dynamic address translation, fetching the
CAW during execution of an I/O instruction, storing
the CSW by an I/O instruction or interruption, stor­ ing channel identification during execution of STORE CHANNEL ID, and the initial-pro gram­
loading and store-status functions. Similarly, protec­
tion does not apply to accesses initiated via the sys­
tem console for entering or displaying information.
However, when the program explicitly designates
these locations, they are subject to protection.
Monitoring
The monitoring facility provides the capability for
passing control to a monitoring program when se­
lected indicators are reached in the monitored pro­
gram. The indicators are MONITOR CALL instruc­
tions implanted in the monitored program. When
executed, these instructions cause a program inter­
ruption for monitoring to take place, provided an
interruption is allowed for the monitor class speci­
fied by the instruction. Along with the interruption,
the monitor class number and a monitor code are
stored for subsequent use by the monitoring pro­
gram.
The monitoring facility includes the instruction MONITOR CALL, which designates one of 16
monitoring classes, together with a set of 16 monitor
masks in a control register. One mask bit is associat­
ed with each class. The execution of the instruction
causes a program interruption when the monitor­
mask bit for the class specified in the instruction is
one. I The monitoring facmty is available in both the BC
and EC modes.
The monitor-mask bits are in bit positions 16-31
of control register 8.
Control Register 8:
Monitor Masks
o 16
The mask bits, 16-31, correspond to monitor
classes 0-15, respectively. Any number of monitor­
mask bits may be on at anyone time; together they
specify the classes of monitor events that are moni­
tored at that time. The mask bits are initialized to
zero.
31
When a MONITOR CALL instruction is inter­
preted for execetion and the corresponding monitor­
mask bit is one, a program interruption for monitor­
ing occurs. The cause of the interruption is identified
by setting bit 9 of the interruption code to one, and
by the information placed at locations 148-149 and
156-159 of main storage. The format of the informa­
tion placed at locations 148-149 and 156-159 is the
same in BC and EC modes and is as follows:
Locations 148-149:
Monitor 00000000 Class No.
o 8
Locations 156-159: I L_o_o_o_o __ _________ M __ on_i_to_r_C_o_de __________ o 8 31
The contents of bit positions 8-15 of MONITOR CALL are placed at location 149 and constitute the
monitor class number. The address specified by the
Bl and Dl fields of the instruction forms the monitor
code, which is placed at locations 157-159. Zeros
are placed at locations 148 and 156.
Program..;Event Recording
The purpose of the program-event-recording (PER) facility is to assist in debugging programs. It permits
the program to be alerted to the following events: Successful execution of a branch instruction. Alteration of the contents of designated general
registers. Fetching of an instruction from designated
main-storage locations. Alteration of the contents of designated main­
storage locations.
The program has control over the conditions that
are considered eventf- recording purposes and
can specify selectively one or more events to be
monitored. The information concerning a program
System Control 39
Previous Page Next Page