[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 for-2.12 08/16] s390x/tcg: don't exit the cpu loo
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v3 for-2.12 08/16] s390x/tcg: don't exit the cpu loop in s390_cpu_virt_mem_rw() |
Date: |
Thu, 30 Nov 2017 17:27:36 +0100 |
s390_cpu_virt_mem_rw() must always return, so callers can react on
an exception (e.g. see ioinst_handle_stcrw()).
Therefore, using program_interrupt() is wrong. Fix that up.
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/mmu_helper.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
index dbe2f511f8..f477cc006a 100644
--- a/target/s390x/mmu_helper.c
+++ b/target/s390x/mmu_helper.c
@@ -64,7 +64,9 @@ static void trigger_access_exception(CPUS390XState *env,
uint32_t type,
kvm_s390_access_exception(cpu, type, tec);
} else {
CPUState *cs = CPU(cpu);
- stq_phys(cs->as, env->psa + offsetof(LowCore, trans_exc_code), tec);
+ if (type != PGM_ADDRESSING) {
+ stq_phys(cs->as, env->psa + offsetof(LowCore, trans_exc_code),
tec);
+ }
trigger_pgm_exception(env, type, ilen);
}
}
@@ -443,7 +445,8 @@ int mmu_translate(CPUS390XState *env, target_ulong vaddr,
int rw, uint64_t asc,
/**
* translate_pages: Translate a set of consecutive logical page addresses
- * to absolute addresses
+ * to absolute addresses. This function is used for TCG and old KVM without
+ * the MEMOP interface.
*/
static int translate_pages(S390CPU *cpu, vaddr addr, int nr_pages,
target_ulong *pages, bool is_write)
@@ -459,7 +462,7 @@ static int translate_pages(S390CPU *cpu, vaddr addr, int
nr_pages,
}
if (!address_space_access_valid(&address_space_memory, pages[i],
TARGET_PAGE_SIZE, is_write)) {
- program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO);
+ trigger_access_exception(env, PGM_ADDRESSING, ILEN_AUTO, 0);
return -EFAULT;
}
addr += TARGET_PAGE_SIZE;
--
2.14.3
- [qemu-s390x] [PATCH v3 for-2.12 00/16] s390x/tcg: cleanup and fix program interrupts, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 01/16] s390x/tcg: introduce and use s390_program_interrupt(), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 02/16] s390x/tcg: get rid of runtime_exception(), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 03/16] s390x/tcg: rip out dead tpi code, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 04/16] s390x/ioinst: pass the retaddr to all IO instructions, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 06/16] s390x/diag: pass the retaddr into handle_diag_308(), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 07/16] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 05/16] s390x/pci: pass the retaddr to all PCI instructions, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 08/16] s390x/tcg: don't exit the cpu loop in s390_cpu_virt_mem_rw(),
David Hildenbrand <=
- [qemu-s390x] [PATCH v3 for-2.12 09/16] s390x/tcg: io instructions don't need potential_page_fault(), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 10/16] s390x/tcg: use s390_program_interrupt() in SCLP Service Call, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 11/16] s390x/tcg: use s390_program_interrupt() in DIAG, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 12/16] s390x/tcg: use s390_program_interrupt() in per_check_exception(), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 13/16] s390x/tcg: use s390_program_interrupt() in SACF, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 14/16] s390x/tcg: use s390_program_interrupt() in STSI, David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 15/16] s390x/tcg: drop program_interrupt(), David Hildenbrand, 2017/11/30
- [qemu-s390x] [PATCH v3 for-2.12 16/16] s390x/tcg: drop potential_page_fault(), David Hildenbrand, 2017/11/30
- Re: [qemu-s390x] [PATCH v3 for-2.12 00/16] s390x/tcg: cleanup and fix program interrupts, Cornelia Huck, 2017/11/30