View previous topic :: View next topic
|
Author |
Message |
Duncan Sharppe
New User
Joined: 13 Dec 2013 Posts: 20 Location: USA
|
|
|
|
Hi group,
I went through several versions of the Principle of Operations (z/OS, ESA and XA) trying to figure out the two above mentioned instructions and the MODESET macro. And I am still confused as to when to use either the instructions or the macro which generates an SVC.
Consider the following:
:
:
Authorized PGM
instruction stream
in Key 8
:
:
MODESET KEY=ZERO
:
:
GETMAIN
:
MODESET KEY=NZERO
Notice the two MODESET macro usage; when I believe that SPKA can be used because it is a authorized [AC(1)] program out of a authorized library.
So the question is when it is that MODESET is used/needed as a non-authorized program can not make use of it; and if oyu are authorized you can always make use of the IPK/SPKA combination to change the run and storage key.
Any information appreciated.
Duncan, the friar |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
IIRC just linking with AC(1) does not put You in KEY 0! |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
And adding to Enrico's reply, don't EVER use MODESET 0 in CICS or any other SVC for that matter....
HTH.... |
|
Back to top |
|
|
Duncan Sharppe
New User
Joined: 13 Dec 2013 Posts: 20 Location: USA
|
|
|
|
Hehehe... Yes of course for the CICS answer part...
Yes, my understanding is like yours vis AC(1) does NOT put you in KEY ZERO by default. So my question would still be can I use SPKA to get into KEY ZERO when in an authorized program. If this holds true then why would I ever need MODESET?
(Keeping in mind that in order to use MODESET KEY=ZERO a program has to be authorized anyway.)
Also: Is my parenthetical statement/understanding above true?
And apologies for the formatting problem in my original post... The system appears to have removed the leading blanks.
Cordially,
firarDuncan |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
You have to be in supervisor state to use SPKA. Same for IPK, though I had to go to the POP to verify that. At one level, I confess I don't know why, though there's not a blessed thing a problem state program can do with the protect key. There is nothing in the code you show to get you into supervisor state.
Quote: |
So the question is when it is that MODESET is used/needed as a non-authorized program can not make use of it; and if oyu are authorized you can always make use of the IPK/SPKA combination to change the run and storage key. |
Mr. Sorrichetti is correct when he says AC(1) does not give you either key 0 or supervisor state. It does give you the variations of MODESET that issue an SVC, and that can give you key 0 and supervisor state.
There are two ways a problem state program can get the protect key anyway.- From TCBPKF I think that's the right symbol.
- From the old PSW in the current request block if your program has issued a macro that will store the PSW into the RB.
|
|
Back to top |
|
|
Duncan Sharppe
New User
Joined: 13 Dec 2013 Posts: 20 Location: USA
|
|
|
|
You guys are a resource and a half.
I don't have the code written yet but all I wanted to do was: From a program that was AC(1) linked and coming from a authorized library to get into ZERO protect key and get some storage from the CSA. (And this would be around 44 bytes.) and then return to KEY=8.
And that was it. The GETMAIN itself would be issued less then 6 times a day. So that doesn't really need branch entry and there isn't anything that needs the instruction stream to be running in SUPERVISOR state.
I was planning getting this storage from SP(241). Which I understand to be paged and fetchable CSA. Basically, I need this storage available to all address spaces.
Pointers welcome.
Duncan, the friar |
|
Back to top |
|
|
|