Key ill Storage
For purposes of protection and recording of refer
ences and changes, main storage is divided into
blocks of2,048 bytes, each block having an address
that isa multiple of 2,048. A control field, called "key in storage," is associated with each block of
storage.
Thekey 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 addresstranslatilon. 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
sERTSTORAGE 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 StorageRelation 0 Match 0 Mismatch
Match
MismatchExplanation: 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 areequal 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 madeavailable to the program, and, on storing,
the contents of the storagelocation are not changed.
Summary of Protection Action
When the access to storage is initiated by theCPU, and protection applies, the protection key of
the currentPSW is used as the comparand. The pro
tection key of theCPU occupies bit positions 8-11
of thePSW. When the reference is made by a chan
nel, and protection applies, the protection key asso
ciated with theI/O operation is used as the compa
rand. The protection key for anI/O operation is
specified in bit positions0-3 of the channel address
word ( CAW) and is recorded in bit positions0-3 of
the channel status word (CSW) stored as a result of
anI/O operation.
When aCPU 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.
For purposes of protection and recording of refer
ences and changes, main storage is divided into
blocks of
that is
storage.
The
The bit positions in the key are allocated as fol
lows:
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
both fetching and storing. No distinction is made
between the fetching of instructions and of oper
ands.
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
age.
all seven bits of the key by SET STORAGE KEY,
and the contents of the key can be inspected by IN
sERT
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
Protection Action.
Bit 4 of Key Key
in Storage
Match
Mismatch
Permitted?
Fetch Store
Yes Yes
Yes No
Yes Yes
No No
Match The four high-order bits of the key in storage are
is zero.
Yes Access is permitted.
No Access is not permitted; on fetching, the information
is not made
the contents of the storage
Summary of Protection Action
When the access to storage is initiated by the
the current
tection key of the
of the
nel, and protection applies, the protection key asso
ciated with the
rand. The protection key for an
specified in bit positions
word ( CAW) and is recorded in bit positions
the channel status word (CSW) stored as a result of
an
When a
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.