diff options
Diffstat (limited to 'target/s390x/misc_helper.c')
-rw-r--r-- | target/s390x/misc_helper.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index d23ffcd890..50cc046ca2 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "cpu.h" +#include "internal.h" #include "exec/memory.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" @@ -103,13 +104,17 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num) handle_diag_308(env, r1, r3); r = 0; break; + case 0x288: + /* time bomb (watchdog) */ + r = handle_diag_288(env, r1, r3); + break; default: r = -1; break; } if (r) { - program_interrupt(env, PGM_OPERATION, ILEN_AUTO); + program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO); } } @@ -451,6 +456,17 @@ void HELPER(per_check_exception)(CPUS390XState *env) } } +/* Check if an address is within the PER starting address and the PER + ending address. The address range might loop. */ +static inline bool get_per_in_range(CPUS390XState *env, uint64_t addr) +{ + if (env->cregs[10] <= env->cregs[11]) { + return env->cregs[10] <= addr && addr <= env->cregs[11]; + } else { + return env->cregs[10] <= addr || addr <= env->cregs[11]; + } +} + void HELPER(per_branch)(CPUS390XState *env, uint64_t from, uint64_t to) { if ((env->cregs[9] & PER_CR9_EVENT_BRANCH)) { |