[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/31] s390x/mmu: Add EDAT2 translation support
From: |
David Hildenbrand |
Subject: |
[PULL 08/31] s390x/mmu: Add EDAT2 translation support |
Date: |
Thu, 10 Oct 2019 13:33:33 +0200 |
This only adds basic support to the DAT translation, but no EDAT2 support
for TCG. E.g., the gdbstub under kvm uses this function, too, to
translate virtual addresses.
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/mmu_helper.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
index dc33c63b1d..e27e21328b 100644
--- a/target/s390x/mmu_helper.c
+++ b/target/s390x/mmu_helper.c
@@ -120,6 +120,7 @@ static int mmu_translate_asce(CPUS390XState *env,
target_ulong vaddr,
{
const bool edat1 = (env->cregs[0] & CR0_EDAT) &&
s390_has_feat(S390_FEAT_EDAT);
+ const bool edat2 = edat1 && s390_has_feat(S390_FEAT_EDAT_2);
const int asce_tl = asce & ASCE_TABLE_LENGTH;
const int asce_p = asce & ASCE_PRIVATE_SPACE;
hwaddr gaddr = asce & ASCE_ORIGIN;
@@ -217,13 +218,21 @@ static int mmu_translate_asce(CPUS390XState *env,
target_ulong vaddr,
if ((entry & REGION_ENTRY_TT) != REGION_ENTRY_TT_REGION3) {
return PGM_TRANS_SPEC;
}
- if (VADDR_SEGMENT_TL(vaddr) < (entry & REGION_ENTRY_TF) >> 6 ||
- VADDR_SEGMENT_TL(vaddr) > (entry & REGION_ENTRY_TL)) {
- return PGM_SEGMENT_TRANS;
+ if (edat2 && (entry & REGION3_ENTRY_CR) && asce_p) {
+ return PGM_TRANS_SPEC;
}
if (edat1 && (entry & REGION_ENTRY_P)) {
*flags &= ~PAGE_WRITE;
}
+ if (edat2 && (entry & REGION3_ENTRY_FC)) {
+ *raddr = (entry & REGION3_ENTRY_RFAA) |
+ (vaddr & ~REGION3_ENTRY_RFAA);
+ return 0;
+ }
+ if (VADDR_SEGMENT_TL(vaddr) < (entry & REGION_ENTRY_TF) >> 6 ||
+ VADDR_SEGMENT_TL(vaddr) > (entry & REGION_ENTRY_TL)) {
+ return PGM_SEGMENT_TRANS;
+ }
gaddr = (entry & REGION_ENTRY_ORIGIN) + VADDR_SEGMENT_TX(vaddr) * 8;
/* fall through */
case ASCE_TYPE_SEGMENT:
--
2.21.0
- [PULL 00/31] s390x/tcg update, David Hildenbrand, 2019/10/10
- [PULL 01/31] s390x/mmu: Drop debug logging from MMU code, David Hildenbrand, 2019/10/10
- [PULL 02/31] s390x/mmu: Move DAT protection handling out of mmu_translate_asce(), David Hildenbrand, 2019/10/10
- [PULL 03/31] s390x/mmu: Inject DAT exceptions from a single place, David Hildenbrand, 2019/10/10
- [PULL 05/31] s390x/mmu: Use TARGET_PAGE_MASK in mmu_translate_pte(), David Hildenbrand, 2019/10/10
- [PULL 04/31] s390x/mmu: Inject PGM_ADDRESSING on bogus table addresses, David Hildenbrand, 2019/10/10
- [PULL 08/31] s390x/mmu: Add EDAT2 translation support,
David Hildenbrand <=
- [PULL 06/31] s390x/mmu: DAT table definition overhaul, David Hildenbrand, 2019/10/10
- [PULL 10/31] s390x/mmu: Implement Instruction-Execution-Protection Facility, David Hildenbrand, 2019/10/10
- [PULL 07/31] s390x/mmu: Convert to non-recursive page table walk, David Hildenbrand, 2019/10/10
- [PULL 11/31] s390x/cpumodel: Prepare for changes of QEMU model, David Hildenbrand, 2019/10/10
- [PULL 09/31] s390x/mmu: Implement ESOP-2 and access-exception-fetch/store-indication facility, David Hildenbrand, 2019/10/10
- [PULL 12/31] s390x/cpumodel: Add new TCG features to QEMU cpu model, David Hildenbrand, 2019/10/10
- [PULL 13/31] target/s390x: Add ilen to unwind data, David Hildenbrand, 2019/10/10
- [PULL 14/31] target/s390x: Remove ilen parameter from tcg_s390_program_interrupt, David Hildenbrand, 2019/10/10
- [PULL 15/31] target/s390x: Remove ilen parameter from s390_program_interrupt, David Hildenbrand, 2019/10/10
- [PULL 16/31] target/s390x: Use tcg_s390_program_interrupt in TCG helpers, David Hildenbrand, 2019/10/10