Adding a new hardware capability requires changes in several places.
Generally for a new FOO hardware capability:
- add VEX_HWCAPS_S390X_FOO and update VEX_HWCAPS_S390X_ALL in libvex.h
- test the corresponding facility bit in m_machine.c
- add s390_host_has_foo in host_s390_defs.h
- if an insn requiring FOO cannot be implemented on the host by other means
- add EmFail_S390X_foo in libvex_emnote.h
- handle EmFail_S390X_foo in main_main.c
- update function show_hwcaps_s390x
Occasionally something gets forgotten and this patch adds the forgotten
pieces.
Also add new hardware capabilities vxe2, vxd, msa, msa4, msa8, msa9
Fixes: https://bugs.kde.org/show_bug.cgi?id=496950
495816 s390x: Fix disassembler segfault for C[G]RT and CL[G]RT
496370 Illumos: signal handling is broken
496571 False positive for null key passed to bpf_map_get_next_key syscall.
+496950 s390x: Fix hardware capabilities and EmFail codes
497130 Recognize new DWARF5 DW_LANG constants
497455 Update drd/scripts/download-and-build-gcc
497723 Enabling Ada demangling breaks callgrind differentiation between
(s390_host_hwcaps & (VEX_HWCAPS_S390X_VX))
#define s390_host_has_msa5 \
(s390_host_hwcaps & (VEX_HWCAPS_S390X_MSA5))
+#define s390_host_has_mi2 \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_MI2))
#define s390_host_has_lsc2 \
(s390_host_hwcaps & (VEX_HWCAPS_S390X_LSC2))
#define s390_host_has_vxe \
(s390_host_hwcaps & (VEX_HWCAPS_S390X_NNPA))
#define s390_host_has_dflt \
(s390_host_hwcaps & (VEX_HWCAPS_S390X_DFLT))
+#define s390_host_has_vxe2 \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_VXE2))
+#define s390_host_has_vxd \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_VXD))
+#define s390_host_has_msa \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_MSA))
+#define s390_host_has_msa4 \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_MSA4))
+#define s390_host_has_msa8 \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_MSA8))
+#define s390_host_has_msa9 \
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_MSA9))
#endif /* ndef __VEX_HOST_S390_DEFS_H */
/*---------------------------------------------------------------*/
case EmFail_S390X_vx:
return "Encountered an instruction that requires the vector facility.\n"
" That facility is not available on this host";
- default:
+ case EmFail_S390X_ppno:
+ return "Instruction ppno is not supported on this host.";
+ case EmFail_S390X_vxe:
+ return "Encountered an instruction that requires the vector-extensions"
+ " facility 1.\n"
+ " That facility is not available on this host";
+ case EmFail_S390X_dflt:
+ return "Encountered an instruction that requires the deflate-conversion"
+ " facility.\n"
+ " That facility is not available on this host";
+ case EmFail_S390X_nnpa:
+ return "Encountered an instruction that requires the"
+ " neural-network-processing-assist facility.\n"
+ " That facility is not available on this host";
+ case EmFail_S390X_vxe2:
+ return "Encountered an instruction that requires the vector-extensions\n"
+ " facility 2.\n"
+ " That facility is not available on this host";
+ case EmFail_S390X_vxd:
+ return "Encountered an instruction that requires the vector-packed-decimal\n"
+ " facility.\n"
+ " That facility is not available on this host";
+ case EmFail_S390X_msa:
+ return "Encountered an instruction that requires the message-security"
+ " assist.\n"
+ " That assist is not available on this host";
+ case EmFail_S390X_msa4:
+ return "Encountered an instruction that requires the"
+ " message-security-assist extension 4.\n"
+ " That extension is not available on this host";
+ case EmFail_S390X_msa8:
+ return "Encountered an instruction that requires the"
+ " message-security-assist extension 8.\n"
+ " That extension is not available on this host";
+ case EmFail_S390X_msa9:
+ return "Encountered an instruction that requires the"
+ " message-security-assist extension 9.\n"
+ " That extension is not available on this host";
+ default:
vpanic("LibVEX_EmNote_string: unknown warning");
}
}
{ VEX_HWCAPS_S390X_MI2, "mi2" },
{ VEX_HWCAPS_S390X_LSC2, "lsc2" },
{ VEX_HWCAPS_S390X_VXE, "vxe" },
+ { VEX_HWCAPS_S390X_NNPA, "nnpa" },
{ VEX_HWCAPS_S390X_DFLT, "dflt" },
+ { VEX_HWCAPS_S390X_VXE2, "vxe2" },
+ { VEX_HWCAPS_S390X_VXD, "vxd" },
+ { VEX_HWCAPS_S390X_MSA, "msa" },
+ { VEX_HWCAPS_S390X_MSA4, "msa4" },
+ { VEX_HWCAPS_S390X_MSA8, "msa8" },
+ { VEX_HWCAPS_S390X_MSA9, "msa9" },
};
/* Allocate a large enough buffer */
static HChar buf[sizeof prefix +
/* s390x: Hardware capability encoding
Bits [26:31] encode the machine model (see VEX_S390X_MODEL... below)
- Bits [0:20] encode specific hardware capabilities
+ Bits [0:25] encode specific hardware capabilities
(see VEX_HWAPS_S390X_... below)
*/
#define VEX_HWCAPS_S390X_LSC (1<<16) /* Conditional load/store facility */
#define VEX_HWCAPS_S390X_PFPO (1<<17) /* Perform floating point ops facility */
#define VEX_HWCAPS_S390X_VX (1<<18) /* Vector facility */
-#define VEX_HWCAPS_S390X_MSA5 (1<<19) /* message security assistance facility */
-#define VEX_HWCAPS_S390X_MI2 (1<<20) /* miscellaneous-instruction-extensions facility 2 */
+#define VEX_HWCAPS_S390X_MSA5 (1<<19) /* Message-security-assistance facility 5 */
+#define VEX_HWCAPS_S390X_MI2 (1<<20) /* Miscellaneous-instruction-extensions facility 2 */
#define VEX_HWCAPS_S390X_LSC2 (1<<21) /* Conditional load/store facility2 */
#define VEX_HWCAPS_S390X_VXE (1<<22) /* Vector-enhancements facility */
#define VEX_HWCAPS_S390X_NNPA (1<<23) /* NNPA facility */
#define VEX_HWCAPS_S390X_DFLT (1<<24) /* Deflate-conversion facility */
+#define VEX_HWCAPS_S390X_VXE2 (1<<25) /* Vector-enhancements facility 2 */
+#define VEX_HWCAPS_S390X_VXD (1<<26) /* Vector packed-decimal facility */
+#define VEX_HWCAPS_S390X_MSA (1<<27) /* Message-security assist */
+#define VEX_HWCAPS_S390X_MSA4 (1<<28) /* Message-security-assist extension 4 */
+#define VEX_HWCAPS_S390X_MSA8 (1<<29) /* Message-security-assist extension 8 */
+#define VEX_HWCAPS_S390X_MSA9 (1<<30) /* Message-security-assist extension 9 */
/* Special value representing all available s390x hwcaps */
#define VEX_HWCAPS_S390X_ALL (VEX_HWCAPS_S390X_LDISP | \
VEX_HWCAPS_S390X_LSC2 | \
VEX_HWCAPS_S390X_VXE | \
VEX_HWCAPS_S390X_NNPA | \
- VEX_HWCAPS_S390X_DFLT)
+ VEX_HWCAPS_S390X_DFLT | \
+ VEX_HWCAPS_S390X_VXE2 | \
+ VEX_HWCAPS_S390X_VXD | \
+ VEX_HWCAPS_S390X_MSA | \
+ VEX_HWCAPS_S390X_MSA4 | \
+ VEX_HWCAPS_S390X_MSA8 | \
+ VEX_HWCAPS_S390X_MSA9)
#define VEX_HWCAPS_S390X(x) ((x) & ~VEX_S390X_MODEL_MASK)
#define VEX_S390X_MODEL(x) ((x) & VEX_S390X_MODEL_MASK)
/* ppno insn is not supported on this host */
EmFail_S390X_ppno,
- /* insn needs vector-enhancements facility which is not available on this
- host */
+ /* insn needs vector-enhancements facility 1 which is not available on
+ this host */
EmFail_S390X_vxe,
+ /* insn needs deflate-conversion facility which is not available on
+ this host */
+ EmFail_S390X_dflt,
+
+ /* insn needs neural-network-processing-assist facility which is not
+ available on this host */
+ EmFail_S390X_nnpa,
+
+ /* insn needs vector-enhancements facility 2 which is not available on
+ this host */
+ EmFail_S390X_vxe2,
+
+ /* insn needs vector-packed-decimal facility which is not available on
+ this host */
+ EmFail_S390X_vxd,
+
+ /* insn needs message-security assist which is not available on
+ this host */
+ EmFail_S390X_msa,
+
+ /* insn needs message-security-assist extension 4 which is not available
+ on this host */
+ EmFail_S390X_msa4,
+
+ /* insn needs message-security-assist extension 8 which is not available
+ on this host */
+ EmFail_S390X_msa8,
+
+ /* insn needs message-security-assist extension 9 which is not available
+ on this host */
+ EmFail_S390X_msa9,
+
EmNote_NUMBER
}
VexEmNote;
(S390_SETBITS(128, 131)
/* 132: unassigned */
/* 133: guarded-storage, not supported */
- /* 134: vector packed decimal, not supported */
- | S390_SETBITS(135, 135)
+ | S390_SETBITS(134, 135)
/* 136: unassigned */
/* 137: unassigned */
| S390_SETBITS(138, 142)
UInt hwcaps_bit;
const HChar name[6]; // may need adjustment for new facility names
} fac_hwcaps[] = {
+ { False, 18, VEX_HWCAPS_S390X_LDISP, "LDISP" },
{ False, 21, VEX_HWCAPS_S390X_EIMM, "EIMM" },
{ False, 34, VEX_HWCAPS_S390X_GIE, "GIE" },
{ False, 42, VEX_HWCAPS_S390X_DFP, "DFP" },
{ False, 41, VEX_HWCAPS_S390X_FGX, "FGX" },
{ False, 24, VEX_HWCAPS_S390X_ETF2, "ETF2" },
+ { False, 7, VEX_HWCAPS_S390X_STFLE, "STFLE" },
{ False, 30, VEX_HWCAPS_S390X_ETF3, "ETF3" },
{ False, 25, VEX_HWCAPS_S390X_STCKF, "STCKF" },
{ False, 37, VEX_HWCAPS_S390X_FPEXT, "FPEXT" },
{ False, 135, VEX_HWCAPS_S390X_VXE, "VXE" },
{ False, 151, VEX_HWCAPS_S390X_DFLT, "DFLT" },
{ False, 165, VEX_HWCAPS_S390X_NNPA, "NNPA" },
+ { False, 148, VEX_HWCAPS_S390X_VXE2, "VXE2" },
+ { False, 134, VEX_HWCAPS_S390X_VXD, "VXD" },
+ { False, 17, VEX_HWCAPS_S390X_MSA, "MSA" },
+ { False, 77, VEX_HWCAPS_S390X_MSA4, "MSA4" },
+ { False, 146, VEX_HWCAPS_S390X_MSA8, "MSA8" },
+ { False, 155, VEX_HWCAPS_S390X_MSA9, "MSA9" },
};
/* Set hwcaps according to the detected facilities */