diff options
author | David Hildenbrand <david@redhat.com> | 2018-01-15 00:29:22 +0100 |
---|---|---|
committer | David Hildenbrand <david@redhat.com> | 2019-10-09 12:49:01 +0200 |
commit | 3a06f981925bfade8f5e650655fce0b38dbd6649 (patch) | |
tree | fe4f3d4e4cdf8b89f6f89a6551eb09c45ac52054 /target/s390x/helper.c | |
parent | 3dc29061f3291bf0b6cda9cc7bc04aa94101b52e (diff) |
s390x/mmu: Implement Instruction-Execution-Protection Facility
IEP support in the mmu is fairly easy. Set the right permissions for TLB
entries and properly report an exception.
Make sure to handle EDAT-2 by setting bit 56/60/61 of the TEID (TEC) to
the right values.
Let's keep s390_cpu_get_phys_page_debug() working even if IEP is
active. Switch MMU_DATA_LOAD - this has no other effects any more as the
ASC to be used is now fully selected outside of mmu_translate().
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'target/s390x/helper.c')
-rw-r--r-- | target/s390x/helper.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 948c0398d4..bf503b56ee 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -63,7 +63,11 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) asc = PSW_ASC_PRIMARY; } - if (mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false)) { + /* + * We want to read code even if IEP is active. Use MMU_DATA_LOAD instead + * of MMU_INST_FETCH. + */ + if (mmu_translate(env, vaddr, MMU_DATA_LOAD, asc, &raddr, &prot, false)) { return -1; } return raddr; |