diff options
author | David Hildenbrand <david@redhat.com> | 2021-09-03 17:55:08 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2021-09-06 16:24:05 +0200 |
commit | 390191c6f6e2e912f45bc312464d59b84ca12db3 (patch) | |
tree | 49e33c28e31f787b43c1f7e3638c3528d4db53eb /target/s390x/tcg | |
parent | e0b11f2df19c1e9341e9cec78429e45e5af5901b (diff) | |
download | qemu-390191c6f6e2e912f45bc312464d59b84ca12db3.zip qemu-390191c6f6e2e912f45bc312464d59b84ca12db3.tar.gz qemu-390191c6f6e2e912f45bc312464d59b84ca12db3.tar.bz2 |
s390x/mmu_helper: move address validation into mmu_translate*()
Let's move address validation into mmu_translate() and
mmu_translate_real(). This allows for checking whether an absolute
address is valid before looking up the storage key. We can now get rid of
the ram_size check.
Interestingly, we're already handling LOAD REAL ADDRESS wrong, because
a) We're not supposed to touch storage keys
b) We're not supposed to convert to an absolute address
Let's use a fake, negative MMUAccessType to teach mmu_translate() to
fix that handling and to not perform address validation.
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210903155514.44772-8-david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'target/s390x/tcg')
-rw-r--r-- | target/s390x/tcg/excp_helper.c | 13 | ||||
-rw-r--r-- | target/s390x/tcg/mem_helper.c | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index a61917d..3d6662a 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -150,19 +150,6 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, g_assert_not_reached(); } - /* check out of RAM access */ - if (!excp && - !address_space_access_valid(&address_space_memory, raddr, - TARGET_PAGE_SIZE, access_type, - MEMTXATTRS_UNSPECIFIED)) { - MachineState *ms = MACHINE(qdev_get_machine()); - qemu_log_mask(CPU_LOG_MMU, - "%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", - __func__, (uint64_t)raddr, (uint64_t)ms->ram_size); - excp = PGM_ADDRESSING; - tec = 0; /* unused */ - } - env->tlb_fill_exc = excp; env->tlb_fill_tec = tec; diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index a44a107..4f9f3e1 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -2455,7 +2455,7 @@ uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr) tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, GETPC()); } - exc = mmu_translate(env, addr, 0, asc, &ret, &flags, &tec); + exc = mmu_translate(env, addr, MMU_S390_LRA, asc, &ret, &flags, &tec); if (exc) { cc = 3; ret = exc | 0x80000000; |