Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_ASM_S390_SIE_H
0003 #define _UAPI_ASM_S390_SIE_H
0004 
0005 #define diagnose_codes                      \
0006     { 0x10, "DIAG (0x10) release pages" },          \
0007     { 0x44, "DIAG (0x44) time slice end" },         \
0008     { 0x9c, "DIAG (0x9c) time slice end directed" },    \
0009     { 0x204, "DIAG (0x204) logical-cpu utilization" },  \
0010     { 0x258, "DIAG (0x258) page-reference services" },  \
0011     { 0x288, "DIAG (0x288) watchdog functions" },       \
0012     { 0x308, "DIAG (0x308) ipl functions" },        \
0013     { 0x500, "DIAG (0x500) KVM virtio functions" },     \
0014     { 0x501, "DIAG (0x501) KVM breakpoint" }
0015 
0016 #define sigp_order_codes                    \
0017     { 0x01, "SIGP sense" },                 \
0018     { 0x02, "SIGP external call" },             \
0019     { 0x03, "SIGP emergency signal" },          \
0020     { 0x04, "SIGP start" },                 \
0021     { 0x05, "SIGP stop" },                  \
0022     { 0x06, "SIGP restart" },               \
0023     { 0x09, "SIGP stop and store status" },         \
0024     { 0x0b, "SIGP initial cpu reset" },         \
0025     { 0x0c, "SIGP cpu reset" },             \
0026     { 0x0d, "SIGP set prefix" },                \
0027     { 0x0e, "SIGP store status at address" },       \
0028     { 0x12, "SIGP set architecture" },          \
0029     { 0x13, "SIGP conditional emergency signal" },      \
0030     { 0x15, "SIGP sense running" },             \
0031     { 0x16, "SIGP set multithreading"},         \
0032     { 0x17, "SIGP store additional status at address"}
0033 
0034 #define icpt_prog_codes                     \
0035     { 0x0001, "Prog Operation" },               \
0036     { 0x0002, "Prog Privileged Operation" },        \
0037     { 0x0003, "Prog Execute" },             \
0038     { 0x0004, "Prog Protection" },              \
0039     { 0x0005, "Prog Addressing" },              \
0040     { 0x0006, "Prog Specification" },           \
0041     { 0x0007, "Prog Data" },                \
0042     { 0x0008, "Prog Fixedpoint overflow" },         \
0043     { 0x0009, "Prog Fixedpoint divide" },           \
0044     { 0x000A, "Prog Decimal overflow" },            \
0045     { 0x000B, "Prog Decimal divide" },          \
0046     { 0x000C, "Prog HFP exponent overflow" },       \
0047     { 0x000D, "Prog HFP exponent underflow" },      \
0048     { 0x000E, "Prog HFP significance" },            \
0049     { 0x000F, "Prog HFP divide" },              \
0050     { 0x0010, "Prog Segment translation" },         \
0051     { 0x0011, "Prog Page translation" },            \
0052     { 0x0012, "Prog Translation specification" },       \
0053     { 0x0013, "Prog Special operation" },           \
0054     { 0x0015, "Prog Operand" },             \
0055     { 0x0016, "Prog Trace table" },             \
0056     { 0x0017, "Prog ASNtranslation specification" },    \
0057     { 0x001C, "Prog Spaceswitch event" },           \
0058     { 0x001D, "Prog HFP square root" },         \
0059     { 0x001F, "Prog PCtranslation specification" },     \
0060     { 0x0020, "Prog AFX translation" },         \
0061     { 0x0021, "Prog ASX translation" },         \
0062     { 0x0022, "Prog LX translation" },          \
0063     { 0x0023, "Prog EX translation" },          \
0064     { 0x0024, "Prog Primary authority" },           \
0065     { 0x0025, "Prog Secondary authority" },         \
0066     { 0x0026, "Prog LFXtranslation exception" },        \
0067     { 0x0027, "Prog LSXtranslation exception" },        \
0068     { 0x0028, "Prog ALET specification" },          \
0069     { 0x0029, "Prog ALEN translation" },            \
0070     { 0x002A, "Prog ALE sequence" },            \
0071     { 0x002B, "Prog ASTE validity" },           \
0072     { 0x002C, "Prog ASTE sequence" },           \
0073     { 0x002D, "Prog Extended authority" },          \
0074     { 0x002E, "Prog LSTE sequence" },           \
0075     { 0x002F, "Prog ASTE instance" },           \
0076     { 0x0030, "Prog Stack full" },              \
0077     { 0x0031, "Prog Stack empty" },             \
0078     { 0x0032, "Prog Stack specification" },         \
0079     { 0x0033, "Prog Stack type" },              \
0080     { 0x0034, "Prog Stack operation" },         \
0081     { 0x0039, "Prog Region first translation" },        \
0082     { 0x003A, "Prog Region second translation" },       \
0083     { 0x003B, "Prog Region third translation" },        \
0084     { 0x0040, "Prog Monitor event" },           \
0085     { 0x0080, "Prog PER event" },               \
0086     { 0x0119, "Prog Crypto operation" }
0087 
0088 #define exit_code_ipa0(ipa0, opcode, mnemonic)      \
0089     { (ipa0 << 8 | opcode), #ipa0 " " mnemonic }
0090 #define exit_code(opcode, mnemonic)         \
0091     { opcode, mnemonic }
0092 
0093 #define icpt_insn_codes             \
0094     exit_code_ipa0(0x01, 0x01, "PR"),   \
0095     exit_code_ipa0(0x01, 0x04, "PTFF"), \
0096     exit_code_ipa0(0x01, 0x07, "SCKPF"),    \
0097     exit_code_ipa0(0xAA, 0x00, "RINEXT"),   \
0098     exit_code_ipa0(0xAA, 0x01, "RION"), \
0099     exit_code_ipa0(0xAA, 0x02, "TRIC"), \
0100     exit_code_ipa0(0xAA, 0x03, "RIOFF"),    \
0101     exit_code_ipa0(0xAA, 0x04, "RIEMIT"),   \
0102     exit_code_ipa0(0xB2, 0x02, "STIDP"),    \
0103     exit_code_ipa0(0xB2, 0x04, "SCK"),  \
0104     exit_code_ipa0(0xB2, 0x05, "STCK"), \
0105     exit_code_ipa0(0xB2, 0x06, "SCKC"), \
0106     exit_code_ipa0(0xB2, 0x07, "STCKC"),    \
0107     exit_code_ipa0(0xB2, 0x08, "SPT"),  \
0108     exit_code_ipa0(0xB2, 0x09, "STPT"), \
0109     exit_code_ipa0(0xB2, 0x0d, "PTLB"), \
0110     exit_code_ipa0(0xB2, 0x10, "SPX"),  \
0111     exit_code_ipa0(0xB2, 0x11, "STPX"), \
0112     exit_code_ipa0(0xB2, 0x12, "STAP"), \
0113     exit_code_ipa0(0xB2, 0x14, "SIE"),  \
0114     exit_code_ipa0(0xB2, 0x16, "SETR"), \
0115     exit_code_ipa0(0xB2, 0x17, "STETR"),    \
0116     exit_code_ipa0(0xB2, 0x18, "PC"),   \
0117     exit_code_ipa0(0xB2, 0x20, "SERVC"),    \
0118     exit_code_ipa0(0xB2, 0x21, "IPTE"), \
0119     exit_code_ipa0(0xB2, 0x28, "PT"),   \
0120     exit_code_ipa0(0xB2, 0x29, "ISKE"), \
0121     exit_code_ipa0(0xB2, 0x2a, "RRBE"), \
0122     exit_code_ipa0(0xB2, 0x2b, "SSKE"), \
0123     exit_code_ipa0(0xB2, 0x2c, "TB"),   \
0124     exit_code_ipa0(0xB2, 0x2e, "PGIN"), \
0125     exit_code_ipa0(0xB2, 0x2f, "PGOUT"),    \
0126     exit_code_ipa0(0xB2, 0x30, "CSCH"), \
0127     exit_code_ipa0(0xB2, 0x31, "HSCH"), \
0128     exit_code_ipa0(0xB2, 0x32, "MSCH"), \
0129     exit_code_ipa0(0xB2, 0x33, "SSCH"), \
0130     exit_code_ipa0(0xB2, 0x34, "STSCH"),    \
0131     exit_code_ipa0(0xB2, 0x35, "TSCH"), \
0132     exit_code_ipa0(0xB2, 0x36, "TPI"),  \
0133     exit_code_ipa0(0xB2, 0x37, "SAL"),  \
0134     exit_code_ipa0(0xB2, 0x38, "RSCH"), \
0135     exit_code_ipa0(0xB2, 0x39, "STCRW"),    \
0136     exit_code_ipa0(0xB2, 0x3a, "STCPS"),    \
0137     exit_code_ipa0(0xB2, 0x3b, "RCHP"), \
0138     exit_code_ipa0(0xB2, 0x3c, "SCHM"), \
0139     exit_code_ipa0(0xB2, 0x40, "BAKR"), \
0140     exit_code_ipa0(0xB2, 0x48, "PALB"), \
0141     exit_code_ipa0(0xB2, 0x4c, "TAR"),  \
0142     exit_code_ipa0(0xB2, 0x50, "CSP"),  \
0143     exit_code_ipa0(0xB2, 0x54, "MVPG"), \
0144     exit_code_ipa0(0xB2, 0x56, "STHYI"),    \
0145     exit_code_ipa0(0xB2, 0x58, "BSG"),  \
0146     exit_code_ipa0(0xB2, 0x5a, "BSA"),  \
0147     exit_code_ipa0(0xB2, 0x5f, "CHSC"), \
0148     exit_code_ipa0(0xB2, 0x74, "SIGA"), \
0149     exit_code_ipa0(0xB2, 0x76, "XSCH"), \
0150     exit_code_ipa0(0xB2, 0x78, "STCKE"),    \
0151     exit_code_ipa0(0xB2, 0x7c, "STCKF"),    \
0152     exit_code_ipa0(0xB2, 0x7d, "STSI"), \
0153     exit_code_ipa0(0xB2, 0xb0, "STFLE"),    \
0154     exit_code_ipa0(0xB2, 0xb1, "STFL"), \
0155     exit_code_ipa0(0xB2, 0xb2, "LPSWE"),    \
0156     exit_code_ipa0(0xB2, 0xf8, "TEND"), \
0157     exit_code_ipa0(0xB2, 0xfc, "TABORT"),   \
0158     exit_code_ipa0(0xB9, 0x1e, "KMAC"), \
0159     exit_code_ipa0(0xB9, 0x28, "PCKMO"),    \
0160     exit_code_ipa0(0xB9, 0x2a, "KMF"),  \
0161     exit_code_ipa0(0xB9, 0x2b, "KMO"),  \
0162     exit_code_ipa0(0xB9, 0x2d, "KMCTR"),    \
0163     exit_code_ipa0(0xB9, 0x2e, "KM"),   \
0164     exit_code_ipa0(0xB9, 0x2f, "KMC"),  \
0165     exit_code_ipa0(0xB9, 0x3e, "KIMD"), \
0166     exit_code_ipa0(0xB9, 0x3f, "KLMD"), \
0167     exit_code_ipa0(0xB9, 0x8a, "CSPG"), \
0168     exit_code_ipa0(0xB9, 0x8d, "EPSW"), \
0169     exit_code_ipa0(0xB9, 0x8e, "IDTE"), \
0170     exit_code_ipa0(0xB9, 0x8f, "CRDTE"),    \
0171     exit_code_ipa0(0xB9, 0x9c, "EQBS"), \
0172     exit_code_ipa0(0xB9, 0xa2, "PTF"),  \
0173     exit_code_ipa0(0xB9, 0xab, "ESSA"), \
0174     exit_code_ipa0(0xB9, 0xae, "RRBM"), \
0175     exit_code_ipa0(0xB9, 0xaf, "PFMF"), \
0176     exit_code_ipa0(0xE3, 0x03, "LRAG"), \
0177     exit_code_ipa0(0xE3, 0x13, "LRAY"), \
0178     exit_code_ipa0(0xE3, 0x25, "NTSTG"),    \
0179     exit_code_ipa0(0xE5, 0x00, "LASP"), \
0180     exit_code_ipa0(0xE5, 0x01, "TPROT"),    \
0181     exit_code_ipa0(0xE5, 0x60, "TBEGIN"),   \
0182     exit_code_ipa0(0xE5, 0x61, "TBEGINC"),  \
0183     exit_code_ipa0(0xEB, 0x25, "STCTG"),    \
0184     exit_code_ipa0(0xEB, 0x2f, "LCTLG"),    \
0185     exit_code_ipa0(0xEB, 0x60, "LRIC"), \
0186     exit_code_ipa0(0xEB, 0x61, "STRIC"),    \
0187     exit_code_ipa0(0xEB, 0x62, "MRIC"), \
0188     exit_code_ipa0(0xEB, 0x8a, "SQBS"), \
0189     exit_code_ipa0(0xC8, 0x01, "ECTG"), \
0190     exit_code(0x0a, "SVC"),         \
0191     exit_code(0x80, "SSM"),         \
0192     exit_code(0x82, "LPSW"),        \
0193     exit_code(0x83, "DIAG"),        \
0194     exit_code(0xae, "SIGP"),        \
0195     exit_code(0xac, "STNSM"),       \
0196     exit_code(0xad, "STOSM"),       \
0197     exit_code(0xb1, "LRA"),         \
0198     exit_code(0xb6, "STCTL"),       \
0199     exit_code(0xb7, "LCTL"),        \
0200     exit_code(0xee, "PLO")
0201 
0202 #define sie_intercept_code                  \
0203     { 0x00, "Host interruption" },              \
0204     { 0x04, "Instruction" },                \
0205     { 0x08, "Program interruption" },           \
0206     { 0x0c, "Instruction and program interruption" },   \
0207     { 0x10, "External request" },               \
0208     { 0x14, "External interruption" },          \
0209     { 0x18, "I/O request" },                \
0210     { 0x1c, "Wait state" },                 \
0211     { 0x20, "Validity" },                   \
0212     { 0x28, "Stop request" },               \
0213     { 0x2c, "Operation exception" },            \
0214     { 0x38, "Partial-execution" },              \
0215     { 0x3c, "I/O interruption" },               \
0216     { 0x40, "I/O instruction" },                \
0217     { 0x48, "Timing subset" }
0218 
0219 /*
0220  * This is the simple interceptable instructions decoder.
0221  *
0222  * It will be used as userspace interface and it can be used in places
0223  * that does not allow to use general decoder functions,
0224  * such as trace events declarations.
0225  *
0226  * Some userspace tools may want to parse this code
0227  * and would be confused by switch(), if() and other statements,
0228  * but they can understand conditional operator.
0229  */
0230 #define INSN_DECODE_IPA0(ipa0, insn, rshift, mask)      \
0231     (insn >> 56) == (ipa0) ?                \
0232         ((ipa0 << 8) | ((insn >> rshift) & mask)) :
0233 
0234 #define INSN_DECODE(insn) (insn >> 56)
0235 
0236 /*
0237  * The macro icpt_insn_decoder() takes an intercepted instruction
0238  * and returns a key, which can be used to find a mnemonic name
0239  * of the instruction in the icpt_insn_codes table.
0240  */
0241 #define icpt_insn_decoder(insn) (       \
0242     INSN_DECODE_IPA0(0x01, insn, 48, 0xff)  \
0243     INSN_DECODE_IPA0(0xaa, insn, 48, 0x0f)  \
0244     INSN_DECODE_IPA0(0xb2, insn, 48, 0xff)  \
0245     INSN_DECODE_IPA0(0xb9, insn, 48, 0xff)  \
0246     INSN_DECODE_IPA0(0xe3, insn, 48, 0xff)  \
0247     INSN_DECODE_IPA0(0xe5, insn, 48, 0xff)  \
0248     INSN_DECODE_IPA0(0xeb, insn, 16, 0xff)  \
0249     INSN_DECODE_IPA0(0xc8, insn, 48, 0x0f)  \
0250     INSN_DECODE(insn))
0251 
0252 #endif /* _UAPI_ASM_S390_SIE_H */