diff --git a/build/configmgr.proj.env b/build/configmgr.proj.env index 8fe011e17..667834e79 100644 --- a/build/configmgr.proj.env +++ b/build/configmgr.proj.env @@ -1,5 +1,5 @@ PROJECT="configmgr" -VERSION=2.14.0 +VERSION=2.15.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/build/getesm.proj.env b/build/getesm.proj.env index 2dd36f19c..9119377fa 100644 --- a/build/getesm.proj.env +++ b/build/getesm.proj.env @@ -1,3 +1,3 @@ PROJECT="getesm" -VERSION=2.14.0 +VERSION=2.15.0 DEPS="" diff --git a/c/crossmemory.c b/c/crossmemory.c index 973dfc47a..f5f47c673 100644 --- a/c/crossmemory.c +++ b/c/crossmemory.c @@ -1626,10 +1626,12 @@ ZOWE_PRAGMA_PACK_RESET recoveryRC = recoveryEstablishRouter2(&(envAddr)->recoveryContext, \ (cmsGlobalAreaAddr)->pcssRecoveryPool, \ RCVR_ROUTER_FLAG_PC_CAPABLE | \ - RCVR_ROUTER_FLAG_RUN_ON_TERM); \ + RCVR_ROUTER_FLAG_RUN_ON_TERM | \ + RCVR_ROUTER_FLAG_SKIP_LSTACK_QUERY); \ } else { \ recoveryRC = recoveryEstablishRouter(RCVR_ROUTER_FLAG_PC_CAPABLE | \ - RCVR_ROUTER_FLAG_RUN_ON_TERM); \ + RCVR_ROUTER_FLAG_RUN_ON_TERM | \ + RCVR_ROUTER_FLAG_SKIP_LSTACK_QUERY); \ } \ if (recoveryRC != RC_RCV_OK) { \ returnCode = RC_CMS_ERROR; \ diff --git a/c/recovery.c b/c/recovery.c index 9b107b069..fd1ff5611 100644 --- a/c/recovery.c +++ b/c/recovery.c @@ -1053,6 +1053,12 @@ static StackedState getStackedState(StackedStateExtractionCode code) { return state; } +static uint8_t getPSWKey(void) { + int pswHighWord; + __asm(" EPSW 0,0 " : "=NR:r0"(pswHighWord)); + return (pswHighWord >> 20) & 0x0F; +} + typedef struct RecoveryStatePool_tag { #define RCVR_STATE_POOL_EYECATCHER "RCVSPOOL" @@ -1072,15 +1078,12 @@ static CPID makeRecoveryStatePool(unsigned int primaryCellCount, unsigned int secondaryCellCount, int storageSubpool) { - StackedState stackedState = getStackedState(STACKED_STATE_EXTRACTION_CODE_01); - uint8_t pswKey = (stackedState.state01.psw & 0x00F0000000000000LLU) >> 52; - unsigned alignedCellSize = cellpoolGetDWordAlignedSize(sizeof(RecoveryStateEntry)); CPID poolID = cellpoolBuild(primaryCellCount, secondaryCellCount, alignedCellSize, - storageSubpool, pswKey, + storageSubpool, getPSWKey(), &(CPHeader){"ZWESRECOVERYSTATEPOOL "}); return poolID; @@ -1173,8 +1176,7 @@ static int establishRouterInternal(RecoveryContext *userContext, } #endif /* RCVR_CPOOL_STATES */ - StackedState stackedState = getStackedState(STACKED_STATE_EXTRACTION_CODE_01); - context->routerPSWKey = (stackedState.state01.psw & 0x00F0000000000000LLU) >> 48; + context->routerPSWKey = getPSWKey() << 4; __asm( " ST 12,%0 \n" @@ -1729,9 +1731,13 @@ int recoveryPush(char *name, int flags, char *dumpTitle, return RC_RCV_CONTEXT_NOT_FOUND; } - int16_t linkageStackToken = getLinkageStackToken(); - if (linkageStackToken == -1) { - return RC_RCV_LNKSTACK_ERROR; + int16_t linkageStackToken = 0; + if (!(context->flags & RCVR_ROUTER_FLAG_SKIP_LSTACK_QUERY) || + (flags & RCVR_FLAG_QUERY_LSTACK)) { + linkageStackToken = getLinkageStackToken(); + if (linkageStackToken == -1) { + return RC_RCV_LNKSTACK_ERROR; + } } RecoveryStateEntry *newEntry = @@ -1745,13 +1751,11 @@ int recoveryPush(char *name, int flags, char *dumpTitle, newEntry->linkageStackToken = linkageStackToken; - /* Extract key from the newly created stacked state. IPK cannot be used - * as it requires the extract-authority set. + /* Extract the current key from the PSW. * This value will be used to restore the current's recovery state key if * it changes during the recovery process - this usually happens under an SRB * when SETRP retry with key 0. */ - StackedState stackedState = getStackedState(STACKED_STATE_EXTRACTION_CODE_01); - newEntry->key = (stackedState.state01.psw & 0x00F0000000000000LLU) >> 48; + newEntry->key = getPSWKey() << 4; __asm( diff --git a/h/recovery.h b/h/recovery.h index 576f45799..2a1949df6 100644 --- a/h/recovery.h +++ b/h/recovery.h @@ -243,6 +243,7 @@ typedef struct RecoveryStateEntry_tag { #define RCVR_FLAG_SDWA_TO_LOGREC 0x08000000 #define RCVR_FLAG_DISABLE 0x10000000 #define RCVR_FLAG_CPOOL_BASED 0x20000000 +#define RCVR_FLAG_QUERY_LSTACK 0x40000000 volatile char state; #define RECOVERY_STATE_DISABLED 0x00 #define RECOVERY_STATE_ENABLED 0x01 @@ -282,6 +283,7 @@ typedef struct RecoveryContext_tag { #define RCVR_ROUTER_FLAG_SRB 0x20000000 #define RCVR_ROUTER_FLAG_LOCKED 0x40000000 #define RCVR_ROUTER_FLAG_FRR 0x80000000 +#define RCVR_ROUTER_FLAG_SKIP_LSTACK_QUERY 0x00010000 int previousESPIEToken; unsigned char routerPSWKey; uint8_t structVersion; @@ -365,8 +367,19 @@ typedef struct RecoveryContext_tag { * RCVR_ROUTER_FLAG_NONE - no flags * RCVR_ROUTER_FLAG_NON_INTERRUPTIBLE - cancel or detach will not * interrupted recovery process -* RCVR_ROUTER_FLAG_PC_CAPABALE - should be set when the recovery +* RCVR_ROUTER_FLAG_PC_CAPABLE - should be set when the recovery * needs to used in PC calls +* RCVR_ROUTER_FLAG_RUN_ON_TERM - ESTAEX exit to be scheduled in case +* of termination events (see the +* description of the TERM parameter +* in the ESTAEX documentation) +* RCVR_ROUTER_FLAG_SKIP_LSTACK_QUERY - by default do not perform +* linkage-stack queries in +* recoveryPush calls for this router +* (use this flag for a better +* performance if there are no +* linkage-stack entries added +* between recoveryPush calls) * * Return value: * When a router has successfully been established, the function returns @@ -391,8 +404,19 @@ int recoveryEstablishRouter(int flags); * RCVR_ROUTER_FLAG_NONE - no flags * RCVR_ROUTER_FLAG_NON_INTERRUPTIBLE - cancel or detach will not * interrupted recovery process -* RCVR_ROUTER_FLAG_PC_CAPABALE - should be set when the recovery +* RCVR_ROUTER_FLAG_PC_CAPABLE - should be set when the recovery * needs to used in PC calls +* RCVR_ROUTER_FLAG_RUN_ON_TERM - ESTAEX exit to be scheduled in case +* of termination events (see the +* description of the TERM parameter +* in the ESTAEX documentation) +* RCVR_ROUTER_FLAG_SKIP_LSTACK_QUERY - by default do not perform +* linkage-stack queries in +* recoveryPush calls for this router +* (use this flag for a better +* performance if there are no +* linkage-stack entries added +* between recoveryPush calls) * * Return value: * When a router has successfully been established, the function returns @@ -470,6 +494,7 @@ bool recoveryIsRouterEstablished(); * RCVR_FLAG_DELETE_ON_RETRY - state is removed on retry * RCVR_FLAG_SDWA_TO_LOGREC - SDWA is written to LOGREC * RCVR_FLAG_DISABLE - state is disabled +* RCVR_FLAG_QUERY_LSTACK - perform a linkage-stack query * dumpTitle - SVC dump title * userAnalysisFunction - function called in the very beginning of * recovery diff --git a/manifest.template.yaml b/manifest.template.yaml index 8673b6930..47f5fe677 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -1,7 +1,7 @@ --- name: zowe-common-c -version: 2.14.0 +version: 2.15.0 homepage: https://zowe.org keywords: