1 /* 2 * Disassemble s390 instructions. 3 * 4 * Copyright IBM Corp. 2007 5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 6 */ 7 8 #include <linux/sched.h> 9 #include <linux/kernel.h> 10 #include <linux/string.h> 11 #include <linux/errno.h> 12 #include <linux/ptrace.h> 13 #include <linux/timer.h> 14 #include <linux/mm.h> 15 #include <linux/smp.h> 16 #include <linux/init.h> 17 #include <linux/interrupt.h> 18 #include <linux/delay.h> 19 #include <linux/module.h> 20 #include <linux/kallsyms.h> 21 #include <linux/reboot.h> 22 #include <linux/kprobes.h> 23 #include <linux/kdebug.h> 24 25 #include <asm/uaccess.h> 26 #include <asm/dis.h> 27 #include <asm/io.h> 28 #include <linux/atomic.h> 29 #include <asm/mathemu.h> 30 #include <asm/cpcmd.h> 31 #include <asm/lowcore.h> 32 #include <asm/debug.h> 33 #include <asm/irq.h> 34 35 #ifndef CONFIG_64BIT 36 #define ONELONG "%08lx: " 37 #else /* CONFIG_64BIT */ 38 #define ONELONG "%016lx: " 39 #endif /* CONFIG_64BIT */ 40 41 enum { 42 UNUSED, /* Indicates the end of the operand list */ 43 R_8, /* GPR starting at position 8 */ 44 R_12, /* GPR starting at position 12 */ 45 R_16, /* GPR starting at position 16 */ 46 R_20, /* GPR starting at position 20 */ 47 R_24, /* GPR starting at position 24 */ 48 R_28, /* GPR starting at position 28 */ 49 R_32, /* GPR starting at position 32 */ 50 F_8, /* FPR starting at position 8 */ 51 F_12, /* FPR starting at position 12 */ 52 F_16, /* FPR starting at position 16 */ 53 F_20, /* FPR starting at position 16 */ 54 F_24, /* FPR starting at position 24 */ 55 F_28, /* FPR starting at position 28 */ 56 F_32, /* FPR starting at position 32 */ 57 A_8, /* Access reg. starting at position 8 */ 58 A_12, /* Access reg. starting at position 12 */ 59 A_24, /* Access reg. starting at position 24 */ 60 A_28, /* Access reg. starting at position 28 */ 61 C_8, /* Control reg. starting at position 8 */ 62 C_12, /* Control reg. starting at position 12 */ 63 V_8, /* Vector reg. starting at position 8, extension bit at 36 */ 64 V_12, /* Vector reg. starting at position 12, extension bit at 37 */ 65 V_16, /* Vector reg. starting at position 16, extension bit at 38 */ 66 V_32, /* Vector reg. starting at position 32, extension bit at 39 */ 67 W_12, /* Vector reg. at bit 12, extension at bit 37, used as index */ 68 B_16, /* Base register starting at position 16 */ 69 B_32, /* Base register starting at position 32 */ 70 X_12, /* Index register starting at position 12 */ 71 D_20, /* Displacement starting at position 20 */ 72 D_36, /* Displacement starting at position 36 */ 73 D20_20, /* 20 bit displacement starting at 20 */ 74 L4_8, /* 4 bit length starting at position 8 */ 75 L4_12, /* 4 bit length starting at position 12 */ 76 L8_8, /* 8 bit length starting at position 8 */ 77 U4_8, /* 4 bit unsigned value starting at 8 */ 78 U4_12, /* 4 bit unsigned value starting at 12 */ 79 U4_16, /* 4 bit unsigned value starting at 16 */ 80 U4_20, /* 4 bit unsigned value starting at 20 */ 81 U4_24, /* 4 bit unsigned value starting at 24 */ 82 U4_28, /* 4 bit unsigned value starting at 28 */ 83 U4_32, /* 4 bit unsigned value starting at 32 */ 84 U4_36, /* 4 bit unsigned value starting at 36 */ 85 U8_8, /* 8 bit unsigned value starting at 8 */ 86 U8_16, /* 8 bit unsigned value starting at 16 */ 87 U8_24, /* 8 bit unsigned value starting at 24 */ 88 U8_32, /* 8 bit unsigned value starting at 32 */ 89 I8_8, /* 8 bit signed value starting at 8 */ 90 I8_16, /* 8 bit signed value starting at 16 */ 91 I8_24, /* 8 bit signed value starting at 24 */ 92 I8_32, /* 8 bit signed value starting at 32 */ 93 J12_12, /* PC relative offset at 12 */ 94 I16_16, /* 16 bit signed value starting at 16 */ 95 I16_32, /* 32 bit signed value starting at 16 */ 96 U16_16, /* 16 bit unsigned value starting at 16 */ 97 U16_32, /* 32 bit unsigned value starting at 16 */ 98 J16_16, /* PC relative jump offset at 16 */ 99 J16_32, /* PC relative offset at 16 */ 100 I24_24, /* 24 bit signed value starting at 24 */ 101 J32_16, /* PC relative long offset at 16 */ 102 I32_16, /* 32 bit signed value starting at 16 */ 103 U32_16, /* 32 bit unsigned value starting at 16 */ 104 M_16, /* 4 bit optional mask starting at 16 */ 105 M_20, /* 4 bit optional mask starting at 20 */ 106 M_24, /* 4 bit optional mask starting at 24 */ 107 M_28, /* 4 bit optional mask starting at 28 */ 108 M_32, /* 4 bit optional mask starting at 32 */ 109 RO_28, /* optional GPR starting at position 28 */ 110 }; 111 112 /* 113 * Enumeration of the different instruction formats. 114 * For details consult the principles of operation. 115 */ 116 enum { 117 INSTR_INVALID, 118 INSTR_E, 119 INSTR_IE_UU, 120 INSTR_MII_UPI, 121 INSTR_RIE_R0IU, INSTR_RIE_R0UU, INSTR_RIE_RRP, INSTR_RIE_RRPU, 122 INSTR_RIE_RRUUU, INSTR_RIE_RUPI, INSTR_RIE_RUPU, INSTR_RIE_RRI0, 123 INSTR_RIL_RI, INSTR_RIL_RP, INSTR_RIL_RU, INSTR_RIL_UP, 124 INSTR_RIS_R0RDU, INSTR_RIS_R0UU, INSTR_RIS_RURDI, INSTR_RIS_RURDU, 125 INSTR_RI_RI, INSTR_RI_RP, INSTR_RI_RU, INSTR_RI_UP, 126 INSTR_RRE_00, INSTR_RRE_0R, INSTR_RRE_AA, INSTR_RRE_AR, INSTR_RRE_F0, 127 INSTR_RRE_FF, INSTR_RRE_FR, INSTR_RRE_R0, INSTR_RRE_RA, INSTR_RRE_RF, 128 INSTR_RRE_RR, INSTR_RRE_RR_OPT, 129 INSTR_RRF_0UFF, INSTR_RRF_F0FF, INSTR_RRF_F0FF2, INSTR_RRF_F0FR, 130 INSTR_RRF_FFRU, INSTR_RRF_FUFF, INSTR_RRF_FUFF2, INSTR_RRF_M0RR, 131 INSTR_RRF_R0RR, INSTR_RRF_R0RR2, INSTR_RRF_RMRR, INSTR_RRF_RURR, 132 INSTR_RRF_U0FF, INSTR_RRF_U0RF, INSTR_RRF_U0RR, INSTR_RRF_UUFF, 133 INSTR_RRF_UUFR, INSTR_RRF_UURF, 134 INSTR_RRR_F0FF, INSTR_RRS_RRRDU, 135 INSTR_RR_FF, INSTR_RR_R0, INSTR_RR_RR, INSTR_RR_U0, INSTR_RR_UR, 136 INSTR_RSE_CCRD, INSTR_RSE_RRRD, INSTR_RSE_RURD, 137 INSTR_RSI_RRP, 138 INSTR_RSL_LRDFU, INSTR_RSL_R0RD, 139 INSTR_RSY_AARD, INSTR_RSY_CCRD, INSTR_RSY_RRRD, INSTR_RSY_RURD, 140 INSTR_RSY_RDRM, INSTR_RSY_RMRD, 141 INSTR_RS_AARD, INSTR_RS_CCRD, INSTR_RS_R0RD, INSTR_RS_RRRD, 142 INSTR_RS_RURD, 143 INSTR_RXE_FRRD, INSTR_RXE_RRRD, INSTR_RXE_RRRDM, 144 INSTR_RXF_FRRDF, 145 INSTR_RXY_FRRD, INSTR_RXY_RRRD, INSTR_RXY_URRD, 146 INSTR_RX_FRRD, INSTR_RX_RRRD, INSTR_RX_URRD, 147 INSTR_SIL_RDI, INSTR_SIL_RDU, 148 INSTR_SIY_IRD, INSTR_SIY_URD, 149 INSTR_SI_URD, 150 INSTR_SMI_U0RDP, 151 INSTR_SSE_RDRD, 152 INSTR_SSF_RRDRD, INSTR_SSF_RRDRD2, 153 INSTR_SS_L0RDRD, INSTR_SS_LIRDRD, INSTR_SS_LLRDRD, INSTR_SS_RRRDRD, 154 INSTR_SS_RRRDRD2, INSTR_SS_RRRDRD3, 155 INSTR_S_00, INSTR_S_RD, 156 INSTR_VRI_V0IM, INSTR_VRI_V0I0, INSTR_VRI_V0IIM, INSTR_VRI_VVIM, 157 INSTR_VRI_VVV0IM, INSTR_VRI_VVV0I0, INSTR_VRI_VVIMM, 158 INSTR_VRR_VV00MMM, INSTR_VRR_VV000MM, INSTR_VRR_VV0000M, 159 INSTR_VRR_VV00000, INSTR_VRR_VVV0M0M, INSTR_VRR_VV00M0M, 160 INSTR_VRR_VVV000M, INSTR_VRR_VVV000V, INSTR_VRR_VVV0000, 161 INSTR_VRR_VVV0MMM, INSTR_VRR_VVV00MM, INSTR_VRR_VVVMM0V, 162 INSTR_VRR_VVVM0MV, INSTR_VRR_VVVM00V, INSTR_VRR_VRR0000, 163 INSTR_VRS_VVRDM, INSTR_VRS_VVRD0, INSTR_VRS_VRRDM, INSTR_VRS_VRRD0, 164 INSTR_VRS_RVRDM, 165 INSTR_VRV_VVRDM, INSTR_VRV_VWRDM, 166 INSTR_VRX_VRRDM, INSTR_VRX_VRRD0, 167 }; 168 169 static const struct s390_operand operands[] = 170 { 171 [UNUSED] = { 0, 0, 0 }, 172 [R_8] = { 4, 8, OPERAND_GPR }, 173 [R_12] = { 4, 12, OPERAND_GPR }, 174 [R_16] = { 4, 16, OPERAND_GPR }, 175 [R_20] = { 4, 20, OPERAND_GPR }, 176 [R_24] = { 4, 24, OPERAND_GPR }, 177 [R_28] = { 4, 28, OPERAND_GPR }, 178 [R_32] = { 4, 32, OPERAND_GPR }, 179 [F_8] = { 4, 8, OPERAND_FPR }, 180 [F_12] = { 4, 12, OPERAND_FPR }, 181 [F_16] = { 4, 16, OPERAND_FPR }, 182 [F_20] = { 4, 16, OPERAND_FPR }, 183 [F_24] = { 4, 24, OPERAND_FPR }, 184 [F_28] = { 4, 28, OPERAND_FPR }, 185 [F_32] = { 4, 32, OPERAND_FPR }, 186 [A_8] = { 4, 8, OPERAND_AR }, 187 [A_12] = { 4, 12, OPERAND_AR }, 188 [A_24] = { 4, 24, OPERAND_AR }, 189 [A_28] = { 4, 28, OPERAND_AR }, 190 [C_8] = { 4, 8, OPERAND_CR }, 191 [C_12] = { 4, 12, OPERAND_CR }, 192 [V_8] = { 4, 8, OPERAND_VR }, 193 [V_12] = { 4, 12, OPERAND_VR }, 194 [V_16] = { 4, 16, OPERAND_VR }, 195 [V_32] = { 4, 32, OPERAND_VR }, 196 [W_12] = { 4, 12, OPERAND_INDEX | OPERAND_VR }, 197 [B_16] = { 4, 16, OPERAND_BASE | OPERAND_GPR }, 198 [B_32] = { 4, 32, OPERAND_BASE | OPERAND_GPR }, 199 [X_12] = { 4, 12, OPERAND_INDEX | OPERAND_GPR }, 200 [D_20] = { 12, 20, OPERAND_DISP }, 201 [D_36] = { 12, 36, OPERAND_DISP }, 202 [D20_20] = { 20, 20, OPERAND_DISP | OPERAND_SIGNED }, 203 [L4_8] = { 4, 8, OPERAND_LENGTH }, 204 [L4_12] = { 4, 12, OPERAND_LENGTH }, 205 [L8_8] = { 8, 8, OPERAND_LENGTH }, 206 [U4_8] = { 4, 8, 0 }, 207 [U4_12] = { 4, 12, 0 }, 208 [U4_16] = { 4, 16, 0 }, 209 [U4_20] = { 4, 20, 0 }, 210 [U4_24] = { 4, 24, 0 }, 211 [U4_28] = { 4, 28, 0 }, 212 [U4_32] = { 4, 32, 0 }, 213 [U4_36] = { 4, 36, 0 }, 214 [U8_8] = { 8, 8, 0 }, 215 [U8_16] = { 8, 16, 0 }, 216 [U8_24] = { 8, 24, 0 }, 217 [U8_32] = { 8, 32, 0 }, 218 [J12_12] = { 12, 12, OPERAND_PCREL }, 219 [I8_8] = { 8, 8, OPERAND_SIGNED }, 220 [I8_16] = { 8, 16, OPERAND_SIGNED }, 221 [I8_24] = { 8, 24, OPERAND_SIGNED }, 222 [I8_32] = { 8, 32, OPERAND_SIGNED }, 223 [I16_32] = { 16, 32, OPERAND_SIGNED }, 224 [I16_16] = { 16, 16, OPERAND_SIGNED }, 225 [U16_16] = { 16, 16, 0 }, 226 [U16_32] = { 16, 32, 0 }, 227 [J16_16] = { 16, 16, OPERAND_PCREL }, 228 [J16_32] = { 16, 32, OPERAND_PCREL }, 229 [I24_24] = { 24, 24, OPERAND_SIGNED }, 230 [J32_16] = { 32, 16, OPERAND_PCREL }, 231 [I32_16] = { 32, 16, OPERAND_SIGNED }, 232 [U32_16] = { 32, 16, 0 }, 233 [M_16] = { 4, 16, 0 }, 234 [M_20] = { 4, 20, 0 }, 235 [M_24] = { 4, 24, 0 }, 236 [M_28] = { 4, 28, 0 }, 237 [M_32] = { 4, 32, 0 }, 238 [RO_28] = { 4, 28, OPERAND_GPR } 239 }; 240 241 static const unsigned char formats[][7] = { 242 [INSTR_E] = { 0xff, 0,0,0,0,0,0 }, 243 [INSTR_IE_UU] = { 0xff, U4_24,U4_28,0,0,0,0 }, 244 [INSTR_MII_UPI] = { 0xff, U4_8,J12_12,I24_24 }, 245 [INSTR_RIE_R0IU] = { 0xff, R_8,I16_16,U4_32,0,0,0 }, 246 [INSTR_RIE_R0UU] = { 0xff, R_8,U16_16,U4_32,0,0,0 }, 247 [INSTR_RIE_RRI0] = { 0xff, R_8,R_12,I16_16,0,0,0 }, 248 [INSTR_RIE_RRPU] = { 0xff, R_8,R_12,U4_32,J16_16,0,0 }, 249 [INSTR_RIE_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 }, 250 [INSTR_RIE_RRUUU] = { 0xff, R_8,R_12,U8_16,U8_24,U8_32,0 }, 251 [INSTR_RIE_RUPI] = { 0xff, R_8,I8_32,U4_12,J16_16,0,0 }, 252 [INSTR_RIE_RUPU] = { 0xff, R_8,U8_32,U4_12,J16_16,0,0 }, 253 [INSTR_RIL_RI] = { 0x0f, R_8,I32_16,0,0,0,0 }, 254 [INSTR_RIL_RP] = { 0x0f, R_8,J32_16,0,0,0,0 }, 255 [INSTR_RIL_RU] = { 0x0f, R_8,U32_16,0,0,0,0 }, 256 [INSTR_RIL_UP] = { 0x0f, U4_8,J32_16,0,0,0,0 }, 257 [INSTR_RIS_R0RDU] = { 0xff, R_8,U8_32,D_20,B_16,0,0 }, 258 [INSTR_RIS_RURDI] = { 0xff, R_8,I8_32,U4_12,D_20,B_16,0 }, 259 [INSTR_RIS_RURDU] = { 0xff, R_8,U8_32,U4_12,D_20,B_16,0 }, 260 [INSTR_RI_RI] = { 0x0f, R_8,I16_16,0,0,0,0 }, 261 [INSTR_RI_RP] = { 0x0f, R_8,J16_16,0,0,0,0 }, 262 [INSTR_RI_RU] = { 0x0f, R_8,U16_16,0,0,0,0 }, 263 [INSTR_RI_UP] = { 0x0f, U4_8,J16_16,0,0,0,0 }, 264 [INSTR_RRE_00] = { 0xff, 0,0,0,0,0,0 }, 265 [INSTR_RRE_0R] = { 0xff, R_28,0,0,0,0,0 }, 266 [INSTR_RRE_AA] = { 0xff, A_24,A_28,0,0,0,0 }, 267 [INSTR_RRE_AR] = { 0xff, A_24,R_28,0,0,0,0 }, 268 [INSTR_RRE_F0] = { 0xff, F_24,0,0,0,0,0 }, 269 [INSTR_RRE_FF] = { 0xff, F_24,F_28,0,0,0,0 }, 270 [INSTR_RRE_FR] = { 0xff, F_24,R_28,0,0,0,0 }, 271 [INSTR_RRE_R0] = { 0xff, R_24,0,0,0,0,0 }, 272 [INSTR_RRE_RA] = { 0xff, R_24,A_28,0,0,0,0 }, 273 [INSTR_RRE_RF] = { 0xff, R_24,F_28,0,0,0,0 }, 274 [INSTR_RRE_RR] = { 0xff, R_24,R_28,0,0,0,0 }, 275 [INSTR_RRE_RR_OPT]= { 0xff, R_24,RO_28,0,0,0,0 }, 276 [INSTR_RRF_0UFF] = { 0xff, F_24,F_28,U4_20,0,0,0 }, 277 [INSTR_RRF_F0FF2] = { 0xff, F_24,F_16,F_28,0,0,0 }, 278 [INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 }, 279 [INSTR_RRF_F0FR] = { 0xff, F_24,F_16,R_28,0,0,0 }, 280 [INSTR_RRF_FFRU] = { 0xff, F_24,F_16,R_28,U4_20,0,0 }, 281 [INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 }, 282 [INSTR_RRF_FUFF2] = { 0xff, F_24,F_28,F_16,U4_20,0,0 }, 283 [INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 }, 284 [INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 }, 285 [INSTR_RRF_R0RR2] = { 0xff, R_24,R_28,R_16,0,0,0 }, 286 [INSTR_RRF_RMRR] = { 0xff, R_24,R_16,R_28,M_20,0,0 }, 287 [INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 }, 288 [INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 }, 289 [INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 }, 290 [INSTR_RRF_U0RR] = { 0xff, R_24,R_28,U4_16,0,0,0 }, 291 [INSTR_RRF_UUFF] = { 0xff, F_24,U4_16,F_28,U4_20,0,0 }, 292 [INSTR_RRF_UUFR] = { 0xff, F_24,U4_16,R_28,U4_20,0,0 }, 293 [INSTR_RRF_UURF] = { 0xff, R_24,U4_16,F_28,U4_20,0,0 }, 294 [INSTR_RRR_F0FF] = { 0xff, F_24,F_28,F_16,0,0,0 }, 295 [INSTR_RRS_RRRDU] = { 0xff, R_8,R_12,U4_32,D_20,B_16,0 }, 296 [INSTR_RR_FF] = { 0xff, F_8,F_12,0,0,0,0 }, 297 [INSTR_RR_R0] = { 0xff, R_8, 0,0,0,0,0 }, 298 [INSTR_RR_RR] = { 0xff, R_8,R_12,0,0,0,0 }, 299 [INSTR_RR_U0] = { 0xff, U8_8, 0,0,0,0,0 }, 300 [INSTR_RR_UR] = { 0xff, U4_8,R_12,0,0,0,0 }, 301 [INSTR_RSE_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 }, 302 [INSTR_RSE_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 }, 303 [INSTR_RSE_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 }, 304 [INSTR_RSI_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 }, 305 [INSTR_RSL_LRDFU] = { 0xff, F_32,D_20,L4_8,B_16,U4_36,0 }, 306 [INSTR_RSL_R0RD] = { 0xff, D_20,L4_8,B_16,0,0,0 }, 307 [INSTR_RSY_AARD] = { 0xff, A_8,A_12,D20_20,B_16,0,0 }, 308 [INSTR_RSY_CCRD] = { 0xff, C_8,C_12,D20_20,B_16,0,0 }, 309 [INSTR_RSY_RDRM] = { 0xff, R_8,D20_20,B_16,U4_12,0,0 }, 310 [INSTR_RSY_RMRD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 }, 311 [INSTR_RSY_RRRD] = { 0xff, R_8,R_12,D20_20,B_16,0,0 }, 312 [INSTR_RSY_RURD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 }, 313 [INSTR_RS_AARD] = { 0xff, A_8,A_12,D_20,B_16,0,0 }, 314 [INSTR_RS_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 }, 315 [INSTR_RS_R0RD] = { 0xff, R_8,D_20,B_16,0,0,0 }, 316 [INSTR_RS_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 }, 317 [INSTR_RS_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 }, 318 [INSTR_RXE_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, 319 [INSTR_RXE_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, 320 [INSTR_RXE_RRRDM] = { 0xff, R_8,D_20,X_12,B_16,M_32,0 }, 321 [INSTR_RXF_FRRDF] = { 0xff, F_32,F_8,D_20,X_12,B_16,0 }, 322 [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 }, 323 [INSTR_RXY_RRRD] = { 0xff, R_8,D20_20,X_12,B_16,0,0 }, 324 [INSTR_RXY_URRD] = { 0xff, U4_8,D20_20,X_12,B_16,0,0 }, 325 [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, 326 [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, 327 [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 }, 328 [INSTR_SIL_RDI] = { 0xff, D_20,B_16,I16_32,0,0,0 }, 329 [INSTR_SIL_RDU] = { 0xff, D_20,B_16,U16_32,0,0,0 }, 330 [INSTR_SIY_IRD] = { 0xff, D20_20,B_16,I8_8,0,0,0 }, 331 [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 }, 332 [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 }, 333 [INSTR_SMI_U0RDP] = { 0xff, U4_8,J16_32,D_20,B_16,0,0 }, 334 [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 }, 335 [INSTR_SSF_RRDRD] = { 0x0f, D_20,B_16,D_36,B_32,R_8,0 }, 336 [INSTR_SSF_RRDRD2]= { 0x0f, R_8,D_20,B_16,D_36,B_32,0 }, 337 [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 }, 338 [INSTR_SS_LIRDRD] = { 0xff, D_20,L4_8,B_16,D_36,B_32,U4_12 }, 339 [INSTR_SS_LLRDRD] = { 0xff, D_20,L4_8,B_16,D_36,L4_12,B_32 }, 340 [INSTR_SS_RRRDRD2]= { 0xff, R_8,D_20,B_16,R_12,D_36,B_32 }, 341 [INSTR_SS_RRRDRD3]= { 0xff, R_8,R_12,D_20,B_16,D_36,B_32 }, 342 [INSTR_SS_RRRDRD] = { 0xff, D_20,R_8,B_16,D_36,B_32,R_12 }, 343 [INSTR_S_00] = { 0xff, 0,0,0,0,0,0 }, 344 [INSTR_S_RD] = { 0xff, D_20,B_16,0,0,0,0 }, 345 [INSTR_VRI_V0IM] = { 0xff, V_8,I16_16,M_32,0,0,0 }, 346 [INSTR_VRI_V0I0] = { 0xff, V_8,I16_16,0,0,0,0 }, 347 [INSTR_VRI_V0IIM] = { 0xff, V_8,I8_16,I8_24,M_32,0,0 }, 348 [INSTR_VRI_VVIM] = { 0xff, V_8,I16_16,V_12,M_32,0,0 }, 349 [INSTR_VRI_VVV0IM]= { 0xff, V_8,V_12,V_16,I8_24,M_32,0 }, 350 [INSTR_VRI_VVV0I0]= { 0xff, V_8,V_12,V_16,I8_24,0,0 }, 351 [INSTR_VRI_VVIMM] = { 0xff, V_8,V_12,I16_16,M_32,M_28,0 }, 352 [INSTR_VRR_VV00MMM]={ 0xff, V_8,V_12,M_32,M_28,M_24,0 }, 353 [INSTR_VRR_VV000MM]={ 0xff, V_8,V_12,M_32,M_28,0,0 }, 354 [INSTR_VRR_VV0000M]={ 0xff, V_8,V_12,M_32,0,0,0 }, 355 [INSTR_VRR_VV00000]={ 0xff, V_8,V_12,0,0,0,0 }, 356 [INSTR_VRR_VVV0M0M]={ 0xff, V_8,V_12,V_16,M_32,M_24,0 }, 357 [INSTR_VRR_VV00M0M]={ 0xff, V_8,V_12,M_32,M_24,0,0 }, 358 [INSTR_VRR_VVV000M]={ 0xff, V_8,V_12,V_16,M_32,0,0 }, 359 [INSTR_VRR_VVV000V]={ 0xff, V_8,V_12,V_16,V_32,0,0 }, 360 [INSTR_VRR_VVV0000]={ 0xff, V_8,V_12,V_16,0,0,0 }, 361 [INSTR_VRR_VVV0MMM]={ 0xff, V_8,V_12,V_16,M_32,M_28,M_24 }, 362 [INSTR_VRR_VVV00MM]={ 0xff, V_8,V_12,V_16,M_32,M_28,0 }, 363 [INSTR_VRR_VVVMM0V]={ 0xff, V_8,V_12,V_16,V_32,M_20,M_24 }, 364 [INSTR_VRR_VVVM0MV]={ 0xff, V_8,V_12,V_16,V_32,M_28,M_20 }, 365 [INSTR_VRR_VVVM00V]={ 0xff, V_8,V_12,V_16,V_32,M_20,0 }, 366 [INSTR_VRR_VRR0000]={ 0xff, V_8,R_12,R_16,0,0,0 }, 367 [INSTR_VRS_VVRDM] = { 0xff, V_8,V_12,D_20,B_16,M_32,0 }, 368 [INSTR_VRS_VVRD0] = { 0xff, V_8,V_12,D_20,B_16,0,0 }, 369 [INSTR_VRS_VRRDM] = { 0xff, V_8,R_12,D_20,B_16,M_32,0 }, 370 [INSTR_VRS_VRRD0] = { 0xff, V_8,R_12,D_20,B_16,0,0 }, 371 [INSTR_VRS_RVRDM] = { 0xff, R_8,V_12,D_20,B_16,M_32,0 }, 372 [INSTR_VRV_VVRDM] = { 0xff, V_8,V_12,D_20,B_16,M_32,0 }, 373 [INSTR_VRV_VWRDM] = { 0xff, V_8,D_20,W_12,B_16,M_32,0 }, 374 [INSTR_VRX_VRRDM] = { 0xff, V_8,D_20,X_12,B_16,M_32,0 }, 375 [INSTR_VRX_VRRD0] = { 0xff, V_8,D_20,X_12,B_16,0,0 }, 376 }; 377 378 enum { 379 LONG_INSN_ALGHSIK, 380 LONG_INSN_ALHHHR, 381 LONG_INSN_ALHHLR, 382 LONG_INSN_ALHSIK, 383 LONG_INSN_ALSIHN, 384 LONG_INSN_CDFBRA, 385 LONG_INSN_CDGBRA, 386 LONG_INSN_CDGTRA, 387 LONG_INSN_CDLFBR, 388 LONG_INSN_CDLFTR, 389 LONG_INSN_CDLGBR, 390 LONG_INSN_CDLGTR, 391 LONG_INSN_CEFBRA, 392 LONG_INSN_CEGBRA, 393 LONG_INSN_CELFBR, 394 LONG_INSN_CELGBR, 395 LONG_INSN_CFDBRA, 396 LONG_INSN_CFEBRA, 397 LONG_INSN_CFXBRA, 398 LONG_INSN_CGDBRA, 399 LONG_INSN_CGDTRA, 400 LONG_INSN_CGEBRA, 401 LONG_INSN_CGXBRA, 402 LONG_INSN_CGXTRA, 403 LONG_INSN_CLFDBR, 404 LONG_INSN_CLFDTR, 405 LONG_INSN_CLFEBR, 406 LONG_INSN_CLFHSI, 407 LONG_INSN_CLFXBR, 408 LONG_INSN_CLFXTR, 409 LONG_INSN_CLGDBR, 410 LONG_INSN_CLGDTR, 411 LONG_INSN_CLGEBR, 412 LONG_INSN_CLGFRL, 413 LONG_INSN_CLGHRL, 414 LONG_INSN_CLGHSI, 415 LONG_INSN_CLGXBR, 416 LONG_INSN_CLGXTR, 417 LONG_INSN_CLHHSI, 418 LONG_INSN_CXFBRA, 419 LONG_INSN_CXGBRA, 420 LONG_INSN_CXGTRA, 421 LONG_INSN_CXLFBR, 422 LONG_INSN_CXLFTR, 423 LONG_INSN_CXLGBR, 424 LONG_INSN_CXLGTR, 425 LONG_INSN_FIDBRA, 426 LONG_INSN_FIEBRA, 427 LONG_INSN_FIXBRA, 428 LONG_INSN_LDXBRA, 429 LONG_INSN_LEDBRA, 430 LONG_INSN_LEXBRA, 431 LONG_INSN_LLGFAT, 432 LONG_INSN_LLGFRL, 433 LONG_INSN_LLGHRL, 434 LONG_INSN_LLGTAT, 435 LONG_INSN_POPCNT, 436 LONG_INSN_RIEMIT, 437 LONG_INSN_RINEXT, 438 LONG_INSN_RISBGN, 439 LONG_INSN_RISBHG, 440 LONG_INSN_RISBLG, 441 LONG_INSN_SLHHHR, 442 LONG_INSN_SLHHLR, 443 LONG_INSN_TABORT, 444 LONG_INSN_TBEGIN, 445 LONG_INSN_TBEGINC, 446 LONG_INSN_PCISTG, 447 LONG_INSN_MPCIFC, 448 LONG_INSN_STPCIFC, 449 LONG_INSN_PCISTB, 450 LONG_INSN_VPOPCT, 451 LONG_INSN_VERLLV, 452 LONG_INSN_VESRAV, 453 LONG_INSN_VESRLV, 454 LONG_INSN_VSBCBI, 455 LONG_INSN_STCCTM 456 }; 457 458 static char *long_insn_name[] = { 459 [LONG_INSN_ALGHSIK] = "alghsik", 460 [LONG_INSN_ALHHHR] = "alhhhr", 461 [LONG_INSN_ALHHLR] = "alhhlr", 462 [LONG_INSN_ALHSIK] = "alhsik", 463 [LONG_INSN_ALSIHN] = "alsihn", 464 [LONG_INSN_CDFBRA] = "cdfbra", 465 [LONG_INSN_CDGBRA] = "cdgbra", 466 [LONG_INSN_CDGTRA] = "cdgtra", 467 [LONG_INSN_CDLFBR] = "cdlfbr", 468 [LONG_INSN_CDLFTR] = "cdlftr", 469 [LONG_INSN_CDLGBR] = "cdlgbr", 470 [LONG_INSN_CDLGTR] = "cdlgtr", 471 [LONG_INSN_CEFBRA] = "cefbra", 472 [LONG_INSN_CEGBRA] = "cegbra", 473 [LONG_INSN_CELFBR] = "celfbr", 474 [LONG_INSN_CELGBR] = "celgbr", 475 [LONG_INSN_CFDBRA] = "cfdbra", 476 [LONG_INSN_CFEBRA] = "cfebra", 477 [LONG_INSN_CFXBRA] = "cfxbra", 478 [LONG_INSN_CGDBRA] = "cgdbra", 479 [LONG_INSN_CGDTRA] = "cgdtra", 480 [LONG_INSN_CGEBRA] = "cgebra", 481 [LONG_INSN_CGXBRA] = "cgxbra", 482 [LONG_INSN_CGXTRA] = "cgxtra", 483 [LONG_INSN_CLFDBR] = "clfdbr", 484 [LONG_INSN_CLFDTR] = "clfdtr", 485 [LONG_INSN_CLFEBR] = "clfebr", 486 [LONG_INSN_CLFHSI] = "clfhsi", 487 [LONG_INSN_CLFXBR] = "clfxbr", 488 [LONG_INSN_CLFXTR] = "clfxtr", 489 [LONG_INSN_CLGDBR] = "clgdbr", 490 [LONG_INSN_CLGDTR] = "clgdtr", 491 [LONG_INSN_CLGEBR] = "clgebr", 492 [LONG_INSN_CLGFRL] = "clgfrl", 493 [LONG_INSN_CLGHRL] = "clghrl", 494 [LONG_INSN_CLGHSI] = "clghsi", 495 [LONG_INSN_CLGXBR] = "clgxbr", 496 [LONG_INSN_CLGXTR] = "clgxtr", 497 [LONG_INSN_CLHHSI] = "clhhsi", 498 [LONG_INSN_CXFBRA] = "cxfbra", 499 [LONG_INSN_CXGBRA] = "cxgbra", 500 [LONG_INSN_CXGTRA] = "cxgtra", 501 [LONG_INSN_CXLFBR] = "cxlfbr", 502 [LONG_INSN_CXLFTR] = "cxlftr", 503 [LONG_INSN_CXLGBR] = "cxlgbr", 504 [LONG_INSN_CXLGTR] = "cxlgtr", 505 [LONG_INSN_FIDBRA] = "fidbra", 506 [LONG_INSN_FIEBRA] = "fiebra", 507 [LONG_INSN_FIXBRA] = "fixbra", 508 [LONG_INSN_LDXBRA] = "ldxbra", 509 [LONG_INSN_LEDBRA] = "ledbra", 510 [LONG_INSN_LEXBRA] = "lexbra", 511 [LONG_INSN_LLGFAT] = "llgfat", 512 [LONG_INSN_LLGFRL] = "llgfrl", 513 [LONG_INSN_LLGHRL] = "llghrl", 514 [LONG_INSN_LLGTAT] = "llgtat", 515 [LONG_INSN_POPCNT] = "popcnt", 516 [LONG_INSN_RIEMIT] = "riemit", 517 [LONG_INSN_RINEXT] = "rinext", 518 [LONG_INSN_RISBGN] = "risbgn", 519 [LONG_INSN_RISBHG] = "risbhg", 520 [LONG_INSN_RISBLG] = "risblg", 521 [LONG_INSN_SLHHHR] = "slhhhr", 522 [LONG_INSN_SLHHLR] = "slhhlr", 523 [LONG_INSN_TABORT] = "tabort", 524 [LONG_INSN_TBEGIN] = "tbegin", 525 [LONG_INSN_TBEGINC] = "tbeginc", 526 [LONG_INSN_PCISTG] = "pcistg", 527 [LONG_INSN_MPCIFC] = "mpcifc", 528 [LONG_INSN_STPCIFC] = "stpcifc", 529 [LONG_INSN_PCISTB] = "pcistb", 530 [LONG_INSN_VPOPCT] = "vpopct", 531 [LONG_INSN_VERLLV] = "verllv", 532 [LONG_INSN_VESRAV] = "vesrav", 533 [LONG_INSN_VESRLV] = "vesrlv", 534 [LONG_INSN_VSBCBI] = "vsbcbi", 535 [LONG_INSN_STCCTM] = "stcctm", 536 }; 537 538 static struct s390_insn opcode[] = { 539 #ifdef CONFIG_64BIT 540 { "bprp", 0xc5, INSTR_MII_UPI }, 541 { "bpp", 0xc7, INSTR_SMI_U0RDP }, 542 { "trtr", 0xd0, INSTR_SS_L0RDRD }, 543 { "lmd", 0xef, INSTR_SS_RRRDRD3 }, 544 #endif 545 { "spm", 0x04, INSTR_RR_R0 }, 546 { "balr", 0x05, INSTR_RR_RR }, 547 { "bctr", 0x06, INSTR_RR_RR }, 548 { "bcr", 0x07, INSTR_RR_UR }, 549 { "svc", 0x0a, INSTR_RR_U0 }, 550 { "bsm", 0x0b, INSTR_RR_RR }, 551 { "bassm", 0x0c, INSTR_RR_RR }, 552 { "basr", 0x0d, INSTR_RR_RR }, 553 { "mvcl", 0x0e, INSTR_RR_RR }, 554 { "clcl", 0x0f, INSTR_RR_RR }, 555 { "lpr", 0x10, INSTR_RR_RR }, 556 { "lnr", 0x11, INSTR_RR_RR }, 557 { "ltr", 0x12, INSTR_RR_RR }, 558 { "lcr", 0x13, INSTR_RR_RR }, 559 { "nr", 0x14, INSTR_RR_RR }, 560 { "clr", 0x15, INSTR_RR_RR }, 561 { "or", 0x16, INSTR_RR_RR }, 562 { "xr", 0x17, INSTR_RR_RR }, 563 { "lr", 0x18, INSTR_RR_RR }, 564 { "cr", 0x19, INSTR_RR_RR }, 565 { "ar", 0x1a, INSTR_RR_RR }, 566 { "sr", 0x1b, INSTR_RR_RR }, 567 { "mr", 0x1c, INSTR_RR_RR }, 568 { "dr", 0x1d, INSTR_RR_RR }, 569 { "alr", 0x1e, INSTR_RR_RR }, 570 { "slr", 0x1f, INSTR_RR_RR }, 571 { "lpdr", 0x20, INSTR_RR_FF }, 572 { "lndr", 0x21, INSTR_RR_FF }, 573 { "ltdr", 0x22, INSTR_RR_FF }, 574 { "lcdr", 0x23, INSTR_RR_FF }, 575 { "hdr", 0x24, INSTR_RR_FF }, 576 { "ldxr", 0x25, INSTR_RR_FF }, 577 { "mxr", 0x26, INSTR_RR_FF }, 578 { "mxdr", 0x27, INSTR_RR_FF }, 579 { "ldr", 0x28, INSTR_RR_FF }, 580 { "cdr", 0x29, INSTR_RR_FF }, 581 { "adr", 0x2a, INSTR_RR_FF }, 582 { "sdr", 0x2b, INSTR_RR_FF }, 583 { "mdr", 0x2c, INSTR_RR_FF }, 584 { "ddr", 0x2d, INSTR_RR_FF }, 585 { "awr", 0x2e, INSTR_RR_FF }, 586 { "swr", 0x2f, INSTR_RR_FF }, 587 { "lper", 0x30, INSTR_RR_FF }, 588 { "lner", 0x31, INSTR_RR_FF }, 589 { "lter", 0x32, INSTR_RR_FF }, 590 { "lcer", 0x33, INSTR_RR_FF }, 591 { "her", 0x34, INSTR_RR_FF }, 592 { "ledr", 0x35, INSTR_RR_FF }, 593 { "axr", 0x36, INSTR_RR_FF }, 594 { "sxr", 0x37, INSTR_RR_FF }, 595 { "ler", 0x38, INSTR_RR_FF }, 596 { "cer", 0x39, INSTR_RR_FF }, 597 { "aer", 0x3a, INSTR_RR_FF }, 598 { "ser", 0x3b, INSTR_RR_FF }, 599 { "mder", 0x3c, INSTR_RR_FF }, 600 { "der", 0x3d, INSTR_RR_FF }, 601 { "aur", 0x3e, INSTR_RR_FF }, 602 { "sur", 0x3f, INSTR_RR_FF }, 603 { "sth", 0x40, INSTR_RX_RRRD }, 604 { "la", 0x41, INSTR_RX_RRRD }, 605 { "stc", 0x42, INSTR_RX_RRRD }, 606 { "ic", 0x43, INSTR_RX_RRRD }, 607 { "ex", 0x44, INSTR_RX_RRRD }, 608 { "bal", 0x45, INSTR_RX_RRRD }, 609 { "bct", 0x46, INSTR_RX_RRRD }, 610 { "bc", 0x47, INSTR_RX_URRD }, 611 { "lh", 0x48, INSTR_RX_RRRD }, 612 { "ch", 0x49, INSTR_RX_RRRD }, 613 { "ah", 0x4a, INSTR_RX_RRRD }, 614 { "sh", 0x4b, INSTR_RX_RRRD }, 615 { "mh", 0x4c, INSTR_RX_RRRD }, 616 { "bas", 0x4d, INSTR_RX_RRRD }, 617 { "cvd", 0x4e, INSTR_RX_RRRD }, 618 { "cvb", 0x4f, INSTR_RX_RRRD }, 619 { "st", 0x50, INSTR_RX_RRRD }, 620 { "lae", 0x51, INSTR_RX_RRRD }, 621 { "n", 0x54, INSTR_RX_RRRD }, 622 { "cl", 0x55, INSTR_RX_RRRD }, 623 { "o", 0x56, INSTR_RX_RRRD }, 624 { "x", 0x57, INSTR_RX_RRRD }, 625 { "l", 0x58, INSTR_RX_RRRD }, 626 { "c", 0x59, INSTR_RX_RRRD }, 627 { "a", 0x5a, INSTR_RX_RRRD }, 628 { "s", 0x5b, INSTR_RX_RRRD }, 629 { "m", 0x5c, INSTR_RX_RRRD }, 630 { "d", 0x5d, INSTR_RX_RRRD }, 631 { "al", 0x5e, INSTR_RX_RRRD }, 632 { "sl", 0x5f, INSTR_RX_RRRD }, 633 { "std", 0x60, INSTR_RX_FRRD }, 634 { "mxd", 0x67, INSTR_RX_FRRD }, 635 { "ld", 0x68, INSTR_RX_FRRD }, 636 { "cd", 0x69, INSTR_RX_FRRD }, 637 { "ad", 0x6a, INSTR_RX_FRRD }, 638 { "sd", 0x6b, INSTR_RX_FRRD }, 639 { "md", 0x6c, INSTR_RX_FRRD }, 640 { "dd", 0x6d, INSTR_RX_FRRD }, 641 { "aw", 0x6e, INSTR_RX_FRRD }, 642 { "sw", 0x6f, INSTR_RX_FRRD }, 643 { "ste", 0x70, INSTR_RX_FRRD }, 644 { "ms", 0x71, INSTR_RX_RRRD }, 645 { "le", 0x78, INSTR_RX_FRRD }, 646 { "ce", 0x79, INSTR_RX_FRRD }, 647 { "ae", 0x7a, INSTR_RX_FRRD }, 648 { "se", 0x7b, INSTR_RX_FRRD }, 649 { "mde", 0x7c, INSTR_RX_FRRD }, 650 { "de", 0x7d, INSTR_RX_FRRD }, 651 { "au", 0x7e, INSTR_RX_FRRD }, 652 { "su", 0x7f, INSTR_RX_FRRD }, 653 { "ssm", 0x80, INSTR_S_RD }, 654 { "lpsw", 0x82, INSTR_S_RD }, 655 { "diag", 0x83, INSTR_RS_RRRD }, 656 { "brxh", 0x84, INSTR_RSI_RRP }, 657 { "brxle", 0x85, INSTR_RSI_RRP }, 658 { "bxh", 0x86, INSTR_RS_RRRD }, 659 { "bxle", 0x87, INSTR_RS_RRRD }, 660 { "srl", 0x88, INSTR_RS_R0RD }, 661 { "sll", 0x89, INSTR_RS_R0RD }, 662 { "sra", 0x8a, INSTR_RS_R0RD }, 663 { "sla", 0x8b, INSTR_RS_R0RD }, 664 { "srdl", 0x8c, INSTR_RS_R0RD }, 665 { "sldl", 0x8d, INSTR_RS_R0RD }, 666 { "srda", 0x8e, INSTR_RS_R0RD }, 667 { "slda", 0x8f, INSTR_RS_R0RD }, 668 { "stm", 0x90, INSTR_RS_RRRD }, 669 { "tm", 0x91, INSTR_SI_URD }, 670 { "mvi", 0x92, INSTR_SI_URD }, 671 { "ts", 0x93, INSTR_S_RD }, 672 { "ni", 0x94, INSTR_SI_URD }, 673 { "cli", 0x95, INSTR_SI_URD }, 674 { "oi", 0x96, INSTR_SI_URD }, 675 { "xi", 0x97, INSTR_SI_URD }, 676 { "lm", 0x98, INSTR_RS_RRRD }, 677 { "trace", 0x99, INSTR_RS_RRRD }, 678 { "lam", 0x9a, INSTR_RS_AARD }, 679 { "stam", 0x9b, INSTR_RS_AARD }, 680 { "mvcle", 0xa8, INSTR_RS_RRRD }, 681 { "clcle", 0xa9, INSTR_RS_RRRD }, 682 { "stnsm", 0xac, INSTR_SI_URD }, 683 { "stosm", 0xad, INSTR_SI_URD }, 684 { "sigp", 0xae, INSTR_RS_RRRD }, 685 { "mc", 0xaf, INSTR_SI_URD }, 686 { "lra", 0xb1, INSTR_RX_RRRD }, 687 { "stctl", 0xb6, INSTR_RS_CCRD }, 688 { "lctl", 0xb7, INSTR_RS_CCRD }, 689 { "cs", 0xba, INSTR_RS_RRRD }, 690 { "cds", 0xbb, INSTR_RS_RRRD }, 691 { "clm", 0xbd, INSTR_RS_RURD }, 692 { "stcm", 0xbe, INSTR_RS_RURD }, 693 { "icm", 0xbf, INSTR_RS_RURD }, 694 { "mvn", 0xd1, INSTR_SS_L0RDRD }, 695 { "mvc", 0xd2, INSTR_SS_L0RDRD }, 696 { "mvz", 0xd3, INSTR_SS_L0RDRD }, 697 { "nc", 0xd4, INSTR_SS_L0RDRD }, 698 { "clc", 0xd5, INSTR_SS_L0RDRD }, 699 { "oc", 0xd6, INSTR_SS_L0RDRD }, 700 { "xc", 0xd7, INSTR_SS_L0RDRD }, 701 { "mvck", 0xd9, INSTR_SS_RRRDRD }, 702 { "mvcp", 0xda, INSTR_SS_RRRDRD }, 703 { "mvcs", 0xdb, INSTR_SS_RRRDRD }, 704 { "tr", 0xdc, INSTR_SS_L0RDRD }, 705 { "trt", 0xdd, INSTR_SS_L0RDRD }, 706 { "ed", 0xde, INSTR_SS_L0RDRD }, 707 { "edmk", 0xdf, INSTR_SS_L0RDRD }, 708 { "pku", 0xe1, INSTR_SS_L0RDRD }, 709 { "unpku", 0xe2, INSTR_SS_L0RDRD }, 710 { "mvcin", 0xe8, INSTR_SS_L0RDRD }, 711 { "pka", 0xe9, INSTR_SS_L0RDRD }, 712 { "unpka", 0xea, INSTR_SS_L0RDRD }, 713 { "plo", 0xee, INSTR_SS_RRRDRD2 }, 714 { "srp", 0xf0, INSTR_SS_LIRDRD }, 715 { "mvo", 0xf1, INSTR_SS_LLRDRD }, 716 { "pack", 0xf2, INSTR_SS_LLRDRD }, 717 { "unpk", 0xf3, INSTR_SS_LLRDRD }, 718 { "zap", 0xf8, INSTR_SS_LLRDRD }, 719 { "cp", 0xf9, INSTR_SS_LLRDRD }, 720 { "ap", 0xfa, INSTR_SS_LLRDRD }, 721 { "sp", 0xfb, INSTR_SS_LLRDRD }, 722 { "mp", 0xfc, INSTR_SS_LLRDRD }, 723 { "dp", 0xfd, INSTR_SS_LLRDRD }, 724 { "", 0, INSTR_INVALID } 725 }; 726 727 static struct s390_insn opcode_01[] = { 728 #ifdef CONFIG_64BIT 729 { "ptff", 0x04, INSTR_E }, 730 { "pfpo", 0x0a, INSTR_E }, 731 { "sam64", 0x0e, INSTR_E }, 732 #endif 733 { "pr", 0x01, INSTR_E }, 734 { "upt", 0x02, INSTR_E }, 735 { "sckpf", 0x07, INSTR_E }, 736 { "tam", 0x0b, INSTR_E }, 737 { "sam24", 0x0c, INSTR_E }, 738 { "sam31", 0x0d, INSTR_E }, 739 { "trap2", 0xff, INSTR_E }, 740 { "", 0, INSTR_INVALID } 741 }; 742 743 static struct s390_insn opcode_a5[] = { 744 #ifdef CONFIG_64BIT 745 { "iihh", 0x00, INSTR_RI_RU }, 746 { "iihl", 0x01, INSTR_RI_RU }, 747 { "iilh", 0x02, INSTR_RI_RU }, 748 { "iill", 0x03, INSTR_RI_RU }, 749 { "nihh", 0x04, INSTR_RI_RU }, 750 { "nihl", 0x05, INSTR_RI_RU }, 751 { "nilh", 0x06, INSTR_RI_RU }, 752 { "nill", 0x07, INSTR_RI_RU }, 753 { "oihh", 0x08, INSTR_RI_RU }, 754 { "oihl", 0x09, INSTR_RI_RU }, 755 { "oilh", 0x0a, INSTR_RI_RU }, 756 { "oill", 0x0b, INSTR_RI_RU }, 757 { "llihh", 0x0c, INSTR_RI_RU }, 758 { "llihl", 0x0d, INSTR_RI_RU }, 759 { "llilh", 0x0e, INSTR_RI_RU }, 760 { "llill", 0x0f, INSTR_RI_RU }, 761 #endif 762 { "", 0, INSTR_INVALID } 763 }; 764 765 static struct s390_insn opcode_a7[] = { 766 #ifdef CONFIG_64BIT 767 { "tmhh", 0x02, INSTR_RI_RU }, 768 { "tmhl", 0x03, INSTR_RI_RU }, 769 { "brctg", 0x07, INSTR_RI_RP }, 770 { "lghi", 0x09, INSTR_RI_RI }, 771 { "aghi", 0x0b, INSTR_RI_RI }, 772 { "mghi", 0x0d, INSTR_RI_RI }, 773 { "cghi", 0x0f, INSTR_RI_RI }, 774 #endif 775 { "tmlh", 0x00, INSTR_RI_RU }, 776 { "tmll", 0x01, INSTR_RI_RU }, 777 { "brc", 0x04, INSTR_RI_UP }, 778 { "bras", 0x05, INSTR_RI_RP }, 779 { "brct", 0x06, INSTR_RI_RP }, 780 { "lhi", 0x08, INSTR_RI_RI }, 781 { "ahi", 0x0a, INSTR_RI_RI }, 782 { "mhi", 0x0c, INSTR_RI_RI }, 783 { "chi", 0x0e, INSTR_RI_RI }, 784 { "", 0, INSTR_INVALID } 785 }; 786 787 static struct s390_insn opcode_aa[] = { 788 #ifdef CONFIG_64BIT 789 { { 0, LONG_INSN_RINEXT }, 0x00, INSTR_RI_RI }, 790 { "rion", 0x01, INSTR_RI_RI }, 791 { "tric", 0x02, INSTR_RI_RI }, 792 { "rioff", 0x03, INSTR_RI_RI }, 793 { { 0, LONG_INSN_RIEMIT }, 0x04, INSTR_RI_RI }, 794 #endif 795 { "", 0, INSTR_INVALID } 796 }; 797 798 static struct s390_insn opcode_b2[] = { 799 #ifdef CONFIG_64BIT 800 { "stckf", 0x7c, INSTR_S_RD }, 801 { "lpp", 0x80, INSTR_S_RD }, 802 { "lcctl", 0x84, INSTR_S_RD }, 803 { "lpctl", 0x85, INSTR_S_RD }, 804 { "qsi", 0x86, INSTR_S_RD }, 805 { "lsctl", 0x87, INSTR_S_RD }, 806 { "qctri", 0x8e, INSTR_S_RD }, 807 { "stfle", 0xb0, INSTR_S_RD }, 808 { "lpswe", 0xb2, INSTR_S_RD }, 809 { "srnmb", 0xb8, INSTR_S_RD }, 810 { "srnmt", 0xb9, INSTR_S_RD }, 811 { "lfas", 0xbd, INSTR_S_RD }, 812 { "scctr", 0xe0, INSTR_RRE_RR }, 813 { "spctr", 0xe1, INSTR_RRE_RR }, 814 { "ecctr", 0xe4, INSTR_RRE_RR }, 815 { "epctr", 0xe5, INSTR_RRE_RR }, 816 { "ppa", 0xe8, INSTR_RRF_U0RR }, 817 { "etnd", 0xec, INSTR_RRE_R0 }, 818 { "ecpga", 0xed, INSTR_RRE_RR }, 819 { "tend", 0xf8, INSTR_S_00 }, 820 { "niai", 0xfa, INSTR_IE_UU }, 821 { { 0, LONG_INSN_TABORT }, 0xfc, INSTR_S_RD }, 822 #endif 823 { "stidp", 0x02, INSTR_S_RD }, 824 { "sck", 0x04, INSTR_S_RD }, 825 { "stck", 0x05, INSTR_S_RD }, 826 { "sckc", 0x06, INSTR_S_RD }, 827 { "stckc", 0x07, INSTR_S_RD }, 828 { "spt", 0x08, INSTR_S_RD }, 829 { "stpt", 0x09, INSTR_S_RD }, 830 { "spka", 0x0a, INSTR_S_RD }, 831 { "ipk", 0x0b, INSTR_S_00 }, 832 { "ptlb", 0x0d, INSTR_S_00 }, 833 { "spx", 0x10, INSTR_S_RD }, 834 { "stpx", 0x11, INSTR_S_RD }, 835 { "stap", 0x12, INSTR_S_RD }, 836 { "sie", 0x14, INSTR_S_RD }, 837 { "pc", 0x18, INSTR_S_RD }, 838 { "sac", 0x19, INSTR_S_RD }, 839 { "cfc", 0x1a, INSTR_S_RD }, 840 { "servc", 0x20, INSTR_RRE_RR }, 841 { "ipte", 0x21, INSTR_RRE_RR }, 842 { "ipm", 0x22, INSTR_RRE_R0 }, 843 { "ivsk", 0x23, INSTR_RRE_RR }, 844 { "iac", 0x24, INSTR_RRE_R0 }, 845 { "ssar", 0x25, INSTR_RRE_R0 }, 846 { "epar", 0x26, INSTR_RRE_R0 }, 847 { "esar", 0x27, INSTR_RRE_R0 }, 848 { "pt", 0x28, INSTR_RRE_RR }, 849 { "iske", 0x29, INSTR_RRE_RR }, 850 { "rrbe", 0x2a, INSTR_RRE_RR }, 851 { "sske", 0x2b, INSTR_RRF_M0RR }, 852 { "tb", 0x2c, INSTR_RRE_0R }, 853 { "dxr", 0x2d, INSTR_RRE_FF }, 854 { "pgin", 0x2e, INSTR_RRE_RR }, 855 { "pgout", 0x2f, INSTR_RRE_RR }, 856 { "csch", 0x30, INSTR_S_00 }, 857 { "hsch", 0x31, INSTR_S_00 }, 858 { "msch", 0x32, INSTR_S_RD }, 859 { "ssch", 0x33, INSTR_S_RD }, 860 { "stsch", 0x34, INSTR_S_RD }, 861 { "tsch", 0x35, INSTR_S_RD }, 862 { "tpi", 0x36, INSTR_S_RD }, 863 { "sal", 0x37, INSTR_S_00 }, 864 { "rsch", 0x38, INSTR_S_00 }, 865 { "stcrw", 0x39, INSTR_S_RD }, 866 { "stcps", 0x3a, INSTR_S_RD }, 867 { "rchp", 0x3b, INSTR_S_00 }, 868 { "schm", 0x3c, INSTR_S_00 }, 869 { "bakr", 0x40, INSTR_RRE_RR }, 870 { "cksm", 0x41, INSTR_RRE_RR }, 871 { "sqdr", 0x44, INSTR_RRE_FF }, 872 { "sqer", 0x45, INSTR_RRE_FF }, 873 { "stura", 0x46, INSTR_RRE_RR }, 874 { "msta", 0x47, INSTR_RRE_R0 }, 875 { "palb", 0x48, INSTR_RRE_00 }, 876 { "ereg", 0x49, INSTR_RRE_RR }, 877 { "esta", 0x4a, INSTR_RRE_RR }, 878 { "lura", 0x4b, INSTR_RRE_RR }, 879 { "tar", 0x4c, INSTR_RRE_AR }, 880 { "cpya", 0x4d, INSTR_RRE_AA }, 881 { "sar", 0x4e, INSTR_RRE_AR }, 882 { "ear", 0x4f, INSTR_RRE_RA }, 883 { "csp", 0x50, INSTR_RRE_RR }, 884 { "msr", 0x52, INSTR_RRE_RR }, 885 { "mvpg", 0x54, INSTR_RRE_RR }, 886 { "mvst", 0x55, INSTR_RRE_RR }, 887 { "cuse", 0x57, INSTR_RRE_RR }, 888 { "bsg", 0x58, INSTR_RRE_RR }, 889 { "bsa", 0x5a, INSTR_RRE_RR }, 890 { "clst", 0x5d, INSTR_RRE_RR }, 891 { "srst", 0x5e, INSTR_RRE_RR }, 892 { "cmpsc", 0x63, INSTR_RRE_RR }, 893 { "siga", 0x74, INSTR_S_RD }, 894 { "xsch", 0x76, INSTR_S_00 }, 895 { "rp", 0x77, INSTR_S_RD }, 896 { "stcke", 0x78, INSTR_S_RD }, 897 { "sacf", 0x79, INSTR_S_RD }, 898 { "stsi", 0x7d, INSTR_S_RD }, 899 { "srnm", 0x99, INSTR_S_RD }, 900 { "stfpc", 0x9c, INSTR_S_RD }, 901 { "lfpc", 0x9d, INSTR_S_RD }, 902 { "tre", 0xa5, INSTR_RRE_RR }, 903 { "cuutf", 0xa6, INSTR_RRF_M0RR }, 904 { "cutfu", 0xa7, INSTR_RRF_M0RR }, 905 { "stfl", 0xb1, INSTR_S_RD }, 906 { "trap4", 0xff, INSTR_S_RD }, 907 { "", 0, INSTR_INVALID } 908 }; 909 910 static struct s390_insn opcode_b3[] = { 911 #ifdef CONFIG_64BIT 912 { "maylr", 0x38, INSTR_RRF_F0FF }, 913 { "mylr", 0x39, INSTR_RRF_F0FF }, 914 { "mayr", 0x3a, INSTR_RRF_F0FF }, 915 { "myr", 0x3b, INSTR_RRF_F0FF }, 916 { "mayhr", 0x3c, INSTR_RRF_F0FF }, 917 { "myhr", 0x3d, INSTR_RRF_F0FF }, 918 { "lpdfr", 0x70, INSTR_RRE_FF }, 919 { "lndfr", 0x71, INSTR_RRE_FF }, 920 { "cpsdr", 0x72, INSTR_RRF_F0FF2 }, 921 { "lcdfr", 0x73, INSTR_RRE_FF }, 922 { "sfasr", 0x85, INSTR_RRE_R0 }, 923 { { 0, LONG_INSN_CELFBR }, 0x90, INSTR_RRF_UUFR }, 924 { { 0, LONG_INSN_CDLFBR }, 0x91, INSTR_RRF_UUFR }, 925 { { 0, LONG_INSN_CXLFBR }, 0x92, INSTR_RRF_UURF }, 926 { { 0, LONG_INSN_CEFBRA }, 0x94, INSTR_RRF_UUFR }, 927 { { 0, LONG_INSN_CDFBRA }, 0x95, INSTR_RRF_UUFR }, 928 { { 0, LONG_INSN_CXFBRA }, 0x96, INSTR_RRF_UURF }, 929 { { 0, LONG_INSN_CFEBRA }, 0x98, INSTR_RRF_UURF }, 930 { { 0, LONG_INSN_CFDBRA }, 0x99, INSTR_RRF_UURF }, 931 { { 0, LONG_INSN_CFXBRA }, 0x9a, INSTR_RRF_UUFR }, 932 { { 0, LONG_INSN_CLFEBR }, 0x9c, INSTR_RRF_UURF }, 933 { { 0, LONG_INSN_CLFDBR }, 0x9d, INSTR_RRF_UURF }, 934 { { 0, LONG_INSN_CLFXBR }, 0x9e, INSTR_RRF_UUFR }, 935 { { 0, LONG_INSN_CELGBR }, 0xa0, INSTR_RRF_UUFR }, 936 { { 0, LONG_INSN_CDLGBR }, 0xa1, INSTR_RRF_UUFR }, 937 { { 0, LONG_INSN_CXLGBR }, 0xa2, INSTR_RRF_UURF }, 938 { { 0, LONG_INSN_CEGBRA }, 0xa4, INSTR_RRF_UUFR }, 939 { { 0, LONG_INSN_CDGBRA }, 0xa5, INSTR_RRF_UUFR }, 940 { { 0, LONG_INSN_CXGBRA }, 0xa6, INSTR_RRF_UURF }, 941 { { 0, LONG_INSN_CGEBRA }, 0xa8, INSTR_RRF_UURF }, 942 { { 0, LONG_INSN_CGDBRA }, 0xa9, INSTR_RRF_UURF }, 943 { { 0, LONG_INSN_CGXBRA }, 0xaa, INSTR_RRF_UUFR }, 944 { { 0, LONG_INSN_CLGEBR }, 0xac, INSTR_RRF_UURF }, 945 { { 0, LONG_INSN_CLGDBR }, 0xad, INSTR_RRF_UURF }, 946 { { 0, LONG_INSN_CLGXBR }, 0xae, INSTR_RRF_UUFR }, 947 { "ldgr", 0xc1, INSTR_RRE_FR }, 948 { "cegr", 0xc4, INSTR_RRE_FR }, 949 { "cdgr", 0xc5, INSTR_RRE_FR }, 950 { "cxgr", 0xc6, INSTR_RRE_FR }, 951 { "cger", 0xc8, INSTR_RRF_U0RF }, 952 { "cgdr", 0xc9, INSTR_RRF_U0RF }, 953 { "cgxr", 0xca, INSTR_RRF_U0RF }, 954 { "lgdr", 0xcd, INSTR_RRE_RF }, 955 { "mdtra", 0xd0, INSTR_RRF_FUFF2 }, 956 { "ddtra", 0xd1, INSTR_RRF_FUFF2 }, 957 { "adtra", 0xd2, INSTR_RRF_FUFF2 }, 958 { "sdtra", 0xd3, INSTR_RRF_FUFF2 }, 959 { "ldetr", 0xd4, INSTR_RRF_0UFF }, 960 { "ledtr", 0xd5, INSTR_RRF_UUFF }, 961 { "ltdtr", 0xd6, INSTR_RRE_FF }, 962 { "fidtr", 0xd7, INSTR_RRF_UUFF }, 963 { "mxtra", 0xd8, INSTR_RRF_FUFF2 }, 964 { "dxtra", 0xd9, INSTR_RRF_FUFF2 }, 965 { "axtra", 0xda, INSTR_RRF_FUFF2 }, 966 { "sxtra", 0xdb, INSTR_RRF_FUFF2 }, 967 { "lxdtr", 0xdc, INSTR_RRF_0UFF }, 968 { "ldxtr", 0xdd, INSTR_RRF_UUFF }, 969 { "ltxtr", 0xde, INSTR_RRE_FF }, 970 { "fixtr", 0xdf, INSTR_RRF_UUFF }, 971 { "kdtr", 0xe0, INSTR_RRE_FF }, 972 { { 0, LONG_INSN_CGDTRA }, 0xe1, INSTR_RRF_UURF }, 973 { "cudtr", 0xe2, INSTR_RRE_RF }, 974 { "csdtr", 0xe3, INSTR_RRE_RF }, 975 { "cdtr", 0xe4, INSTR_RRE_FF }, 976 { "eedtr", 0xe5, INSTR_RRE_RF }, 977 { "esdtr", 0xe7, INSTR_RRE_RF }, 978 { "kxtr", 0xe8, INSTR_RRE_FF }, 979 { { 0, LONG_INSN_CGXTRA }, 0xe9, INSTR_RRF_UUFR }, 980 { "cuxtr", 0xea, INSTR_RRE_RF }, 981 { "csxtr", 0xeb, INSTR_RRE_RF }, 982 { "cxtr", 0xec, INSTR_RRE_FF }, 983 { "eextr", 0xed, INSTR_RRE_RF }, 984 { "esxtr", 0xef, INSTR_RRE_RF }, 985 { { 0, LONG_INSN_CDGTRA }, 0xf1, INSTR_RRF_UUFR }, 986 { "cdutr", 0xf2, INSTR_RRE_FR }, 987 { "cdstr", 0xf3, INSTR_RRE_FR }, 988 { "cedtr", 0xf4, INSTR_RRE_FF }, 989 { "qadtr", 0xf5, INSTR_RRF_FUFF }, 990 { "iedtr", 0xf6, INSTR_RRF_F0FR }, 991 { "rrdtr", 0xf7, INSTR_RRF_FFRU }, 992 { { 0, LONG_INSN_CXGTRA }, 0xf9, INSTR_RRF_UURF }, 993 { "cxutr", 0xfa, INSTR_RRE_FR }, 994 { "cxstr", 0xfb, INSTR_RRE_FR }, 995 { "cextr", 0xfc, INSTR_RRE_FF }, 996 { "qaxtr", 0xfd, INSTR_RRF_FUFF }, 997 { "iextr", 0xfe, INSTR_RRF_F0FR }, 998 { "rrxtr", 0xff, INSTR_RRF_FFRU }, 999 #endif 1000 { "lpebr", 0x00, INSTR_RRE_FF }, 1001 { "lnebr", 0x01, INSTR_RRE_FF }, 1002 { "ltebr", 0x02, INSTR_RRE_FF }, 1003 { "lcebr", 0x03, INSTR_RRE_FF }, 1004 { "ldebr", 0x04, INSTR_RRE_FF }, 1005 { "lxdbr", 0x05, INSTR_RRE_FF }, 1006 { "lxebr", 0x06, INSTR_RRE_FF }, 1007 { "mxdbr", 0x07, INSTR_RRE_FF }, 1008 { "kebr", 0x08, INSTR_RRE_FF }, 1009 { "cebr", 0x09, INSTR_RRE_FF }, 1010 { "aebr", 0x0a, INSTR_RRE_FF }, 1011 { "sebr", 0x0b, INSTR_RRE_FF }, 1012 { "mdebr", 0x0c, INSTR_RRE_FF }, 1013 { "debr", 0x0d, INSTR_RRE_FF }, 1014 { "maebr", 0x0e, INSTR_RRF_F0FF }, 1015 { "msebr", 0x0f, INSTR_RRF_F0FF }, 1016 { "lpdbr", 0x10, INSTR_RRE_FF }, 1017 { "lndbr", 0x11, INSTR_RRE_FF }, 1018 { "ltdbr", 0x12, INSTR_RRE_FF }, 1019 { "lcdbr", 0x13, INSTR_RRE_FF }, 1020 { "sqebr", 0x14, INSTR_RRE_FF }, 1021 { "sqdbr", 0x15, INSTR_RRE_FF }, 1022 { "sqxbr", 0x16, INSTR_RRE_FF }, 1023 { "meebr", 0x17, INSTR_RRE_FF }, 1024 { "kdbr", 0x18, INSTR_RRE_FF }, 1025 { "cdbr", 0x19, INSTR_RRE_FF }, 1026 { "adbr", 0x1a, INSTR_RRE_FF }, 1027 { "sdbr", 0x1b, INSTR_RRE_FF }, 1028 { "mdbr", 0x1c, INSTR_RRE_FF }, 1029 { "ddbr", 0x1d, INSTR_RRE_FF }, 1030 { "madbr", 0x1e, INSTR_RRF_F0FF }, 1031 { "msdbr", 0x1f, INSTR_RRF_F0FF }, 1032 { "lder", 0x24, INSTR_RRE_FF }, 1033 { "lxdr", 0x25, INSTR_RRE_FF }, 1034 { "lxer", 0x26, INSTR_RRE_FF }, 1035 { "maer", 0x2e, INSTR_RRF_F0FF }, 1036 { "mser", 0x2f, INSTR_RRF_F0FF }, 1037 { "sqxr", 0x36, INSTR_RRE_FF }, 1038 { "meer", 0x37, INSTR_RRE_FF }, 1039 { "madr", 0x3e, INSTR_RRF_F0FF }, 1040 { "msdr", 0x3f, INSTR_RRF_F0FF }, 1041 { "lpxbr", 0x40, INSTR_RRE_FF }, 1042 { "lnxbr", 0x41, INSTR_RRE_FF }, 1043 { "ltxbr", 0x42, INSTR_RRE_FF }, 1044 { "lcxbr", 0x43, INSTR_RRE_FF }, 1045 { { 0, LONG_INSN_LEDBRA }, 0x44, INSTR_RRF_UUFF }, 1046 { { 0, LONG_INSN_LDXBRA }, 0x45, INSTR_RRF_UUFF }, 1047 { { 0, LONG_INSN_LEXBRA }, 0x46, INSTR_RRF_UUFF }, 1048 { { 0, LONG_INSN_FIXBRA }, 0x47, INSTR_RRF_UUFF }, 1049 { "kxbr", 0x48, INSTR_RRE_FF }, 1050 { "cxbr", 0x49, INSTR_RRE_FF }, 1051 { "axbr", 0x4a, INSTR_RRE_FF }, 1052 { "sxbr", 0x4b, INSTR_RRE_FF }, 1053 { "mxbr", 0x4c, INSTR_RRE_FF }, 1054 { "dxbr", 0x4d, INSTR_RRE_FF }, 1055 { "tbedr", 0x50, INSTR_RRF_U0FF }, 1056 { "tbdr", 0x51, INSTR_RRF_U0FF }, 1057 { "diebr", 0x53, INSTR_RRF_FUFF }, 1058 { { 0, LONG_INSN_FIEBRA }, 0x57, INSTR_RRF_UUFF }, 1059 { "thder", 0x58, INSTR_RRE_FF }, 1060 { "thdr", 0x59, INSTR_RRE_FF }, 1061 { "didbr", 0x5b, INSTR_RRF_FUFF }, 1062 { { 0, LONG_INSN_FIDBRA }, 0x5f, INSTR_RRF_UUFF }, 1063 { "lpxr", 0x60, INSTR_RRE_FF }, 1064 { "lnxr", 0x61, INSTR_RRE_FF }, 1065 { "ltxr", 0x62, INSTR_RRE_FF }, 1066 { "lcxr", 0x63, INSTR_RRE_FF }, 1067 { "lxr", 0x65, INSTR_RRE_FF }, 1068 { "lexr", 0x66, INSTR_RRE_FF }, 1069 { "fixr", 0x67, INSTR_RRE_FF }, 1070 { "cxr", 0x69, INSTR_RRE_FF }, 1071 { "lzer", 0x74, INSTR_RRE_F0 }, 1072 { "lzdr", 0x75, INSTR_RRE_F0 }, 1073 { "lzxr", 0x76, INSTR_RRE_F0 }, 1074 { "fier", 0x77, INSTR_RRE_FF }, 1075 { "fidr", 0x7f, INSTR_RRE_FF }, 1076 { "sfpc", 0x84, INSTR_RRE_RR_OPT }, 1077 { "efpc", 0x8c, INSTR_RRE_RR_OPT }, 1078 { "cefbr", 0x94, INSTR_RRE_RF }, 1079 { "cdfbr", 0x95, INSTR_RRE_RF }, 1080 { "cxfbr", 0x96, INSTR_RRE_RF }, 1081 { "cfebr", 0x98, INSTR_RRF_U0RF }, 1082 { "cfdbr", 0x99, INSTR_RRF_U0RF }, 1083 { "cfxbr", 0x9a, INSTR_RRF_U0RF }, 1084 { "cefr", 0xb4, INSTR_RRE_FR }, 1085 { "cdfr", 0xb5, INSTR_RRE_FR }, 1086 { "cxfr", 0xb6, INSTR_RRE_FR }, 1087 { "cfer", 0xb8, INSTR_RRF_U0RF }, 1088 { "cfdr", 0xb9, INSTR_RRF_U0RF }, 1089 { "cfxr", 0xba, INSTR_RRF_U0RF }, 1090 { "", 0, INSTR_INVALID } 1091 }; 1092 1093 static struct s390_insn opcode_b9[] = { 1094 #ifdef CONFIG_64BIT 1095 { "lpgr", 0x00, INSTR_RRE_RR }, 1096 { "lngr", 0x01, INSTR_RRE_RR }, 1097 { "ltgr", 0x02, INSTR_RRE_RR }, 1098 { "lcgr", 0x03, INSTR_RRE_RR }, 1099 { "lgr", 0x04, INSTR_RRE_RR }, 1100 { "lurag", 0x05, INSTR_RRE_RR }, 1101 { "lgbr", 0x06, INSTR_RRE_RR }, 1102 { "lghr", 0x07, INSTR_RRE_RR }, 1103 { "agr", 0x08, INSTR_RRE_RR }, 1104 { "sgr", 0x09, INSTR_RRE_RR }, 1105 { "algr", 0x0a, INSTR_RRE_RR }, 1106 { "slgr", 0x0b, INSTR_RRE_RR }, 1107 { "msgr", 0x0c, INSTR_RRE_RR }, 1108 { "dsgr", 0x0d, INSTR_RRE_RR }, 1109 { "eregg", 0x0e, INSTR_RRE_RR }, 1110 { "lrvgr", 0x0f, INSTR_RRE_RR }, 1111 { "lpgfr", 0x10, INSTR_RRE_RR }, 1112 { "lngfr", 0x11, INSTR_RRE_RR }, 1113 { "ltgfr", 0x12, INSTR_RRE_RR }, 1114 { "lcgfr", 0x13, INSTR_RRE_RR }, 1115 { "lgfr", 0x14, INSTR_RRE_RR }, 1116 { "llgfr", 0x16, INSTR_RRE_RR }, 1117 { "llgtr", 0x17, INSTR_RRE_RR }, 1118 { "agfr", 0x18, INSTR_RRE_RR }, 1119 { "sgfr", 0x19, INSTR_RRE_RR }, 1120 { "algfr", 0x1a, INSTR_RRE_RR }, 1121 { "slgfr", 0x1b, INSTR_RRE_RR }, 1122 { "msgfr", 0x1c, INSTR_RRE_RR }, 1123 { "dsgfr", 0x1d, INSTR_RRE_RR }, 1124 { "cgr", 0x20, INSTR_RRE_RR }, 1125 { "clgr", 0x21, INSTR_RRE_RR }, 1126 { "sturg", 0x25, INSTR_RRE_RR }, 1127 { "lbr", 0x26, INSTR_RRE_RR }, 1128 { "lhr", 0x27, INSTR_RRE_RR }, 1129 { "cgfr", 0x30, INSTR_RRE_RR }, 1130 { "clgfr", 0x31, INSTR_RRE_RR }, 1131 { "cfdtr", 0x41, INSTR_RRF_UURF }, 1132 { { 0, LONG_INSN_CLGDTR }, 0x42, INSTR_RRF_UURF }, 1133 { { 0, LONG_INSN_CLFDTR }, 0x43, INSTR_RRF_UURF }, 1134 { "bctgr", 0x46, INSTR_RRE_RR }, 1135 { "cfxtr", 0x49, INSTR_RRF_UURF }, 1136 { { 0, LONG_INSN_CLGXTR }, 0x4a, INSTR_RRF_UUFR }, 1137 { { 0, LONG_INSN_CLFXTR }, 0x4b, INSTR_RRF_UUFR }, 1138 { "cdftr", 0x51, INSTR_RRF_UUFR }, 1139 { { 0, LONG_INSN_CDLGTR }, 0x52, INSTR_RRF_UUFR }, 1140 { { 0, LONG_INSN_CDLFTR }, 0x53, INSTR_RRF_UUFR }, 1141 { "cxftr", 0x59, INSTR_RRF_UURF }, 1142 { { 0, LONG_INSN_CXLGTR }, 0x5a, INSTR_RRF_UURF }, 1143 { { 0, LONG_INSN_CXLFTR }, 0x5b, INSTR_RRF_UUFR }, 1144 { "cgrt", 0x60, INSTR_RRF_U0RR }, 1145 { "clgrt", 0x61, INSTR_RRF_U0RR }, 1146 { "crt", 0x72, INSTR_RRF_U0RR }, 1147 { "clrt", 0x73, INSTR_RRF_U0RR }, 1148 { "ngr", 0x80, INSTR_RRE_RR }, 1149 { "ogr", 0x81, INSTR_RRE_RR }, 1150 { "xgr", 0x82, INSTR_RRE_RR }, 1151 { "flogr", 0x83, INSTR_RRE_RR }, 1152 { "llgcr", 0x84, INSTR_RRE_RR }, 1153 { "llghr", 0x85, INSTR_RRE_RR }, 1154 { "mlgr", 0x86, INSTR_RRE_RR }, 1155 { "dlgr", 0x87, INSTR_RRE_RR }, 1156 { "alcgr", 0x88, INSTR_RRE_RR }, 1157 { "slbgr", 0x89, INSTR_RRE_RR }, 1158 { "cspg", 0x8a, INSTR_RRE_RR }, 1159 { "idte", 0x8e, INSTR_RRF_R0RR }, 1160 { "crdte", 0x8f, INSTR_RRF_RMRR }, 1161 { "llcr", 0x94, INSTR_RRE_RR }, 1162 { "llhr", 0x95, INSTR_RRE_RR }, 1163 { "esea", 0x9d, INSTR_RRE_R0 }, 1164 { "ptf", 0xa2, INSTR_RRE_R0 }, 1165 { "lptea", 0xaa, INSTR_RRF_RURR }, 1166 { "rrbm", 0xae, INSTR_RRE_RR }, 1167 { "pfmf", 0xaf, INSTR_RRE_RR }, 1168 { "cu14", 0xb0, INSTR_RRF_M0RR }, 1169 { "cu24", 0xb1, INSTR_RRF_M0RR }, 1170 { "cu41", 0xb2, INSTR_RRE_RR }, 1171 { "cu42", 0xb3, INSTR_RRE_RR }, 1172 { "trtre", 0xbd, INSTR_RRF_M0RR }, 1173 { "srstu", 0xbe, INSTR_RRE_RR }, 1174 { "trte", 0xbf, INSTR_RRF_M0RR }, 1175 { "ahhhr", 0xc8, INSTR_RRF_R0RR2 }, 1176 { "shhhr", 0xc9, INSTR_RRF_R0RR2 }, 1177 { { 0, LONG_INSN_ALHHHR }, 0xca, INSTR_RRF_R0RR2 }, 1178 { { 0, LONG_INSN_SLHHHR }, 0xcb, INSTR_RRF_R0RR2 }, 1179 { "chhr", 0xcd, INSTR_RRE_RR }, 1180 { "clhhr", 0xcf, INSTR_RRE_RR }, 1181 { { 0, LONG_INSN_PCISTG }, 0xd0, INSTR_RRE_RR }, 1182 { "pcilg", 0xd2, INSTR_RRE_RR }, 1183 { "rpcit", 0xd3, INSTR_RRE_RR }, 1184 { "ahhlr", 0xd8, INSTR_RRF_R0RR2 }, 1185 { "shhlr", 0xd9, INSTR_RRF_R0RR2 }, 1186 { { 0, LONG_INSN_ALHHLR }, 0xda, INSTR_RRF_R0RR2 }, 1187 { { 0, LONG_INSN_SLHHLR }, 0xdb, INSTR_RRF_R0RR2 }, 1188 { "chlr", 0xdd, INSTR_RRE_RR }, 1189 { "clhlr", 0xdf, INSTR_RRE_RR }, 1190 { { 0, LONG_INSN_POPCNT }, 0xe1, INSTR_RRE_RR }, 1191 { "locgr", 0xe2, INSTR_RRF_M0RR }, 1192 { "ngrk", 0xe4, INSTR_RRF_R0RR2 }, 1193 { "ogrk", 0xe6, INSTR_RRF_R0RR2 }, 1194 { "xgrk", 0xe7, INSTR_RRF_R0RR2 }, 1195 { "agrk", 0xe8, INSTR_RRF_R0RR2 }, 1196 { "sgrk", 0xe9, INSTR_RRF_R0RR2 }, 1197 { "algrk", 0xea, INSTR_RRF_R0RR2 }, 1198 { "slgrk", 0xeb, INSTR_RRF_R0RR2 }, 1199 { "locr", 0xf2, INSTR_RRF_M0RR }, 1200 { "nrk", 0xf4, INSTR_RRF_R0RR2 }, 1201 { "ork", 0xf6, INSTR_RRF_R0RR2 }, 1202 { "xrk", 0xf7, INSTR_RRF_R0RR2 }, 1203 { "ark", 0xf8, INSTR_RRF_R0RR2 }, 1204 { "srk", 0xf9, INSTR_RRF_R0RR2 }, 1205 { "alrk", 0xfa, INSTR_RRF_R0RR2 }, 1206 { "slrk", 0xfb, INSTR_RRF_R0RR2 }, 1207 #endif 1208 { "kmac", 0x1e, INSTR_RRE_RR }, 1209 { "lrvr", 0x1f, INSTR_RRE_RR }, 1210 { "km", 0x2e, INSTR_RRE_RR }, 1211 { "kmc", 0x2f, INSTR_RRE_RR }, 1212 { "kimd", 0x3e, INSTR_RRE_RR }, 1213 { "klmd", 0x3f, INSTR_RRE_RR }, 1214 { "epsw", 0x8d, INSTR_RRE_RR }, 1215 { "trtt", 0x90, INSTR_RRF_M0RR }, 1216 { "trto", 0x91, INSTR_RRF_M0RR }, 1217 { "trot", 0x92, INSTR_RRF_M0RR }, 1218 { "troo", 0x93, INSTR_RRF_M0RR }, 1219 { "mlr", 0x96, INSTR_RRE_RR }, 1220 { "dlr", 0x97, INSTR_RRE_RR }, 1221 { "alcr", 0x98, INSTR_RRE_RR }, 1222 { "slbr", 0x99, INSTR_RRE_RR }, 1223 { "", 0, INSTR_INVALID } 1224 }; 1225 1226 static struct s390_insn opcode_c0[] = { 1227 #ifdef CONFIG_64BIT 1228 { "lgfi", 0x01, INSTR_RIL_RI }, 1229 { "xihf", 0x06, INSTR_RIL_RU }, 1230 { "xilf", 0x07, INSTR_RIL_RU }, 1231 { "iihf", 0x08, INSTR_RIL_RU }, 1232 { "iilf", 0x09, INSTR_RIL_RU }, 1233 { "nihf", 0x0a, INSTR_RIL_RU }, 1234 { "nilf", 0x0b, INSTR_RIL_RU }, 1235 { "oihf", 0x0c, INSTR_RIL_RU }, 1236 { "oilf", 0x0d, INSTR_RIL_RU }, 1237 { "llihf", 0x0e, INSTR_RIL_RU }, 1238 { "llilf", 0x0f, INSTR_RIL_RU }, 1239 #endif 1240 { "larl", 0x00, INSTR_RIL_RP }, 1241 { "brcl", 0x04, INSTR_RIL_UP }, 1242 { "brasl", 0x05, INSTR_RIL_RP }, 1243 { "", 0, INSTR_INVALID } 1244 }; 1245 1246 static struct s390_insn opcode_c2[] = { 1247 #ifdef CONFIG_64BIT 1248 { "msgfi", 0x00, INSTR_RIL_RI }, 1249 { "msfi", 0x01, INSTR_RIL_RI }, 1250 { "slgfi", 0x04, INSTR_RIL_RU }, 1251 { "slfi", 0x05, INSTR_RIL_RU }, 1252 { "agfi", 0x08, INSTR_RIL_RI }, 1253 { "afi", 0x09, INSTR_RIL_RI }, 1254 { "algfi", 0x0a, INSTR_RIL_RU }, 1255 { "alfi", 0x0b, INSTR_RIL_RU }, 1256 { "cgfi", 0x0c, INSTR_RIL_RI }, 1257 { "cfi", 0x0d, INSTR_RIL_RI }, 1258 { "clgfi", 0x0e, INSTR_RIL_RU }, 1259 { "clfi", 0x0f, INSTR_RIL_RU }, 1260 #endif 1261 { "", 0, INSTR_INVALID } 1262 }; 1263 1264 static struct s390_insn opcode_c4[] = { 1265 #ifdef CONFIG_64BIT 1266 { "llhrl", 0x02, INSTR_RIL_RP }, 1267 { "lghrl", 0x04, INSTR_RIL_RP }, 1268 { "lhrl", 0x05, INSTR_RIL_RP }, 1269 { { 0, LONG_INSN_LLGHRL }, 0x06, INSTR_RIL_RP }, 1270 { "sthrl", 0x07, INSTR_RIL_RP }, 1271 { "lgrl", 0x08, INSTR_RIL_RP }, 1272 { "stgrl", 0x0b, INSTR_RIL_RP }, 1273 { "lgfrl", 0x0c, INSTR_RIL_RP }, 1274 { "lrl", 0x0d, INSTR_RIL_RP }, 1275 { { 0, LONG_INSN_LLGFRL }, 0x0e, INSTR_RIL_RP }, 1276 { "strl", 0x0f, INSTR_RIL_RP }, 1277 #endif 1278 { "", 0, INSTR_INVALID } 1279 }; 1280 1281 static struct s390_insn opcode_c6[] = { 1282 #ifdef CONFIG_64BIT 1283 { "exrl", 0x00, INSTR_RIL_RP }, 1284 { "pfdrl", 0x02, INSTR_RIL_UP }, 1285 { "cghrl", 0x04, INSTR_RIL_RP }, 1286 { "chrl", 0x05, INSTR_RIL_RP }, 1287 { { 0, LONG_INSN_CLGHRL }, 0x06, INSTR_RIL_RP }, 1288 { "clhrl", 0x07, INSTR_RIL_RP }, 1289 { "cgrl", 0x08, INSTR_RIL_RP }, 1290 { "clgrl", 0x0a, INSTR_RIL_RP }, 1291 { "cgfrl", 0x0c, INSTR_RIL_RP }, 1292 { "crl", 0x0d, INSTR_RIL_RP }, 1293 { { 0, LONG_INSN_CLGFRL }, 0x0e, INSTR_RIL_RP }, 1294 { "clrl", 0x0f, INSTR_RIL_RP }, 1295 #endif 1296 { "", 0, INSTR_INVALID } 1297 }; 1298 1299 static struct s390_insn opcode_c8[] = { 1300 #ifdef CONFIG_64BIT 1301 { "mvcos", 0x00, INSTR_SSF_RRDRD }, 1302 { "ectg", 0x01, INSTR_SSF_RRDRD }, 1303 { "csst", 0x02, INSTR_SSF_RRDRD }, 1304 { "lpd", 0x04, INSTR_SSF_RRDRD2 }, 1305 { "lpdg", 0x05, INSTR_SSF_RRDRD2 }, 1306 #endif 1307 { "", 0, INSTR_INVALID } 1308 }; 1309 1310 static struct s390_insn opcode_cc[] = { 1311 #ifdef CONFIG_64BIT 1312 { "brcth", 0x06, INSTR_RIL_RP }, 1313 { "aih", 0x08, INSTR_RIL_RI }, 1314 { "alsih", 0x0a, INSTR_RIL_RI }, 1315 { { 0, LONG_INSN_ALSIHN }, 0x0b, INSTR_RIL_RI }, 1316 { "cih", 0x0d, INSTR_RIL_RI }, 1317 { "clih", 0x0f, INSTR_RIL_RI }, 1318 #endif 1319 { "", 0, INSTR_INVALID } 1320 }; 1321 1322 static struct s390_insn opcode_e3[] = { 1323 #ifdef CONFIG_64BIT 1324 { "ltg", 0x02, INSTR_RXY_RRRD }, 1325 { "lrag", 0x03, INSTR_RXY_RRRD }, 1326 { "lg", 0x04, INSTR_RXY_RRRD }, 1327 { "cvby", 0x06, INSTR_RXY_RRRD }, 1328 { "ag", 0x08, INSTR_RXY_RRRD }, 1329 { "sg", 0x09, INSTR_RXY_RRRD }, 1330 { "alg", 0x0a, INSTR_RXY_RRRD }, 1331 { "slg", 0x0b, INSTR_RXY_RRRD }, 1332 { "msg", 0x0c, INSTR_RXY_RRRD }, 1333 { "dsg", 0x0d, INSTR_RXY_RRRD }, 1334 { "cvbg", 0x0e, INSTR_RXY_RRRD }, 1335 { "lrvg", 0x0f, INSTR_RXY_RRRD }, 1336 { "lt", 0x12, INSTR_RXY_RRRD }, 1337 { "lray", 0x13, INSTR_RXY_RRRD }, 1338 { "lgf", 0x14, INSTR_RXY_RRRD }, 1339 { "lgh", 0x15, INSTR_RXY_RRRD }, 1340 { "llgf", 0x16, INSTR_RXY_RRRD }, 1341 { "llgt", 0x17, INSTR_RXY_RRRD }, 1342 { "agf", 0x18, INSTR_RXY_RRRD }, 1343 { "sgf", 0x19, INSTR_RXY_RRRD }, 1344 { "algf", 0x1a, INSTR_RXY_RRRD }, 1345 { "slgf", 0x1b, INSTR_RXY_RRRD }, 1346 { "msgf", 0x1c, INSTR_RXY_RRRD }, 1347 { "dsgf", 0x1d, INSTR_RXY_RRRD }, 1348 { "cg", 0x20, INSTR_RXY_RRRD }, 1349 { "clg", 0x21, INSTR_RXY_RRRD }, 1350 { "stg", 0x24, INSTR_RXY_RRRD }, 1351 { "ntstg", 0x25, INSTR_RXY_RRRD }, 1352 { "cvdy", 0x26, INSTR_RXY_RRRD }, 1353 { "cvdg", 0x2e, INSTR_RXY_RRRD }, 1354 { "strvg", 0x2f, INSTR_RXY_RRRD }, 1355 { "cgf", 0x30, INSTR_RXY_RRRD }, 1356 { "clgf", 0x31, INSTR_RXY_RRRD }, 1357 { "ltgf", 0x32, INSTR_RXY_RRRD }, 1358 { "cgh", 0x34, INSTR_RXY_RRRD }, 1359 { "pfd", 0x36, INSTR_RXY_URRD }, 1360 { "strvh", 0x3f, INSTR_RXY_RRRD }, 1361 { "bctg", 0x46, INSTR_RXY_RRRD }, 1362 { "sty", 0x50, INSTR_RXY_RRRD }, 1363 { "msy", 0x51, INSTR_RXY_RRRD }, 1364 { "ny", 0x54, INSTR_RXY_RRRD }, 1365 { "cly", 0x55, INSTR_RXY_RRRD }, 1366 { "oy", 0x56, INSTR_RXY_RRRD }, 1367 { "xy", 0x57, INSTR_RXY_RRRD }, 1368 { "ly", 0x58, INSTR_RXY_RRRD }, 1369 { "cy", 0x59, INSTR_RXY_RRRD }, 1370 { "ay", 0x5a, INSTR_RXY_RRRD }, 1371 { "sy", 0x5b, INSTR_RXY_RRRD }, 1372 { "mfy", 0x5c, INSTR_RXY_RRRD }, 1373 { "aly", 0x5e, INSTR_RXY_RRRD }, 1374 { "sly", 0x5f, INSTR_RXY_RRRD }, 1375 { "sthy", 0x70, INSTR_RXY_RRRD }, 1376 { "lay", 0x71, INSTR_RXY_RRRD }, 1377 { "stcy", 0x72, INSTR_RXY_RRRD }, 1378 { "icy", 0x73, INSTR_RXY_RRRD }, 1379 { "laey", 0x75, INSTR_RXY_RRRD }, 1380 { "lb", 0x76, INSTR_RXY_RRRD }, 1381 { "lgb", 0x77, INSTR_RXY_RRRD }, 1382 { "lhy", 0x78, INSTR_RXY_RRRD }, 1383 { "chy", 0x79, INSTR_RXY_RRRD }, 1384 { "ahy", 0x7a, INSTR_RXY_RRRD }, 1385 { "shy", 0x7b, INSTR_RXY_RRRD }, 1386 { "mhy", 0x7c, INSTR_RXY_RRRD }, 1387 { "ng", 0x80, INSTR_RXY_RRRD }, 1388 { "og", 0x81, INSTR_RXY_RRRD }, 1389 { "xg", 0x82, INSTR_RXY_RRRD }, 1390 { "lgat", 0x85, INSTR_RXY_RRRD }, 1391 { "mlg", 0x86, INSTR_RXY_RRRD }, 1392 { "dlg", 0x87, INSTR_RXY_RRRD }, 1393 { "alcg", 0x88, INSTR_RXY_RRRD }, 1394 { "slbg", 0x89, INSTR_RXY_RRRD }, 1395 { "stpq", 0x8e, INSTR_RXY_RRRD }, 1396 { "lpq", 0x8f, INSTR_RXY_RRRD }, 1397 { "llgc", 0x90, INSTR_RXY_RRRD }, 1398 { "llgh", 0x91, INSTR_RXY_RRRD }, 1399 { "llc", 0x94, INSTR_RXY_RRRD }, 1400 { "llh", 0x95, INSTR_RXY_RRRD }, 1401 { { 0, LONG_INSN_LLGTAT }, 0x9c, INSTR_RXY_RRRD }, 1402 { { 0, LONG_INSN_LLGFAT }, 0x9d, INSTR_RXY_RRRD }, 1403 { "lat", 0x9f, INSTR_RXY_RRRD }, 1404 { "lbh", 0xc0, INSTR_RXY_RRRD }, 1405 { "llch", 0xc2, INSTR_RXY_RRRD }, 1406 { "stch", 0xc3, INSTR_RXY_RRRD }, 1407 { "lhh", 0xc4, INSTR_RXY_RRRD }, 1408 { "llhh", 0xc6, INSTR_RXY_RRRD }, 1409 { "sthh", 0xc7, INSTR_RXY_RRRD }, 1410 { "lfhat", 0xc8, INSTR_RXY_RRRD }, 1411 { "lfh", 0xca, INSTR_RXY_RRRD }, 1412 { "stfh", 0xcb, INSTR_RXY_RRRD }, 1413 { "chf", 0xcd, INSTR_RXY_RRRD }, 1414 { "clhf", 0xcf, INSTR_RXY_RRRD }, 1415 { { 0, LONG_INSN_MPCIFC }, 0xd0, INSTR_RXY_RRRD }, 1416 { { 0, LONG_INSN_STPCIFC }, 0xd4, INSTR_RXY_RRRD }, 1417 #endif 1418 { "lrv", 0x1e, INSTR_RXY_RRRD }, 1419 { "lrvh", 0x1f, INSTR_RXY_RRRD }, 1420 { "strv", 0x3e, INSTR_RXY_RRRD }, 1421 { "ml", 0x96, INSTR_RXY_RRRD }, 1422 { "dl", 0x97, INSTR_RXY_RRRD }, 1423 { "alc", 0x98, INSTR_RXY_RRRD }, 1424 { "slb", 0x99, INSTR_RXY_RRRD }, 1425 { "", 0, INSTR_INVALID } 1426 }; 1427 1428 static struct s390_insn opcode_e5[] = { 1429 #ifdef CONFIG_64BIT 1430 { "strag", 0x02, INSTR_SSE_RDRD }, 1431 { "mvhhi", 0x44, INSTR_SIL_RDI }, 1432 { "mvghi", 0x48, INSTR_SIL_RDI }, 1433 { "mvhi", 0x4c, INSTR_SIL_RDI }, 1434 { "chhsi", 0x54, INSTR_SIL_RDI }, 1435 { { 0, LONG_INSN_CLHHSI }, 0x55, INSTR_SIL_RDU }, 1436 { "cghsi", 0x58, INSTR_SIL_RDI }, 1437 { { 0, LONG_INSN_CLGHSI }, 0x59, INSTR_SIL_RDU }, 1438 { "chsi", 0x5c, INSTR_SIL_RDI }, 1439 { { 0, LONG_INSN_CLFHSI }, 0x5d, INSTR_SIL_RDU }, 1440 { { 0, LONG_INSN_TBEGIN }, 0x60, INSTR_SIL_RDU }, 1441 { { 0, LONG_INSN_TBEGINC }, 0x61, INSTR_SIL_RDU }, 1442 #endif 1443 { "lasp", 0x00, INSTR_SSE_RDRD }, 1444 { "tprot", 0x01, INSTR_SSE_RDRD }, 1445 { "mvcsk", 0x0e, INSTR_SSE_RDRD }, 1446 { "mvcdk", 0x0f, INSTR_SSE_RDRD }, 1447 { "", 0, INSTR_INVALID } 1448 }; 1449 1450 static struct s390_insn opcode_e7[] = { 1451 #ifdef CONFIG_64BIT 1452 { "lcbb", 0x27, INSTR_RXE_RRRDM }, 1453 { "vgef", 0x13, INSTR_VRV_VVRDM }, 1454 { "vgeg", 0x12, INSTR_VRV_VVRDM }, 1455 { "vgbm", 0x44, INSTR_VRI_V0I0 }, 1456 { "vgm", 0x46, INSTR_VRI_V0IIM }, 1457 { "vl", 0x06, INSTR_VRX_VRRD0 }, 1458 { "vlr", 0x56, INSTR_VRR_VV00000 }, 1459 { "vlrp", 0x05, INSTR_VRX_VRRDM }, 1460 { "vleb", 0x00, INSTR_VRX_VRRDM }, 1461 { "vleh", 0x01, INSTR_VRX_VRRDM }, 1462 { "vlef", 0x03, INSTR_VRX_VRRDM }, 1463 { "vleg", 0x02, INSTR_VRX_VRRDM }, 1464 { "vleib", 0x40, INSTR_VRI_V0IM }, 1465 { "vleih", 0x41, INSTR_VRI_V0IM }, 1466 { "vleif", 0x43, INSTR_VRI_V0IM }, 1467 { "vleig", 0x42, INSTR_VRI_V0IM }, 1468 { "vlgv", 0x21, INSTR_VRS_RVRDM }, 1469 { "vllez", 0x04, INSTR_VRX_VRRDM }, 1470 { "vlm", 0x36, INSTR_VRS_VVRD0 }, 1471 { "vlbb", 0x07, INSTR_VRX_VRRDM }, 1472 { "vlvg", 0x22, INSTR_VRS_VRRDM }, 1473 { "vlvgp", 0x62, INSTR_VRR_VRR0000 }, 1474 { "vll", 0x37, INSTR_VRS_VRRD0 }, 1475 { "vmrh", 0x61, INSTR_VRR_VVV000M }, 1476 { "vmrl", 0x60, INSTR_VRR_VVV000M }, 1477 { "vpk", 0x94, INSTR_VRR_VVV000M }, 1478 { "vpks", 0x97, INSTR_VRR_VVV0M0M }, 1479 { "vpkls", 0x95, INSTR_VRR_VVV0M0M }, 1480 { "vperm", 0x8c, INSTR_VRR_VVV000V }, 1481 { "vpdi", 0x84, INSTR_VRR_VVV000M }, 1482 { "vrep", 0x4d, INSTR_VRI_VVIM }, 1483 { "vrepi", 0x45, INSTR_VRI_V0IM }, 1484 { "vscef", 0x1b, INSTR_VRV_VWRDM }, 1485 { "vsceg", 0x1a, INSTR_VRV_VWRDM }, 1486 { "vsel", 0x8d, INSTR_VRR_VVV000V }, 1487 { "vseg", 0x5f, INSTR_VRR_VV0000M }, 1488 { "vst", 0x0e, INSTR_VRX_VRRD0 }, 1489 { "vsteb", 0x08, INSTR_VRX_VRRDM }, 1490 { "vsteh", 0x09, INSTR_VRX_VRRDM }, 1491 { "vstef", 0x0b, INSTR_VRX_VRRDM }, 1492 { "vsteg", 0x0a, INSTR_VRX_VRRDM }, 1493 { "vstm", 0x3e, INSTR_VRS_VVRD0 }, 1494 { "vstl", 0x3f, INSTR_VRS_VRRD0 }, 1495 { "vuph", 0xd7, INSTR_VRR_VV0000M }, 1496 { "vuplh", 0xd5, INSTR_VRR_VV0000M }, 1497 { "vupl", 0xd6, INSTR_VRR_VV0000M }, 1498 { "vupll", 0xd4, INSTR_VRR_VV0000M }, 1499 { "va", 0xf3, INSTR_VRR_VVV000M }, 1500 { "vacc", 0xf1, INSTR_VRR_VVV000M }, 1501 { "vac", 0xbb, INSTR_VRR_VVVM00V }, 1502 { "vaccc", 0xb9, INSTR_VRR_VVVM00V }, 1503 { "vn", 0x68, INSTR_VRR_VVV0000 }, 1504 { "vnc", 0x69, INSTR_VRR_VVV0000 }, 1505 { "vavg", 0xf2, INSTR_VRR_VVV000M }, 1506 { "vavgl", 0xf0, INSTR_VRR_VVV000M }, 1507 { "vcksm", 0x66, INSTR_VRR_VVV0000 }, 1508 { "vec", 0xdb, INSTR_VRR_VV0000M }, 1509 { "vecl", 0xd9, INSTR_VRR_VV0000M }, 1510 { "vceq", 0xf8, INSTR_VRR_VVV0M0M }, 1511 { "vch", 0xfb, INSTR_VRR_VVV0M0M }, 1512 { "vchl", 0xf9, INSTR_VRR_VVV0M0M }, 1513 { "vclz", 0x53, INSTR_VRR_VV0000M }, 1514 { "vctz", 0x52, INSTR_VRR_VV0000M }, 1515 { "vx", 0x6d, INSTR_VRR_VVV0000 }, 1516 { "vgfm", 0xb4, INSTR_VRR_VVV000M }, 1517 { "vgfma", 0xbc, INSTR_VRR_VVVM00V }, 1518 { "vlc", 0xde, INSTR_VRR_VV0000M }, 1519 { "vlp", 0xdf, INSTR_VRR_VV0000M }, 1520 { "vmx", 0xff, INSTR_VRR_VVV000M }, 1521 { "vmxl", 0xfd, INSTR_VRR_VVV000M }, 1522 { "vmn", 0xfe, INSTR_VRR_VVV000M }, 1523 { "vmnl", 0xfc, INSTR_VRR_VVV000M }, 1524 { "vmal", 0xaa, INSTR_VRR_VVVM00V }, 1525 { "vmae", 0xae, INSTR_VRR_VVVM00V }, 1526 { "vmale", 0xac, INSTR_VRR_VVVM00V }, 1527 { "vmah", 0xab, INSTR_VRR_VVVM00V }, 1528 { "vmalh", 0xa9, INSTR_VRR_VVVM00V }, 1529 { "vmao", 0xaf, INSTR_VRR_VVVM00V }, 1530 { "vmalo", 0xad, INSTR_VRR_VVVM00V }, 1531 { "vmh", 0xa3, INSTR_VRR_VVV000M }, 1532 { "vmlh", 0xa1, INSTR_VRR_VVV000M }, 1533 { "vml", 0xa2, INSTR_VRR_VVV000M }, 1534 { "vme", 0xa6, INSTR_VRR_VVV000M }, 1535 { "vmle", 0xa4, INSTR_VRR_VVV000M }, 1536 { "vmo", 0xa7, INSTR_VRR_VVV000M }, 1537 { "vmlo", 0xa5, INSTR_VRR_VVV000M }, 1538 { "vno", 0x6b, INSTR_VRR_VVV0000 }, 1539 { "vo", 0x6a, INSTR_VRR_VVV0000 }, 1540 { { 0, LONG_INSN_VPOPCT }, 0x50, INSTR_VRR_VV0000M }, 1541 { { 0, LONG_INSN_VERLLV }, 0x73, INSTR_VRR_VVV000M }, 1542 { "verll", 0x33, INSTR_VRS_VVRDM }, 1543 { "verim", 0x72, INSTR_VRI_VVV0IM }, 1544 { "veslv", 0x70, INSTR_VRR_VVV000M }, 1545 { "vesl", 0x30, INSTR_VRS_VVRDM }, 1546 { { 0, LONG_INSN_VESRAV }, 0x7a, INSTR_VRR_VVV000M }, 1547 { "vesra", 0x3a, INSTR_VRS_VVRDM }, 1548 { { 0, LONG_INSN_VESRLV }, 0x78, INSTR_VRR_VVV000M }, 1549 { "vesrl", 0x38, INSTR_VRS_VVRDM }, 1550 { "vsl", 0x74, INSTR_VRR_VVV0000 }, 1551 { "vslb", 0x75, INSTR_VRR_VVV0000 }, 1552 { "vsldb", 0x77, INSTR_VRI_VVV0I0 }, 1553 { "vsra", 0x7e, INSTR_VRR_VVV0000 }, 1554 { "vsrab", 0x7f, INSTR_VRR_VVV0000 }, 1555 { "vsrl", 0x7c, INSTR_VRR_VVV0000 }, 1556 { "vsrlb", 0x7d, INSTR_VRR_VVV0000 }, 1557 { "vs", 0xf7, INSTR_VRR_VVV000M }, 1558 { "vscb", 0xf5, INSTR_VRR_VVV000M }, 1559 { "vsb", 0xbf, INSTR_VRR_VVVM00V }, 1560 { { 0, LONG_INSN_VSBCBI }, 0xbd, INSTR_VRR_VVVM00V }, 1561 { "vsumg", 0x65, INSTR_VRR_VVV000M }, 1562 { "vsumq", 0x67, INSTR_VRR_VVV000M }, 1563 { "vsum", 0x64, INSTR_VRR_VVV000M }, 1564 { "vtm", 0xd8, INSTR_VRR_VV00000 }, 1565 { "vfae", 0x82, INSTR_VRR_VVV0M0M }, 1566 { "vfee", 0x80, INSTR_VRR_VVV0M0M }, 1567 { "vfene", 0x81, INSTR_VRR_VVV0M0M }, 1568 { "vistr", 0x5c, INSTR_VRR_VV00M0M }, 1569 { "vstrc", 0x8a, INSTR_VRR_VVVMM0V }, 1570 { "vfa", 0xe3, INSTR_VRR_VVV00MM }, 1571 { "wfc", 0xcb, INSTR_VRR_VV000MM }, 1572 { "wfk", 0xca, INSTR_VRR_VV000MM }, 1573 { "vfce", 0xe8, INSTR_VRR_VVV0MMM }, 1574 { "vfch", 0xeb, INSTR_VRR_VVV0MMM }, 1575 { "vfche", 0xea, INSTR_VRR_VVV0MMM }, 1576 { "vcdg", 0xc3, INSTR_VRR_VV00MMM }, 1577 { "vcdlg", 0xc1, INSTR_VRR_VV00MMM }, 1578 { "vcgd", 0xc2, INSTR_VRR_VV00MMM }, 1579 { "vclgd", 0xc0, INSTR_VRR_VV00MMM }, 1580 { "vfd", 0xe5, INSTR_VRR_VVV00MM }, 1581 { "vfi", 0xc7, INSTR_VRR_VV00MMM }, 1582 { "vlde", 0xc4, INSTR_VRR_VV000MM }, 1583 { "vled", 0xc5, INSTR_VRR_VV00MMM }, 1584 { "vfm", 0xe7, INSTR_VRR_VVV00MM }, 1585 { "vfma", 0x8f, INSTR_VRR_VVVM0MV }, 1586 { "vfms", 0x8e, INSTR_VRR_VVVM0MV }, 1587 { "vfpso", 0xcc, INSTR_VRR_VV00MMM }, 1588 { "vfsq", 0xce, INSTR_VRR_VV000MM }, 1589 { "vfs", 0xe2, INSTR_VRR_VVV00MM }, 1590 { "vftci", 0x4a, INSTR_VRI_VVIMM }, 1591 #endif 1592 }; 1593 1594 static struct s390_insn opcode_eb[] = { 1595 #ifdef CONFIG_64BIT 1596 { "lmg", 0x04, INSTR_RSY_RRRD }, 1597 { "srag", 0x0a, INSTR_RSY_RRRD }, 1598 { "slag", 0x0b, INSTR_RSY_RRRD }, 1599 { "srlg", 0x0c, INSTR_RSY_RRRD }, 1600 { "sllg", 0x0d, INSTR_RSY_RRRD }, 1601 { "tracg", 0x0f, INSTR_RSY_RRRD }, 1602 { "csy", 0x14, INSTR_RSY_RRRD }, 1603 { "rllg", 0x1c, INSTR_RSY_RRRD }, 1604 { "clmh", 0x20, INSTR_RSY_RURD }, 1605 { "clmy", 0x21, INSTR_RSY_RURD }, 1606 { "clt", 0x23, INSTR_RSY_RURD }, 1607 { "stmg", 0x24, INSTR_RSY_RRRD }, 1608 { "stctg", 0x25, INSTR_RSY_CCRD }, 1609 { "stmh", 0x26, INSTR_RSY_RRRD }, 1610 { "clgt", 0x2b, INSTR_RSY_RURD }, 1611 { "stcmh", 0x2c, INSTR_RSY_RURD }, 1612 { "stcmy", 0x2d, INSTR_RSY_RURD }, 1613 { "lctlg", 0x2f, INSTR_RSY_CCRD }, 1614 { "csg", 0x30, INSTR_RSY_RRRD }, 1615 { "cdsy", 0x31, INSTR_RSY_RRRD }, 1616 { "cdsg", 0x3e, INSTR_RSY_RRRD }, 1617 { "bxhg", 0x44, INSTR_RSY_RRRD }, 1618 { "bxleg", 0x45, INSTR_RSY_RRRD }, 1619 { "ecag", 0x4c, INSTR_RSY_RRRD }, 1620 { "tmy", 0x51, INSTR_SIY_URD }, 1621 { "mviy", 0x52, INSTR_SIY_URD }, 1622 { "niy", 0x54, INSTR_SIY_URD }, 1623 { "cliy", 0x55, INSTR_SIY_URD }, 1624 { "oiy", 0x56, INSTR_SIY_URD }, 1625 { "xiy", 0x57, INSTR_SIY_URD }, 1626 { "asi", 0x6a, INSTR_SIY_IRD }, 1627 { "alsi", 0x6e, INSTR_SIY_IRD }, 1628 { "agsi", 0x7a, INSTR_SIY_IRD }, 1629 { "algsi", 0x7e, INSTR_SIY_IRD }, 1630 { "icmh", 0x80, INSTR_RSY_RURD }, 1631 { "icmy", 0x81, INSTR_RSY_RURD }, 1632 { "clclu", 0x8f, INSTR_RSY_RRRD }, 1633 { "stmy", 0x90, INSTR_RSY_RRRD }, 1634 { "lmh", 0x96, INSTR_RSY_RRRD }, 1635 { "lmy", 0x98, INSTR_RSY_RRRD }, 1636 { "lamy", 0x9a, INSTR_RSY_AARD }, 1637 { "stamy", 0x9b, INSTR_RSY_AARD }, 1638 { { 0, LONG_INSN_PCISTB }, 0xd0, INSTR_RSY_RRRD }, 1639 { "sic", 0xd1, INSTR_RSY_RRRD }, 1640 { "srak", 0xdc, INSTR_RSY_RRRD }, 1641 { "slak", 0xdd, INSTR_RSY_RRRD }, 1642 { "srlk", 0xde, INSTR_RSY_RRRD }, 1643 { "sllk", 0xdf, INSTR_RSY_RRRD }, 1644 { "locg", 0xe2, INSTR_RSY_RDRM }, 1645 { "stocg", 0xe3, INSTR_RSY_RDRM }, 1646 { "lang", 0xe4, INSTR_RSY_RRRD }, 1647 { "laog", 0xe6, INSTR_RSY_RRRD }, 1648 { "laxg", 0xe7, INSTR_RSY_RRRD }, 1649 { "laag", 0xe8, INSTR_RSY_RRRD }, 1650 { "laalg", 0xea, INSTR_RSY_RRRD }, 1651 { "loc", 0xf2, INSTR_RSY_RDRM }, 1652 { "stoc", 0xf3, INSTR_RSY_RDRM }, 1653 { "lan", 0xf4, INSTR_RSY_RRRD }, 1654 { "lao", 0xf6, INSTR_RSY_RRRD }, 1655 { "lax", 0xf7, INSTR_RSY_RRRD }, 1656 { "laa", 0xf8, INSTR_RSY_RRRD }, 1657 { "laal", 0xfa, INSTR_RSY_RRRD }, 1658 { "lric", 0x60, INSTR_RSY_RDRM }, 1659 { "stric", 0x61, INSTR_RSY_RDRM }, 1660 { "mric", 0x62, INSTR_RSY_RDRM }, 1661 { { 0, LONG_INSN_STCCTM }, 0x17, INSTR_RSY_RMRD }, 1662 #endif 1663 { "rll", 0x1d, INSTR_RSY_RRRD }, 1664 { "mvclu", 0x8e, INSTR_RSY_RRRD }, 1665 { "tp", 0xc0, INSTR_RSL_R0RD }, 1666 { "", 0, INSTR_INVALID } 1667 }; 1668 1669 static struct s390_insn opcode_ec[] = { 1670 #ifdef CONFIG_64BIT 1671 { "brxhg", 0x44, INSTR_RIE_RRP }, 1672 { "brxlg", 0x45, INSTR_RIE_RRP }, 1673 { { 0, LONG_INSN_RISBLG }, 0x51, INSTR_RIE_RRUUU }, 1674 { "rnsbg", 0x54, INSTR_RIE_RRUUU }, 1675 { "risbg", 0x55, INSTR_RIE_RRUUU }, 1676 { "rosbg", 0x56, INSTR_RIE_RRUUU }, 1677 { "rxsbg", 0x57, INSTR_RIE_RRUUU }, 1678 { { 0, LONG_INSN_RISBGN }, 0x59, INSTR_RIE_RRUUU }, 1679 { { 0, LONG_INSN_RISBHG }, 0x5D, INSTR_RIE_RRUUU }, 1680 { "cgrj", 0x64, INSTR_RIE_RRPU }, 1681 { "clgrj", 0x65, INSTR_RIE_RRPU }, 1682 { "cgit", 0x70, INSTR_RIE_R0IU }, 1683 { "clgit", 0x71, INSTR_RIE_R0UU }, 1684 { "cit", 0x72, INSTR_RIE_R0IU }, 1685 { "clfit", 0x73, INSTR_RIE_R0UU }, 1686 { "crj", 0x76, INSTR_RIE_RRPU }, 1687 { "clrj", 0x77, INSTR_RIE_RRPU }, 1688 { "cgij", 0x7c, INSTR_RIE_RUPI }, 1689 { "clgij", 0x7d, INSTR_RIE_RUPU }, 1690 { "cij", 0x7e, INSTR_RIE_RUPI }, 1691 { "clij", 0x7f, INSTR_RIE_RUPU }, 1692 { "ahik", 0xd8, INSTR_RIE_RRI0 }, 1693 { "aghik", 0xd9, INSTR_RIE_RRI0 }, 1694 { { 0, LONG_INSN_ALHSIK }, 0xda, INSTR_RIE_RRI0 }, 1695 { { 0, LONG_INSN_ALGHSIK }, 0xdb, INSTR_RIE_RRI0 }, 1696 { "cgrb", 0xe4, INSTR_RRS_RRRDU }, 1697 { "clgrb", 0xe5, INSTR_RRS_RRRDU }, 1698 { "crb", 0xf6, INSTR_RRS_RRRDU }, 1699 { "clrb", 0xf7, INSTR_RRS_RRRDU }, 1700 { "cgib", 0xfc, INSTR_RIS_RURDI }, 1701 { "clgib", 0xfd, INSTR_RIS_RURDU }, 1702 { "cib", 0xfe, INSTR_RIS_RURDI }, 1703 { "clib", 0xff, INSTR_RIS_RURDU }, 1704 #endif 1705 { "", 0, INSTR_INVALID } 1706 }; 1707 1708 static struct s390_insn opcode_ed[] = { 1709 #ifdef CONFIG_64BIT 1710 { "mayl", 0x38, INSTR_RXF_FRRDF }, 1711 { "myl", 0x39, INSTR_RXF_FRRDF }, 1712 { "may", 0x3a, INSTR_RXF_FRRDF }, 1713 { "my", 0x3b, INSTR_RXF_FRRDF }, 1714 { "mayh", 0x3c, INSTR_RXF_FRRDF }, 1715 { "myh", 0x3d, INSTR_RXF_FRRDF }, 1716 { "sldt", 0x40, INSTR_RXF_FRRDF }, 1717 { "srdt", 0x41, INSTR_RXF_FRRDF }, 1718 { "slxt", 0x48, INSTR_RXF_FRRDF }, 1719 { "srxt", 0x49, INSTR_RXF_FRRDF }, 1720 { "tdcet", 0x50, INSTR_RXE_FRRD }, 1721 { "tdget", 0x51, INSTR_RXE_FRRD }, 1722 { "tdcdt", 0x54, INSTR_RXE_FRRD }, 1723 { "tdgdt", 0x55, INSTR_RXE_FRRD }, 1724 { "tdcxt", 0x58, INSTR_RXE_FRRD }, 1725 { "tdgxt", 0x59, INSTR_RXE_FRRD }, 1726 { "ley", 0x64, INSTR_RXY_FRRD }, 1727 { "ldy", 0x65, INSTR_RXY_FRRD }, 1728 { "stey", 0x66, INSTR_RXY_FRRD }, 1729 { "stdy", 0x67, INSTR_RXY_FRRD }, 1730 { "czdt", 0xa8, INSTR_RSL_LRDFU }, 1731 { "czxt", 0xa9, INSTR_RSL_LRDFU }, 1732 { "cdzt", 0xaa, INSTR_RSL_LRDFU }, 1733 { "cxzt", 0xab, INSTR_RSL_LRDFU }, 1734 #endif 1735 { "ldeb", 0x04, INSTR_RXE_FRRD }, 1736 { "lxdb", 0x05, INSTR_RXE_FRRD }, 1737 { "lxeb", 0x06, INSTR_RXE_FRRD }, 1738 { "mxdb", 0x07, INSTR_RXE_FRRD }, 1739 { "keb", 0x08, INSTR_RXE_FRRD }, 1740 { "ceb", 0x09, INSTR_RXE_FRRD }, 1741 { "aeb", 0x0a, INSTR_RXE_FRRD }, 1742 { "seb", 0x0b, INSTR_RXE_FRRD }, 1743 { "mdeb", 0x0c, INSTR_RXE_FRRD }, 1744 { "deb", 0x0d, INSTR_RXE_FRRD }, 1745 { "maeb", 0x0e, INSTR_RXF_FRRDF }, 1746 { "mseb", 0x0f, INSTR_RXF_FRRDF }, 1747 { "tceb", 0x10, INSTR_RXE_FRRD }, 1748 { "tcdb", 0x11, INSTR_RXE_FRRD }, 1749 { "tcxb", 0x12, INSTR_RXE_FRRD }, 1750 { "sqeb", 0x14, INSTR_RXE_FRRD }, 1751 { "sqdb", 0x15, INSTR_RXE_FRRD }, 1752 { "meeb", 0x17, INSTR_RXE_FRRD }, 1753 { "kdb", 0x18, INSTR_RXE_FRRD }, 1754 { "cdb", 0x19, INSTR_RXE_FRRD }, 1755 { "adb", 0x1a, INSTR_RXE_FRRD }, 1756 { "sdb", 0x1b, INSTR_RXE_FRRD }, 1757 { "mdb", 0x1c, INSTR_RXE_FRRD }, 1758 { "ddb", 0x1d, INSTR_RXE_FRRD }, 1759 { "madb", 0x1e, INSTR_RXF_FRRDF }, 1760 { "msdb", 0x1f, INSTR_RXF_FRRDF }, 1761 { "lde", 0x24, INSTR_RXE_FRRD }, 1762 { "lxd", 0x25, INSTR_RXE_FRRD }, 1763 { "lxe", 0x26, INSTR_RXE_FRRD }, 1764 { "mae", 0x2e, INSTR_RXF_FRRDF }, 1765 { "mse", 0x2f, INSTR_RXF_FRRDF }, 1766 { "sqe", 0x34, INSTR_RXE_FRRD }, 1767 { "sqd", 0x35, INSTR_RXE_FRRD }, 1768 { "mee", 0x37, INSTR_RXE_FRRD }, 1769 { "mad", 0x3e, INSTR_RXF_FRRDF }, 1770 { "msd", 0x3f, INSTR_RXF_FRRDF }, 1771 { "", 0, INSTR_INVALID } 1772 }; 1773 1774 /* Extracts an operand value from an instruction. */ 1775 static unsigned int extract_operand(unsigned char *code, 1776 const struct s390_operand *operand) 1777 { 1778 unsigned char *cp; 1779 unsigned int val; 1780 int bits; 1781 1782 /* Extract fragments of the operand byte for byte. */ 1783 cp = code + operand->shift / 8; 1784 bits = (operand->shift & 7) + operand->bits; 1785 val = 0; 1786 do { 1787 val <<= 8; 1788 val |= (unsigned int) *cp++; 1789 bits -= 8; 1790 } while (bits > 0); 1791 val >>= -bits; 1792 val &= ((1U << (operand->bits - 1)) << 1) - 1; 1793 1794 /* Check for special long displacement case. */ 1795 if (operand->bits == 20 && operand->shift == 20) 1796 val = (val & 0xff) << 12 | (val & 0xfff00) >> 8; 1797 1798 /* Check for register extensions bits for vector registers. */ 1799 if (operand->flags & OPERAND_VR) { 1800 if (operand->shift == 8) 1801 val |= (code[4] & 8) << 1; 1802 else if (operand->shift == 12) 1803 val |= (code[4] & 4) << 2; 1804 else if (operand->shift == 16) 1805 val |= (code[4] & 2) << 3; 1806 else if (operand->shift == 32) 1807 val |= (code[4] & 1) << 4; 1808 } 1809 1810 /* Sign extend value if the operand is signed or pc relative. */ 1811 if ((operand->flags & (OPERAND_SIGNED | OPERAND_PCREL)) && 1812 (val & (1U << (operand->bits - 1)))) 1813 val |= (-1U << (operand->bits - 1)) << 1; 1814 1815 /* Double value if the operand is pc relative. */ 1816 if (operand->flags & OPERAND_PCREL) 1817 val <<= 1; 1818 1819 /* Length x in an instructions has real length x + 1. */ 1820 if (operand->flags & OPERAND_LENGTH) 1821 val++; 1822 return val; 1823 } 1824 1825 struct s390_insn *find_insn(unsigned char *code) 1826 { 1827 unsigned char opfrag = code[1]; 1828 unsigned char opmask; 1829 struct s390_insn *table; 1830 1831 switch (code[0]) { 1832 case 0x01: 1833 table = opcode_01; 1834 break; 1835 case 0xa5: 1836 table = opcode_a5; 1837 break; 1838 case 0xa7: 1839 table = opcode_a7; 1840 break; 1841 case 0xaa: 1842 table = opcode_aa; 1843 break; 1844 case 0xb2: 1845 table = opcode_b2; 1846 break; 1847 case 0xb3: 1848 table = opcode_b3; 1849 break; 1850 case 0xb9: 1851 table = opcode_b9; 1852 break; 1853 case 0xc0: 1854 table = opcode_c0; 1855 break; 1856 case 0xc2: 1857 table = opcode_c2; 1858 break; 1859 case 0xc4: 1860 table = opcode_c4; 1861 break; 1862 case 0xc6: 1863 table = opcode_c6; 1864 break; 1865 case 0xc8: 1866 table = opcode_c8; 1867 break; 1868 case 0xcc: 1869 table = opcode_cc; 1870 break; 1871 case 0xe3: 1872 table = opcode_e3; 1873 opfrag = code[5]; 1874 break; 1875 case 0xe5: 1876 table = opcode_e5; 1877 break; 1878 case 0xe7: 1879 table = opcode_e7; 1880 opfrag = code[5]; 1881 break; 1882 case 0xeb: 1883 table = opcode_eb; 1884 opfrag = code[5]; 1885 break; 1886 case 0xec: 1887 table = opcode_ec; 1888 opfrag = code[5]; 1889 break; 1890 case 0xed: 1891 table = opcode_ed; 1892 opfrag = code[5]; 1893 break; 1894 default: 1895 table = opcode; 1896 opfrag = code[0]; 1897 break; 1898 } 1899 while (table->format != INSTR_INVALID) { 1900 opmask = formats[table->format][0]; 1901 if (table->opfrag == (opfrag & opmask)) 1902 return table; 1903 table++; 1904 } 1905 return NULL; 1906 } 1907 1908 /** 1909 * insn_to_mnemonic - decode an s390 instruction 1910 * @instruction: instruction to decode 1911 * @buf: buffer to fill with mnemonic 1912 * @len: length of buffer 1913 * 1914 * Decode the instruction at @instruction and store the corresponding 1915 * mnemonic into @buf of length @len. 1916 * @buf is left unchanged if the instruction could not be decoded. 1917 * Returns: 1918 * %0 on success, %-ENOENT if the instruction was not found. 1919 */ 1920 int insn_to_mnemonic(unsigned char *instruction, char *buf, unsigned int len) 1921 { 1922 struct s390_insn *insn; 1923 1924 insn = find_insn(instruction); 1925 if (!insn) 1926 return -ENOENT; 1927 if (insn->name[0] == '\0') 1928 snprintf(buf, len, "%s", 1929 long_insn_name[(int) insn->name[1]]); 1930 else 1931 snprintf(buf, len, "%.5s", insn->name); 1932 return 0; 1933 } 1934 EXPORT_SYMBOL_GPL(insn_to_mnemonic); 1935 1936 static int print_insn(char *buffer, unsigned char *code, unsigned long addr) 1937 { 1938 struct s390_insn *insn; 1939 const unsigned char *ops; 1940 const struct s390_operand *operand; 1941 unsigned int value; 1942 char separator; 1943 char *ptr; 1944 int i; 1945 1946 ptr = buffer; 1947 insn = find_insn(code); 1948 if (insn) { 1949 if (insn->name[0] == '\0') 1950 ptr += sprintf(ptr, "%s\t", 1951 long_insn_name[(int) insn->name[1]]); 1952 else 1953 ptr += sprintf(ptr, "%.5s\t", insn->name); 1954 /* Extract the operands. */ 1955 separator = 0; 1956 for (ops = formats[insn->format] + 1, i = 0; 1957 *ops != 0 && i < 6; ops++, i++) { 1958 operand = operands + *ops; 1959 value = extract_operand(code, operand); 1960 if ((operand->flags & OPERAND_INDEX) && value == 0) 1961 continue; 1962 if ((operand->flags & OPERAND_BASE) && 1963 value == 0 && separator == '(') { 1964 separator = ','; 1965 continue; 1966 } 1967 if (separator) 1968 ptr += sprintf(ptr, "%c", separator); 1969 if (operand->flags & OPERAND_GPR) 1970 ptr += sprintf(ptr, "%%r%i", value); 1971 else if (operand->flags & OPERAND_FPR) 1972 ptr += sprintf(ptr, "%%f%i", value); 1973 else if (operand->flags & OPERAND_AR) 1974 ptr += sprintf(ptr, "%%a%i", value); 1975 else if (operand->flags & OPERAND_CR) 1976 ptr += sprintf(ptr, "%%c%i", value); 1977 else if (operand->flags & OPERAND_VR) 1978 ptr += sprintf(ptr, "%%v%i", value); 1979 else if (operand->flags & OPERAND_PCREL) 1980 ptr += sprintf(ptr, "%lx", (signed int) value 1981 + addr); 1982 else if (operand->flags & OPERAND_SIGNED) 1983 ptr += sprintf(ptr, "%i", value); 1984 else 1985 ptr += sprintf(ptr, "%u", value); 1986 if (operand->flags & OPERAND_DISP) 1987 separator = '('; 1988 else if (operand->flags & OPERAND_BASE) { 1989 ptr += sprintf(ptr, ")"); 1990 separator = ','; 1991 } else 1992 separator = ','; 1993 } 1994 } else 1995 ptr += sprintf(ptr, "unknown"); 1996 return (int) (ptr - buffer); 1997 } 1998 1999 void show_code(struct pt_regs *regs) 2000 { 2001 char *mode = user_mode(regs) ? "User" : "Krnl"; 2002 unsigned char code[64]; 2003 char buffer[64], *ptr; 2004 mm_segment_t old_fs; 2005 unsigned long addr; 2006 int start, end, opsize, hops, i; 2007 2008 /* Get a snapshot of the 64 bytes surrounding the fault address. */ 2009 old_fs = get_fs(); 2010 set_fs(user_mode(regs) ? USER_DS : KERNEL_DS); 2011 for (start = 32; start && regs->psw.addr >= 34 - start; start -= 2) { 2012 addr = regs->psw.addr - 34 + start; 2013 if (__copy_from_user(code + start - 2, 2014 (char __user *) addr, 2)) 2015 break; 2016 } 2017 for (end = 32; end < 64; end += 2) { 2018 addr = regs->psw.addr + end - 32; 2019 if (__copy_from_user(code + end, 2020 (char __user *) addr, 2)) 2021 break; 2022 } 2023 set_fs(old_fs); 2024 /* Code snapshot useable ? */ 2025 if ((regs->psw.addr & 1) || start >= end) { 2026 printk("%s Code: Bad PSW.\n", mode); 2027 return; 2028 } 2029 /* Find a starting point for the disassembly. */ 2030 while (start < 32) { 2031 for (i = 0, hops = 0; start + i < 32 && hops < 3; hops++) { 2032 if (!find_insn(code + start + i)) 2033 break; 2034 i += insn_length(code[start + i]); 2035 } 2036 if (start + i == 32) 2037 /* Looks good, sequence ends at PSW. */ 2038 break; 2039 start += 2; 2040 } 2041 /* Decode the instructions. */ 2042 ptr = buffer; 2043 ptr += sprintf(ptr, "%s Code:", mode); 2044 hops = 0; 2045 while (start < end && hops < 8) { 2046 opsize = insn_length(code[start]); 2047 if (start + opsize == 32) 2048 *ptr++ = '#'; 2049 else if (start == 32) 2050 *ptr++ = '>'; 2051 else 2052 *ptr++ = ' '; 2053 addr = regs->psw.addr + start - 32; 2054 ptr += sprintf(ptr, ONELONG, addr); 2055 if (start + opsize >= end) 2056 break; 2057 for (i = 0; i < opsize; i++) 2058 ptr += sprintf(ptr, "%02x", code[start + i]); 2059 *ptr++ = '\t'; 2060 if (i < 6) 2061 *ptr++ = '\t'; 2062 ptr += print_insn(ptr, code + start, addr); 2063 start += opsize; 2064 printk(buffer); 2065 ptr = buffer; 2066 ptr += sprintf(ptr, "\n "); 2067 hops++; 2068 } 2069 printk("\n"); 2070 } 2071 2072 void print_fn_code(unsigned char *code, unsigned long len) 2073 { 2074 char buffer[64], *ptr; 2075 int opsize, i; 2076 2077 while (len) { 2078 ptr = buffer; 2079 opsize = insn_length(*code); 2080 if (opsize > len) 2081 break; 2082 ptr += sprintf(ptr, "%p: ", code); 2083 for (i = 0; i < opsize; i++) 2084 ptr += sprintf(ptr, "%02x", code[i]); 2085 *ptr++ = '\t'; 2086 if (i < 4) 2087 *ptr++ = '\t'; 2088 ptr += print_insn(ptr, code, (unsigned long) code); 2089 *ptr++ = '\n'; 2090 *ptr++ = 0; 2091 printk(buffer); 2092 code += opsize; 2093 len -= opsize; 2094 } 2095 } 2096