diff options
author | Richard Henderson <rth@twiddle.net> | 2017-06-16 17:37:59 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-06-23 09:17:44 -0700 |
commit | 3c39c800bf8fb22222372f9ae84423f966f6da98 (patch) | |
tree | 3ca001a20ec9a33e6037869300582ad28ca4c0c8 /target/s390x/mem_helper.c | |
parent | afa26f3bae18992cc9598a2cb1a9a09d2e813f76 (diff) |
target/s390x: Finish implementing ETF2-ENH
Missed the proper alignment in TRTO/TRTT, and ignoring the M3
field for all TRXX insns without ETF2-ENH.
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/s390x/mem_helper.c')
-rw-r--r-- | target/s390x/mem_helper.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 6125725451..a0a805cd1b 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -1265,13 +1265,22 @@ uint32_t HELPER(trXX)(CPUS390XState *env, uint32_t r1, uint32_t r2, uintptr_t ra = GETPC(); int dsize = (sizes & 1) ? 1 : 2; int ssize = (sizes & 2) ? 1 : 2; - uint64_t tbl = get_address(env, 1) & ~7; + uint64_t tbl = get_address(env, 1); uint64_t dst = get_address(env, r1); uint64_t len = get_length(env, r1 + 1); uint64_t src = get_address(env, r2); uint32_t cc = 3; int i; + /* The lower address bits of TBL are ignored. For TROO, TROT, it's + the low 3 bits (double-word aligned). For TRTO, TRTT, it's either + the low 12 bits (4K, without ETF2-ENH) or 3 bits (with ETF2-ENH). */ + if (ssize == 2 && !s390_has_feat(S390_FEAT_ETF2_ENH)) { + tbl &= -4096; + } else { + tbl &= -8; + } + check_alignment(env, len, ssize, ra); /* Lest we fail to service interrupts in a timely manner, */ |