[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/27] tcg/s390x: Check for long-displacement facility at startup
From: |
Richard Henderson |
Subject: |
[PULL 05/27] tcg/s390x: Check for long-displacement facility at startup |
Date: |
Fri, 6 Jan 2023 23:50:56 -0800 |
We are already assuming the existance of long-displacement, but were
not being explicit about it. This has been present since z990.
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/s390x/tcg-target.h | 6 ++++--
tcg/s390x/tcg-target.c.inc | 15 +++++++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h
index 645f522058..7f230ed243 100644
--- a/tcg/s390x/tcg-target.h
+++ b/tcg/s390x/tcg-target.h
@@ -52,11 +52,13 @@ typedef enum TCGReg {
#define TCG_TARGET_NB_REGS 64
-/* A list of relevant facilities used by this translator. Some of these
- are required for proper operation, and these are checked at startup. */
+/* Facilities required for proper operation; checked at startup. */
#define FACILITY_ZARCH_ACTIVE 2
#define FACILITY_LONG_DISP 18
+
+/* Facilities that are checked at runtime. */
+
#define FACILITY_EXT_IMM 21
#define FACILITY_GEN_INST_EXT 34
#define FACILITY_LOAD_ON_COND 45
diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index dea889ffa1..1fcefba7ba 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -3211,6 +3211,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode
op)
static void query_s390_facilities(void)
{
unsigned long hwcap = qemu_getauxval(AT_HWCAP);
+ const char *which;
/* Is STORE FACILITY LIST EXTENDED available? Honestly, I believe this
is present on all 64-bit systems, but let's check for it anyway. */
@@ -3232,6 +3233,20 @@ static void query_s390_facilities(void)
if (!(hwcap & HWCAP_S390_VXRS)) {
s390_facilities[2] = 0;
}
+
+ /*
+ * Check for all required facilities.
+ * ZARCH_ACTIVE is done via preprocessor check for 64-bit.
+ */
+ if (!HAVE_FACILITY(LONG_DISP)) {
+ which = "long-displacement";
+ goto fail;
+ }
+ return;
+
+ fail:
+ error_report("%s: missing required facility %s", __func__, which);
+ exit(EXIT_FAILURE);
}
static void tcg_target_init(TCGContext *s)
--
2.34.1
- [PULL 01/27] tcg/s390x: Use register pair allocation for div and mulu2, (continued)
- [PULL 01/27] tcg/s390x: Use register pair allocation for div and mulu2, Richard Henderson, 2023/01/07
- [PULL 03/27] tcg/s390x: Always set TCG_TARGET_HAS_direct_jump, Richard Henderson, 2023/01/07
- [PULL 06/27] tcg/s390x: Check for extended-immediate facility at startup, Richard Henderson, 2023/01/07
- [PULL 08/27] tcg/s390x: Check for load-on-condition facility at startup, Richard Henderson, 2023/01/07
- [PULL 12/27] tcg/s390x: Distinguish RRF-a and RRF-c formats, Richard Henderson, 2023/01/07
- [PULL 15/27] tcg/s390x: Support MIE2 MGRK instruction, Richard Henderson, 2023/01/07
- [PULL 16/27] tcg/s390x: Issue XILF directly for xor_i32, Richard Henderson, 2023/01/07
- [PULL 09/27] tcg/s390x: Remove FAST_BCR_SER facility check, Richard Henderson, 2023/01/07
- [PULL 04/27] tcg/s390x: Remove USE_LONG_BRANCHES, Richard Henderson, 2023/01/07
- [PULL 07/27] tcg/s390x: Check for general-instruction-extension facility at startup, Richard Henderson, 2023/01/07
- [PULL 05/27] tcg/s390x: Check for long-displacement facility at startup,
Richard Henderson <=
- [PULL 11/27] tcg/s390x: Use LARL+AGHI for odd addresses, Richard Henderson, 2023/01/07
- [PULL 10/27] tcg/s390x: Remove DISTINCT_OPERANDS facility check, Richard Henderson, 2023/01/07
- [PULL 13/27] tcg/s390x: Distinguish RIE formats, Richard Henderson, 2023/01/07
- [PULL 14/27] tcg/s390x: Support MIE2 multiply single instructions, Richard Henderson, 2023/01/07
- [PULL 19/27] tcg/s390x: Support MIE3 logical operations, Richard Henderson, 2023/01/07
- [PULL 23/27] tcg/s390x: Use tgen_movcond_int in tgen_clz, Richard Henderson, 2023/01/07
- [PULL 25/27] tcg/s390x: Tighten constraints for 64-bit compare, Richard Henderson, 2023/01/07
- [PULL 17/27] tcg/s390x: Tighten constraints for or_i64 and xor_i64, Richard Henderson, 2023/01/07
- [PULL 18/27] tcg/s390x: Tighten constraints for and_i64, Richard Henderson, 2023/01/07
- [PULL 21/27] tcg/s390x: Generalize movcond implementation, Richard Henderson, 2023/01/07