diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2015-02-12 18:09:26 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-02-18 09:37:14 +0100 |
commit | 43d49b0115aef2ead5125d4aa9719852d47ef6fc (patch) | |
tree | 1ff9a48479d1199105e41818f3baac65531c742c /target-s390x/mmu_helper.c | |
parent | 5a123b3c1a1d3540d4455772c42c466870d81061 (diff) | |
download | qemu-43d49b0115aef2ead5125d4aa9719852d47ef6fc.zip qemu-43d49b0115aef2ead5125d4aa9719852d47ef6fc.tar.gz qemu-43d49b0115aef2ead5125d4aa9719852d47ef6fc.tar.bz2 |
s390x/mmu: Add support for read-only regions
If the "DAT-protection" bit is set in the region table entry and EDAT is
enabled, only read accesses are allowed in the corresponding memory area.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x/mmu_helper.c')
-rw-r--r-- | target-s390x/mmu_helper.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/target-s390x/mmu_helper.c b/target-s390x/mmu_helper.c index 0c53ae9..702e8b8 100644 --- a/target-s390x/mmu_helper.c +++ b/target-s390x/mmu_helper.c @@ -188,9 +188,6 @@ static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr, return -1; } - /* XXX region protection flags */ - /* *flags &= ~PAGE_WRITE */ - if (level == _ASCE_TYPE_SEGMENT) { return mmu_translate_segment(env, vaddr, asc, new_entry, raddr, flags, rw, exc); @@ -205,6 +202,10 @@ static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr, return -1; } + if ((env->cregs[0] & CR0_EDAT) && (new_entry & _REGION_ENTRY_RO)) { + *flags &= ~PAGE_WRITE; + } + /* yet another region */ return mmu_translate_region(env, vaddr, asc, new_entry, level - 4, raddr, flags, rw, exc); |