diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-04-09 18:21:22 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-04-09 18:21:23 +0100 |
commit | 1e7e92e2ef874aa3a235d59b2be1da7a29b6fd29 (patch) | |
tree | bc26754782cb19637dde44443a690d95fca13ef2 /target | |
parent | 915d34c5f99b0ab91517c69f54272bfdb6ca2b32 (diff) | |
parent | b3a184f51fbed3401694a9619e6842f882a64fee (diff) |
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180409' into staging
Fixes for s390x: kvm, vfio-ccw, ipl code, bios. Includes a rebuild
of s390-ccw.img and s390-netboot.img.
# gpg: Signature made Mon 09 Apr 2018 16:08:19 BST
# gpg: using RSA key DECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
# gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# gpg: aka "Cornelia Huck <cohuck@kernel.org>"
# gpg: aka "Cornelia Huck <cohuck@redhat.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF
* remotes/cohuck/tags/s390x-20180409:
s390x: load_psw() should only exchange the PSW for KVM
s390x/mmu: don't overwrite pending exception in mmu translate
vfio-ccw: fix memory leaks in vfio_ccw_realize()
pc-bios/s390: update images
s390: Do not pass inofficial IPL type to the guest
s390: Ensure IPL from SCSI works as expected
s390: Refactor IPL parameter block generation
s390x/kvm: call cpu_synchronize_state() on every kvm_arch_handle_exit()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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 615fa24ab9..e8548f340a 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 f570896dc1..fb59d92def 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 1deeb6e6e4..a25deef5dd 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; } |