From: Andreas Arnez Date: Thu, 27 Feb 2020 14:52:53 +0000 (+0100) Subject: s390x: Add CPU model for z15 X-Git-Tag: VALGRIND_3_16_0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a2711c659ac839934f13e0529e14d6c15325383;p=thirdparty%2Fvalgrind.git s390x: Add CPU model for z15 Make the z15 CPU models known to Valgrind. Add test case output for z15 to the "ecag" test. Also ensure that the facility bits for CPU facilities unsupported by Valgrind are unset, particularly for the new deflate-conversion facility. --- diff --git a/VEX/priv/guest_s390_helpers.c b/VEX/priv/guest_s390_helpers.c index 525e7000cf..a470d9f8d3 100644 --- a/VEX/priv/guest_s390_helpers.c +++ b/VEX/priv/guest_s390_helpers.c @@ -377,6 +377,9 @@ s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, ULong *addr) s390_set_facility_bit(addr, S390_FAC_CTREXE, 0); s390_set_facility_bit(addr, S390_FAC_TREXE, 0); s390_set_facility_bit(addr, S390_FAC_MSA4, 0); + s390_set_facility_bit(addr, S390_FAC_VXE, 0); + s390_set_facility_bit(addr, S390_FAC_VXE2, 0); + s390_set_facility_bit(addr, S390_FAC_DFLT, 0); return cc; } diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 359d10809c..6da26dcb5f 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -147,7 +147,8 @@ typedef #define VEX_S390X_MODEL_Z13S 13 #define VEX_S390X_MODEL_Z14 14 #define VEX_S390X_MODEL_Z14_ZR1 15 -#define VEX_S390X_MODEL_UNKNOWN 16 /* always last in list */ +#define VEX_S390X_MODEL_Z15 16 +#define VEX_S390X_MODEL_UNKNOWN 17 /* always last in list */ #define VEX_S390X_MODEL_MASK 0x3F #define VEX_HWCAPS_S390X_LDISP (1<<6) /* Long-displacement facility */ diff --git a/VEX/pub/libvex_s390x_common.h b/VEX/pub/libvex_s390x_common.h index d945a44722..289421677a 100644 --- a/VEX/pub/libvex_s390x_common.h +++ b/VEX/pub/libvex_s390x_common.h @@ -103,6 +103,9 @@ #define S390_FAC_TREXE 73 // transactional execution #define S390_FAC_MSA4 77 // message-security-assist 4 #define S390_FAC_VX 129 // vector facility +#define S390_FAC_VXE 135 // vector enhancements facility 1 +#define S390_FAC_VXE2 148 // vector enhancements facility 2 +#define S390_FAC_DFLT 151 // deflate-conversion facility /*--------------------------------------------------------------*/ diff --git a/auxprogs/s390-check-opcodes.pl b/auxprogs/s390-check-opcodes.pl index 3f0ac1e632..ecb4069ad5 100755 --- a/auxprogs/s390-check-opcodes.pl +++ b/auxprogs/s390-check-opcodes.pl @@ -28,7 +28,7 @@ my %csv_implemented = (); my %toir_implemented = (); my %toir_decoded = (); my %known_arch = map {($_ => 1)} - qw(g5 z900 z990 z9-109 z9-ec z10 z196 zEC12 z13 arch12); + qw(g5 z900 z990 z9-109 z9-ec z10 z196 zEC12 z13 arch12 arch13); # Patterns for identifying certain extended mnemonics that shall be # skipped in "s390-opc.txt" and "s390-opcodes.csv". diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index 672a02124a..0fd1d21c78 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -581,6 +581,8 @@ static UInt VG_(get_machine_model)(void) { "2965", VEX_S390X_MODEL_Z13S }, { "3906", VEX_S390X_MODEL_Z14 }, { "3907", VEX_S390X_MODEL_Z14_ZR1 }, + { "8561", VEX_S390X_MODEL_Z15 }, + { "8562", VEX_S390X_MODEL_Z15 }, }; Int model, n, fh; diff --git a/none/tests/s390x/Makefile.am b/none/tests/s390x/Makefile.am index c5b07f7a2a..a0fb92ef57 100644 --- a/none/tests/s390x/Makefile.am +++ b/none/tests/s390x/Makefile.am @@ -39,7 +39,7 @@ EXTRA_DIST = \ $(addsuffix .stdout.exp,$(INSN_TESTS)) \ $(addsuffix .vgtest,$(INSN_TESTS)) \ ecag.stdout.exp-z10ec ecag.stdout.exp-z196 ecag.stdout.exp-zec12 \ - ecag.stdout.exp-z13 ecag.stdout.exp-z14 \ + ecag.stdout.exp-z13 ecag.stdout.exp-z14 ecag.stdout.exp-z15 \ op00.stderr.exp1 op00.stderr.exp2 op00.vgtest \ fixbr.vgtest fixbr.stderr.exp fixbr.stdout.exp \ fpext.vgtest fpext.stderr.exp fpext.stdout.exp \ diff --git a/none/tests/s390x/ecag.stdout.exp-z15 b/none/tests/s390x/ecag.stdout.exp-z15 new file mode 100644 index 0000000000..b98d81b789 --- /dev/null +++ b/none/tests/s390x/ecag.stdout.exp-z15 @@ -0,0 +1,28 @@ +L1 topology: separate data and instruction; private +L1 cache line size data: 256 +L1 cache line size insn: 256 +L1 total cachesize data: 131072 +L1 total cachesize insn: 131072 +L1 set. assoc. data: 8 +L1 set. assoc. insn: 8 +L2 topology: separate data and instruction; private +L2 cache line size data: 256 +L2 cache line size insn: 256 +L2 total cachesize data: 4194304 +L2 total cachesize insn: 4194304 +L2 set. assoc. data: 8 +L2 set. assoc. insn: 8 +L3 topology: unified data and instruction; shared +L3 cache line size data: 256 +L3 cache line size insn: 256 +L3 total cachesize data: 268435456 +L3 total cachesize insn: 268435456 +L3 set. assoc. data: 32 +L3 set. assoc. insn: 32 +L4 topology: unified data and instruction; shared +L4 cache line size data: 256 +L4 cache line size insn: 256 +L4 total cachesize data: 1006632960 +L4 total cachesize insn: 1006632960 +L4 set. assoc. data: 60 +L4 set. assoc. insn: 60 diff --git a/tests/s390x_features.c b/tests/s390x_features.c index baa349311f..25b98f3a3a 100644 --- a/tests/s390x_features.c +++ b/tests/s390x_features.c @@ -116,6 +116,8 @@ model_info models[] = { { "2965", "z13s" }, { "3906", "z14" }, { "3907", "z14 ZR1"}, + { "8561", "z15" }, + { "8562", "z15" }, };