[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 07/46] s390x/tcg: get rid of runtime_exception()
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 07/46] s390x/tcg: get rid of runtime_exception() |
Date: |
Thu, 14 Dec 2017 18:09:25 +0100 |
From: David Hildenbrand <address@hidden>
Let's use s390_program_interrupt() instead.
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/fpu_helper.c | 2 +-
target/s390x/int_helper.c | 14 +++++++-------
target/s390x/internal.h | 2 --
target/s390x/misc_helper.c | 16 ----------------
4 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c
index ffbeb3b2df..334159119f 100644
--- a/target/s390x/fpu_helper.c
+++ b/target/s390x/fpu_helper.c
@@ -44,7 +44,7 @@ static void ieee_exception(CPUS390XState *env, uint32_t dxc,
uintptr_t retaddr)
/* Install the DXC code. */
env->fpc = (env->fpc & ~0xff00) | (dxc << 8);
/* Trap. */
- runtime_exception(env, PGM_DATA, retaddr);
+ s390_program_interrupt(env, PGM_DATA, ILEN_AUTO, retaddr);
}
/* Should be called after any operation that may raise IEEE exceptions. */
diff --git a/target/s390x/int_helper.c b/target/s390x/int_helper.c
index 0076bea047..abf77a94e6 100644
--- a/target/s390x/int_helper.c
+++ b/target/s390x/int_helper.c
@@ -39,7 +39,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int64_t
b64)
int64_t q;
if (b == 0) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
ret = q = a / b;
@@ -47,7 +47,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int64_t
b64)
/* Catch non-representable quotient. */
if (ret != q) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
return ret;
@@ -60,7 +60,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a,
uint64_t b64)
uint64_t q;
if (b == 0) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
ret = q = a / b;
@@ -68,7 +68,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a,
uint64_t b64)
/* Catch non-representable quotient. */
if (ret != q) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
return ret;
@@ -79,7 +79,7 @@ int64_t HELPER(divs64)(CPUS390XState *env, int64_t a, int64_t
b)
{
/* Catch divide by zero, and non-representable quotient (MIN / -1). */
if (b == 0 || (b == -1 && a == (1ll << 63))) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
env->retxl = a % b;
return a / b;
@@ -92,7 +92,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah,
uint64_t al,
uint64_t ret;
/* Signal divide by zero. */
if (b == 0) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
if (ah == 0) {
/* 64 -> 64/64 case */
@@ -106,7 +106,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah,
uint64_t al,
env->retxl = a % b;
ret = q;
if (ret != q) {
- runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC());
+ s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC());
}
#else
S390CPU *cpu = s390_env_get_cpu(env);
diff --git a/target/s390x/internal.h b/target/s390x/internal.h
index 3aff54ada4..db39d5bfac 100644
--- a/target/s390x/internal.h
+++ b/target/s390x/internal.h
@@ -408,8 +408,6 @@ int mmu_translate_real(CPUS390XState *env, target_ulong
raddr, int rw,
/* misc_helper.c */
-void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp,
- uintptr_t retaddr);
int handle_diag_288(CPUS390XState *env, uint64_t r1, uint64_t r3);
void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3);
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 1ccbafbb7d..67628e690d 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -45,22 +45,6 @@
#define HELPER_LOG(x...)
#endif
-/* Raise an exception dynamically from a helper function. */
-void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp,
- uintptr_t retaddr)
-{
- CPUState *cs = CPU(s390_env_get_cpu(env));
-
- cs->exception_index = EXCP_PGM;
- env->int_pgm_code = excp;
- env->int_pgm_ilen = ILEN_AUTO;
-
- /* Use the (ultimate) callers address to find the insn that trapped. */
- cpu_restore_state(cs, retaddr);
-
- cpu_loop_exit(cs);
-}
-
/* Raise an exception statically from a TB. */
void HELPER(exception)(CPUS390XState *env, uint32_t excp)
{
--
2.13.6
- [qemu-s390x] [PULL 00/46] First batch of s390x patches for 2.12, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 02/46] pc-bios/s390-ccw: zero out bss section, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 01/46] s390x/migration: use zero flag parameter, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 04/46] s390x: introduce 2.12 compat machine, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 03/46] pc-bios/s390-ccw.img: update image, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 05/46] target/s390x: nuke DPRINTF in helper.c, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 06/46] s390x/tcg: introduce and use s390_program_interrupt(), Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 07/46] s390x/tcg: get rid of runtime_exception(),
Cornelia Huck <=
- [qemu-s390x] [PULL 08/46] s390x/tcg: rip out dead tpi code, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 10/46] s390x/pci: pass the retaddr to all PCI instructions, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 09/46] s390x/ioinst: pass the retaddr to all IO instructions, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 11/46] s390x/diag: pass the retaddr into handle_diag_308(), Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 12/46] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG), Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 13/46] s390x/tcg: don't exit the cpu loop in s390_cpu_virt_mem_rw(), Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 14/46] s390x/tcg: io instructions don't need potential_page_fault(), Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 15/46] s390x/tcg: use s390_program_interrupt() in SCLP Service Call, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 16/46] s390x/tcg: use s390_program_interrupt() in DIAG, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 17/46] s390x/tcg: use s390_program_interrupt() in per_check_exception(), Cornelia Huck, 2017/12/14