diff options
author | David Hildenbrand <david@redhat.com> | 2018-02-13 17:12:40 +0100 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-02-26 12:55:26 +0100 |
commit | f26852aa31d49bf83a8defd65538137a2f9da82c (patch) | |
tree | eda59c67b2386c68def5cc993750103680d14bad /target/s390x/translate.c | |
parent | 571729a00a2ec8514c350dae830a73a09698a043 (diff) |
s390x/tcg: fix disabling/enabling DAT
Currently, all memory accesses go via the MMU of the address space
(primary, secondary, ...). This is bad, because we don't flush the TLB
when disabling/enabling DAT. So we could add a tlb flush. However it
is easier to simply select the MMU we already have in place for real
memory access.
All we have to do is point at the right MMU and allow to execute these
pages.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180213161240.19891-1-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[CH: get rid of tabs]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/translate.c')
-rw-r--r-- | target/s390x/translate.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/target/s390x/translate.c b/target/s390x/translate.c index b470d691d3..5aea3bbca6 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -252,13 +252,17 @@ static inline uint64_t ld_code4(CPUS390XState *env, uint64_t pc) static int get_mem_index(DisasContext *s) { + if (!(s->tb->flags & FLAG_MASK_DAT)) { + return MMU_REAL_IDX; + } + switch (s->tb->flags & FLAG_MASK_ASC) { case PSW_ASC_PRIMARY >> FLAG_MASK_PSW_SHIFT: - return 0; + return MMU_PRIMARY_IDX; case PSW_ASC_SECONDARY >> FLAG_MASK_PSW_SHIFT: - return 1; + return MMU_SECONDARY_IDX; case PSW_ASC_HOME >> FLAG_MASK_PSW_SHIFT: - return 2; + return MMU_HOME_IDX; default: tcg_abort(); break; |