SET STORAGE KEY The SET STORAGE KEY instruction is executed
for a virtual machine if the virtual-machine assist is
activated for this instruction, unless (1) a virtual­
machine exception is recognized, (2) the real page
size is 2K bytes, or (3) some pertinent VM/370 control field cannot be accessed.
The set-storage-key function of the virtual­
machine assist is invoked each time a CPU attempts
to execute a SET STORAGE KEY instruction
when the problem-state bit of the real PSW is one.
Execution of this function consists in performing
the following steps:
1. Execution of this function ends with a program
interruption for a privileged-operation
exception if bits 0-2 of control register 6 are
not 100 binary or if bits 28-31 of the general
register specified by the R2 field of the
instruction are not zeros (1).
2. The word MICRSEG, which contains the real
segment-table address, is fetched with a key of
zero. Execution ends if an addressing
condition is encountered (2).
3. Execution ends with a program interruption for
a privileged-operation exception if bit 30 of
MICRSEG is one (3).
4. The address in the general register specified by
the R2 field is partitioned to obtain the segment
index and the page index. The partitioning of
the address is based on 4K-byte pages and
either 64K-byte or 1M-byte segments,
depending on whether bit 31 of MICRSEG is
zero or one, respectively. For a 64K-byte
segment, execution ends with a program
interruption for a privileged-operation
exception if the segment-table-length value in
bit positions 0-7 of MICRSEG is less than the
value obtained by appending four zeros to the
left of bits 8-11 of the address specified (4).
5. The address of the real-segment-table entry,
SEGPAGE, is computed, and the entry is
fetched with a key of zero. Execution ends if
an addressing condition is encountered (5).
6. Execution ends with a program interruption for
a privileged-operation exception if the
segment-table entry is invalid, if the entry has
an invalid format, or if the value of the
leftmost four bits of the page index exceeds the
value of bits 0-3 of the segment-table entry
(6).
7. The location of the swap-table address is
computed by subtracting 4 from the page-table
origin derived from the segment-table entry.
18 Virtual-Machine Assist and Shadow-Table-Bypass Assist
The word at this location, PAGSWP, is fetched
with a key of zero. Execution ends if an
addressing condition is encountered (7 .A. 1). 8. Eight times the page index is added to bits 8-31
of the swap-table-address word to obtain the
address of the swap-table word. The swap­
table word at the address computed is fetched
with a key of zero. Execution ends if an
addressing condition is encountered. SWPFLG, SWPKEY 1, and SWPKEY2 are in bytes 0, 2,
and 3 of the word fetched (7.A.2).
9. Twice the page index is added to the page-table
origin from the segment-table entry to obtain
the address of the page-table entry. The page­
table entry, PAGCORE, is fetched with a key
of zero. Execution ends if an addressing
condition is encountered (7 .B.1). 10. Execution ends with a program interruption for
a privileged-operation exception if the page­
table entry is valid and has an invalid format
(7.B.2).
11. If the page-table entry is valid, the reference
and change bits are fetched from the real
storage key, and a new value is placed in the
real storage key. Execution ends if an
addressing condition is encountered. Bits 0-4 of the new value are obtained from bit
positions 24-28 of the general register specified
by R2 field of the instruction. Bits 5 -6 (the
reference-bit and change-bit positions) of the
new value are zeros. If the page-table entry is
invalid, execution continues as if real
reference-bit and change-bit values of zero had
been fetched (7.B.3).
12. The swap-table word previously fetched is
updated in storage, with a key of zero, by
computing new values of 10 bits. The backup
reference-bit and change-bit values are updated
by logically ORing those values and the values
of the real reference-bit and real change-bit
values, respectively. In addition, bits 0-6 of the
swap-table byte containing the virtual storage
key are replaced by bits 24-30 of the general
register specified by the R2 field of the
instruction. Bit 7 of that byte is set to an
unpredictable value. The swap-table word
contains two sets of backup bits and virtual
storage-key bytes. The value in bit position 20 of the general register (the second operand)
specified by the R2 field of the instruction
determines which set is used in this step.
Figure 13 shows the bit positions of the bits
and byte used (8).
Execution of this function ends with completion
of the SET STORAGE KEY instruction.
Figure 14 summarizes the fields used. SET SYSTEM-MASK The SET SYSTE:rv1 :rvIASK instruction is executed
for a virtual machine if the virtual-machine assist is
activated, unless (1) a virtual-machine interrll:Ption may follow, (2) the second operand or some
pertinent VM/370 control field cannot be accessed,
or (3) the PER mask or the DAT bit of the virtual PSW would be changed.
The set-system-mask function of the virtual­
machine assist is invoked each time a CPU attempts
to execute a SET SYSTEM MASK instruction when
the problem-state bit of the real PSW is one.
Execution of this function consists in performing
the following steps:
1. If bits 0-1 of control register 6 are not 10 binary, execution of the set-system-mask
function ends, a program interruption takes
place for a privileged-operation exception, and
execution of the SET SYSTEM MASK instruction is suppressed (I.A.I).
2. The word MICCREG, which contains the
address of the ECBLOK, is fetched with a key
of zero. Execution ends if an addressing
condition is encountered (l.A.2).
Bits Used in
3. The virtual control-register-O value, EXTCRO, which is in the first word of the ECBLOK, is
fetched with a key of zero. Execution ends if
an addressing condition is encountered (1.A.3).
4. ff--bit position -l-cl'--viTtual control register--9-­ contains a one, execution ends with a program
interruption for a privileged-operation
exception (l.A.4).
5. If an access condition is encountered in
fetching the second halfword of the SET SYSTEM MASK instruction, execution of this
function ends, and a program interruption takes
place for the access exception encountered
(l.B).
6. One byte is fetched with the logical address of
the second operand and the PSW key. If an
access condition is encountered, execution of
this function ends with a program interruption
for the access exception found (2.A).
7. The word MICVPSW, which contains the
address of the virtual PSW; is fetched with a
key of zero. Execution ends if an addressing
condition is encountered (2.B.1).
8. The first halfword of VMPSW, which contains
the virtual PSW, is fetched with a key of zero.
Execution ends if an addressing condition is
encountered (2.B.2). Swap Table When
Bit 20 of Second Operand Is: Function Zero One Backup reference-bit position 4 6
Backup change-bit position 5 7 Vir-f"1I:::11 c;:f" r n hvte j'" __ . a::le "-, _, 16-23 24-31
Figure 13. Bits Used in Swap Table for SET STORAGE KEY Field Control Address Offset Name Block Type (Hex) MICRSEG MICBLOK Real 0 I I I SEGPAGE SEGTABLE Real 4SX PAGSWP PAGTABLE Real -4 PAGCORE PAGTABLE Real 2PX SWPFLG ISWPTABLE/Real 0 SWPKEYl lSWPTABLEjReal 2 SWPKEY2 !SWPTABLE1Real Figure 14. Fields Used in SET STORAGE KEY No. of
Bytes
4
4
4
2 Contents Address of real I segment table
Segment-table entry
Address of swap table
Page-table entry IBacku P bits I
LOW
2K-byte virtual key
High 2K-byte virtual
key
Virtual-Machine Assist 19
Previous Page Next Page