Lee Stewart wrote:
Is there a way to tell from a CP command if a guest is running in 31
bit or 64 bit mode?
Thanks
Lee
Not directly, but you could issue the DISPLAY PSW command on behalf of
the target user (using the FOR command in z/VM 5.3, or via SCIF for
earlier releases) and interpret the result, which will be like one of
the following:
Guest in 31-bit mode:
for operator cmd d p
OPERATOR : PSW = 030E0000 8105B570
OPERATOR : HCPFOR069I Command Complete. CP return code = 0000.
Guest in 64-bit mode, PSWTRANS OFF:
for raylx2 cmd d
p
RAYLX2 : HCPCDP6150E The option PSW has been specified but is not
valid in z/Architecture mode. To enable the use of this option issue
the appropriate SET PSWTRANS command or use the PSWG option.
RAYLX2 : HCPFOR069I Command Complete. CP return code = 6150.
Guest in 64-bit mode, PSWTRANS ALL|DISPLAY|STORE:
for raylx2 cmd d
p
RAYLX2 : PSW = NON TRANSLATABLE PSWG = 07060001 80000000 00000000
00107E2E
RAYLX2 : HCPFOR069I Command Complete. CP return code = 0000.
And yes, it would be very easy (code-wise) to provide a QUERY command
option to give this information, or you might try the following piece of
REXX from a suitably-privileged userid (this, of course, is subject to
VMDMMODE remaining at the same offset in the VMDBK - which it has for at
least the last four releases):
-----------------------------------------------
/* QMODE: determine whether a guest is in 64-bit mode
*/
Parse UPPER Arg uid
If (uid='*') Then uid = userid()
Numeric Digits 20
'PIPE CP LOCATE' uid '| spec w3 1 | var vmdbk'
If (rc<>0) Then Do
Say 'Error' rc 'from "CP LOCATE' uid'"'
Exit rc
End
vmdmmode = d2x(x2d(vmdbk)+x2d(4c4))
'PIPE CP DISPLAY HS' || vmdmmode || '.1 | spec w2 1 | var mode'
If (rc<>0) Then Do
Say 'Error' rc 'from "CP DISPLAY HS' || vmdmmode || '.1"'
Exit rc
End
If bitand(x2c(mode),'40'x)='40'x
Then Say uid 'is in 64-bit mode'
Else Say uid 'is not in 64-bit mode'
-----------------------------------------------
Or one could write a CP QUERY command extension - isn't that possible?
I'll take a look and maybe post something later.
Ray