diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/helper.c | 10 | ||||
-rw-r--r-- | target/s390x/kvm.c | 2 | ||||
-rw-r--r-- | target/s390x/mmu_helper.c | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 615fa24..e8548f3 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -103,16 +103,18 @@ void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr) env->psw.addr = addr; env->psw.mask = mask; - if (tcg_enabled()) { - env->cc_op = (mask >> 44) & 3; + + /* KVM will handle all WAITs and trigger a WAIT exit on disabled_wait */ + if (!tcg_enabled()) { + return; } + env->cc_op = (mask >> 44) & 3; if ((old_mask ^ mask) & PSW_MASK_PER) { s390_cpu_recompute_watchpoints(CPU(s390_env_get_cpu(env))); } - /* KVM will handle all WAITs and trigger a WAIT exit on disabled_wait */ - if (tcg_enabled() && (mask & PSW_MASK_WAIT)) { + if (mask & PSW_MASK_WAIT) { s390_handle_wait(s390_env_get_cpu(env)); } } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index f570896..fb59d92 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1778,6 +1778,8 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) qemu_mutex_lock_iothread(); + cpu_synchronize_state(cs); + switch (run->exit_reason) { case KVM_EXIT_S390_SIEIC: ret = handle_intercept(cpu); diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 1deeb6e..a25deef 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -325,7 +325,7 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr, r = mmu_translate_region(env, vaddr, asc, asce, level, raddr, flags, rw, exc); - if (rw == MMU_DATA_STORE && !(*flags & PAGE_WRITE)) { + if (!r && rw == MMU_DATA_STORE && !(*flags & PAGE_WRITE)) { trigger_prot_fault(env, vaddr, asc, rw, exc); return -1; } |