A supervisor state program's updating of CR3 is surely not supported but is impossible to prevent. As with many things it will work in some cases. There could be points at which the system chooses to reset the PKM to what it should be. Even for this case it should be noted that keys 10-15 are really not appropriate for V=V programs; they are reserved for V=R programs.
The particular STCTL / OC / LCTL sequence (which should have used OI WORK+1,X'03' rather than OC anyway) changes bits 14 and 15 of the PKM (PSW Key Mask). The PKM is architecturally used to validate authorization to things like SPKA (i.e., what keys may a problem state program switch to) and PC's (in what keys may a problem state program issue the PC). It is also used within the code target routines to validate access. One of the effects of the update is thus that, after leaving supervisor state, the program could still issue SPKA to get to key 14 or 15. I must admit that ORG *-32 DC X'00000008' puzzles me since it appears to overlay the 2nd halfword of the LCTL instruction and the first two bytes of the first instruction of the MODESET that follows the LCTL (which, depending on the location counter, could be a NOPR instruction or a BAL instruction. Am I misreading? Peter Relson z/OS Core Technology Design
