Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

IPK, SPKA and MODESET

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Mon Mar 10, 2014 9:24 pm    Post subject: IPK, SPKA and MODESET
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Mar 10, 2014 9:39 pm    Post subject: Reply to: IPK, SPKA and MODESET
Reply with quote

IIRC just linking with AC(1) does not put You in KEY 0!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Mar 10, 2014 9:52 pm    Post subject: Reply to: IPK, SPKA and MODESET
Reply with quote

And adding to Enrico's reply, don't EVER use MODESET 0 in CICS or any other SVC for that matter.... icon_eek.gif

HTH....
Back to top
View user's profile Send private message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Tue Mar 11, 2014 3:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Tue Mar 11, 2014 4:04 am    Post subject:
Reply with quote

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
View user's profile Send private message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Tue Mar 11, 2014 4:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:



Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us