Discussion:
Storage key explanation
(too old to reply)
Micheal Butz
2012-06-18 02:11:51 UTC
Permalink
Hi



I do a MODEST MODE=SUP,KEY=NZERO





Later when I want to ACESS Key zero storage I do a SPKA 0



Later to put things back to where they were



I do L R9,PSATOLD

SPKA TCBPKF





This however causes all sorts of problems



I am just wondering since the storage key access is determined from bits
8-11 of the PSW





What is the purpose of having it in the TCB is it the PSW KEY that the TASK
is dispatched ?






----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Sam Siegel
2012-06-18 05:24:56 UTC
Permalink
Post by Micheal Butz
Hi
I do a MODEST MODE=SUP,KEY=NZERO
Later when I want to ACESS Key zero storage I do a SPKA 0
Later to put things back to where they were
I do L R9,PSATOLD
SPKA TCBPKF
This however causes all sorts of problems
Look again at the POPs for SPKA. The operand is not used as the address
from where the new storage protection key is fetched. Instead, bits 56-59
of the second operand form the new storage protection key.
Post by Micheal Butz
I am just wondering since the storage key access is determined from bits
8-11 of the PSW
What is the purpose of having it in the TCB is it the PSW KEY that the TASK
is dispatched ?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Micheal Butz
2012-06-18 12:25:16 UTC
Permalink
thanks

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@listserv.ua.edu] On
Behalf Of Sam Siegel
Sent: Monday, June 18, 2012 1:24 AM
To: IBM-***@listserv.ua.edu
Subject: Re: Storage key explanation

On Sun, Jun 17, 2012 at 7:10 PM, Micheal Butz
Post by Micheal Butz
Hi
I do a MODEST MODE=SUP,KEY=NZERO
Later when I want to ACESS Key zero storage I do a SPKA 0
Later to put things back to where they were
I do L R9,PSATOLD
SPKA TCBPKF
This however causes all sorts of problems
Look again at the POPs for SPKA. The operand is not used as the address
from where the new storage protection key is fetched. Instead, bits 56-59
of the second operand form the new storage protection key.
Post by Micheal Butz
I am just wondering since the storage key access is determined from bits
8-11 of the PSW
What is the purpose of having it in the TCB is it the PSW KEY that the TASK
is dispatched ?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Relson
2012-06-18 13:50:37 UTC
Permalink
Post by Micheal Butz
SPKA TCBPKF
You ought to read the principles of operation regarding the operand of the
SPKA instruction.
Setting the key to bits 24-27 of the address of TCBPKF is unlikely to
produce the desired result.

If you don't have access to the PoOp, then get access but in the meantime
use the macros, such as

MODESET EXTKEY=ZERO,SAVEKEY=(2),WORKREG=4
to set the key to 0, while saving the current key in register 2

MODESET KEYREG=(2)
to restore the key to what was saved in register 2

or, if you don't want to save the key but happen to know that the starting
key is the TCB key,
MODESET EXTKEY=TCB,WORKREG=4
which requires a using on the TCB to access the TCBPKF field.

Also, if you must switch to key 0 supervisor state, you could consider
MODESET MODE=SUP,KEY=ZERO
and to switch back
MODESET MODE=PROG,KEY=NZERO

Peter Relson
z/OS Core Technology Design

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...